package com.sky.ioc.service.security.impl;

import com.sky.ioc.entity.params.security.PersonParam;
import com.sky.ioc.mapper.SecurityPersonMapper;
import com.sky.ioc.service.security.SecurityPersonService;
import com.sky.ioc.tool.ReturnMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class SecurityPersonServiceImpl implements SecurityPersonService {

    @Autowired
    SecurityPersonMapper securityPersonMapper;


    @Override
    public ReturnMsg getPersonList(PersonParam personParam) {
        if(personParam!=null&&personParam.getName()!=null&&!personParam.getName().isEmpty()){
            String name = "%"+personParam.getName()+"%";
            personParam.setName(name);
        }
        List<Map<String,Object>> list = securityPersonMapper.getListByTimeAndName(personParam);
        return ReturnMsg.ok(list);
    }
}
