package com.ssm.manage.dao.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ssm.core.impl.BaseDaoImpl;
import com.ssm.manage.dao.RlRoleStaffDao;
import com.ssm.manage.dao.SsmBaseStaffDao;
import com.ssm.manage.dao.SsmBaseStoreDao;
import com.ssm.manage.dao.SsmSysStoreRoleDao;
import com.ssm.manage.entity.BaseStaff;
import com.ssm.manage.entity.BaseStore;
import com.ssm.manage.entity.RlRoleStaff;
import com.ssm.manage.entity.SysStoreRole;
import com.ssm.manage.mapper.BaseStaffMapper;
import com.ssm.manage.query.StaffRequest;
import com.ssm.manage.query.StoreRequest;
import com.ssm.manage.response.StaffResponse;
import com.ssm.manage.service.SsmBaseStoreService;
import com.ssm.manage.utils.StaffInfo;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import tk.mybatis.mapper.entity.Example;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

@Component
public class SsmBaseStaffDaoImpl extends BaseDaoImpl<BaseStaff> implements SsmBaseStaffDao {
    @Autowired
    private BaseStaffMapper mapper;
    @Autowired
    private SsmBaseStoreService ssmBaseStoreService;
    @Autowired
    private SsmSysStoreRoleDao ssmSysStoreRoleDao;

    @Autowired
    private RlRoleStaffDao rlRoleStaffDao;
    @Override
    public BaseStaffMapper getMapper() {
        return mapper;
    }

    @Override
    public PageInfo<StaffResponse> selectPage(StaffRequest staffRequest) {
        Example example = new Example(BaseStaff.class);
        Example.Criteria criteria = example.createCriteria();

        if (StringUtils.isNotBlank(staffRequest.getBrandNumber())){
            criteria.andLike("brandNumber","%" + staffRequest.getBrandNumber() + "%");
        }
        if (StringUtils.isNotBlank(staffRequest.getStaffName())){
            criteria.andLike("staffName","%" + staffRequest.getStaffName() + "%");
        }
        if (StringUtils.isNotBlank(staffRequest.getMobilePhone())){
            criteria.andEqualTo("mobilePhone", staffRequest.getMobilePhone());
        }
        if (StringUtils.isNotBlank(String.valueOf(staffRequest.getType()))){
            criteria.andEqualTo("type",staffRequest.getType());
        }
        if (null != staffRequest.getState() && staffRequest.getState() == 1 && null != staffRequest.getStartTime() && null != staffRequest.getEndTime()){
            criteria.andBetween("joinedDate",staffRequest.getStartTime(), staffRequest.getEndTime());
        }
        if (null != staffRequest.getState() && staffRequest.getState() == 0 && null != staffRequest.getStartTime() && null != staffRequest.getEndTime()){
            criteria.andBetween("leaveDate",staffRequest.getStartTime(), staffRequest.getEndTime());
        }
        if(null != staffRequest.getState()) {
            criteria.andEqualTo("state", staffRequest.getState());
        }
//        BaseStore baseStore = ssmBaseStoreService.selectByPrimaryKey(staffRequest.getStoreId());
//        if(baseStore.getParentId()==null){
//            List<BaseStore> baseStoreList = ssmBaseStoreService.selectChildren(baseStore.getId());
//            List<Long> collect = baseStoreList.stream().map(BaseStore::getId).collect(Collectors.toList());
//            criteria.andIn("storeId",collect);
//        }else
        criteria.andEqualTo("storeId",staffRequest.getStoreId());
        List<BaseStaff> list1 = selectByExample(example);
        PageHelper.startPage(staffRequest.getPageNum(),staffRequest.getPageSize(),"CAST(brand_number AS SIGNED) asc");
        List<BaseStaff> list = selectByExample(example);
        List<StaffResponse> resList = new ArrayList<>();
        if (list.size() > 0){
            for (BaseStaff baseStaff : list) {
                StaffResponse staffResponse = new StaffResponse();
                BeanUtils.copyProperties(baseStaff,staffResponse);
                if (staffResponse.getJob() == StaffInfo.job1.getType()){
                    staffResponse.setJobName(StaffInfo.job1.getName());
                }else if (staffResponse.getJob() == StaffInfo.job2.getType()){
                    staffResponse.setJobName(StaffInfo.job2.getName());
                }else if (staffResponse.getJob() == StaffInfo.job3.getType()){
                    staffResponse.setJobName(StaffInfo.job3.getName());
                }else if (staffResponse.getJob() == StaffInfo.job4.getType()){
                    staffResponse.setJobName(StaffInfo.job4.getName());
                }else if (staffResponse.getJob() == StaffInfo.job5.getType()){
                    staffResponse.setJobName(StaffInfo.job5.getName());
                }
                if (staffResponse.getGrade() == StaffInfo.grade1.getType()){
                    staffResponse.setGradeName(StaffInfo.grade1.getName());
                } else if (staffResponse.getGrade() == StaffInfo.grade2.getType()){
                    staffResponse.setGradeName(StaffInfo.grade2.getName());
                } else if (staffResponse.getGrade() == StaffInfo.grade3.getType()){
                    staffResponse.setGradeName(StaffInfo.grade3.getName());
                } else if (staffResponse.getGrade() == StaffInfo.grade4.getType()){
                    staffResponse.setGradeName(StaffInfo.grade4.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade51.getType()){
                    staffResponse.setGradeName(StaffInfo.grade51.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade52.getType()){
                    staffResponse.setGradeName(StaffInfo.grade52.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade53.getType()){
                    staffResponse.setGradeName(StaffInfo.grade53.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade54.getType()){
                    staffResponse.setGradeName(StaffInfo.grade54.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade55.getType()){
                    staffResponse.setGradeName(StaffInfo.grade55.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade56.getType()){
                    staffResponse.setGradeName(StaffInfo.grade56.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade57.getType()){
                    staffResponse.setGradeName(StaffInfo.grade57.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade58.getType()){
                    staffResponse.setGradeName(StaffInfo.grade58.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade59.getType()){
                    staffResponse.setGradeName(StaffInfo.grade59.getName());
                } else if (staffResponse.getGrade() == StaffInfo.grade6.getType()){
                    staffResponse.setGradeName(StaffInfo.grade6.getName());
                }
                resList.add(staffResponse);
            }
        }
        PageInfo<StaffResponse> pageInfo = new PageInfo<>(resList);
        pageInfo.setTotal(list1.size());
        return pageInfo;
    }

    @Override
    public PageInfo<StaffResponse> selectPageNew(StaffRequest staffRequest) {
        Example example = new Example(BaseStaff.class);
        Example.Criteria criteria = example.createCriteria();

        if (StringUtils.isNotBlank(staffRequest.getBrandNumber())){
            criteria.andLike("brandNumber","%" + staffRequest.getBrandNumber() + "%");
        }
        if (StringUtils.isNotBlank(staffRequest.getStaffName())){
            criteria.andLike("staffName","%" + staffRequest.getStaffName() + "%");
        }
        if (StringUtils.isNotBlank(staffRequest.getMobilePhone())){
            criteria.andEqualTo("mobilePhone", staffRequest.getMobilePhone());
        }
        if (StringUtils.isNotBlank(String.valueOf(staffRequest.getType()))){
            criteria.andEqualTo("type",staffRequest.getType());
        }
        if (null != staffRequest.getState() && staffRequest.getState() == 1 && null != staffRequest.getStartTime() && null != staffRequest.getEndTime()){
            criteria.andBetween("joinedDate",staffRequest.getStartTime(), staffRequest.getEndTime());
        }
        if (null != staffRequest.getState() && staffRequest.getState() == 0 && null != staffRequest.getStartTime() && null != staffRequest.getEndTime()){
            criteria.andBetween("leaveDate",staffRequest.getStartTime(), staffRequest.getEndTime());
        }
        if(null != staffRequest.getState()) {
            criteria.andEqualTo("state", staffRequest.getState());
        }
//        BaseStore baseStore = ssmBaseStoreService.selectByPrimaryKey(staffRequest.getStoreId());
//        if(baseStore.getParentId()==null){
//            List<BaseStore> baseStoreList = ssmBaseStoreService.selectChildren(baseStore.getId());
//            List<Long> collect = baseStoreList.stream().map(BaseStore::getId).collect(Collectors.toList());
//            criteria.andIn("storeId",collect);
//        }else
            criteria.andEqualTo("storeId",staffRequest.getStoreId());

        List<BaseStaff> list1 = selectByExample(example);
        PageHelper.startPage(staffRequest.getPageNum(),staffRequest.getPageSize(),"CAST(brand_number AS SIGNED) asc");
        List<BaseStaff> list = selectByExample(example);
        List<StaffResponse> resList = new ArrayList<>();
        if (list.size() > 0){
            for (BaseStaff baseStaff : list) {
                StaffResponse staffResponse = new StaffResponse();
                BeanUtils.copyProperties(baseStaff,staffResponse);
                if (staffResponse.getJob() == StaffInfo.job1.getType()){
                    staffResponse.setJobName(StaffInfo.job1.getName());
                }else if (staffResponse.getJob() == StaffInfo.job2.getType()){
                    staffResponse.setJobName(StaffInfo.job2.getName());
                }else if (staffResponse.getJob() == StaffInfo.job3.getType()){
                    staffResponse.setJobName(StaffInfo.job3.getName());
                }else if (staffResponse.getJob() == StaffInfo.job4.getType()){
                    staffResponse.setJobName(StaffInfo.job4.getName());
                }else if (staffResponse.getJob() == StaffInfo.job5.getType()){
                    staffResponse.setJobName(StaffInfo.job5.getName());
                }
                if (staffResponse.getGrade() == StaffInfo.grade1.getType()){
                    staffResponse.setGradeName(StaffInfo.grade1.getName());
                } else if (staffResponse.getGrade() == StaffInfo.grade2.getType()){
                    staffResponse.setGradeName(StaffInfo.grade2.getName());
                } else if (staffResponse.getGrade() == StaffInfo.grade3.getType()){
                    staffResponse.setGradeName(StaffInfo.grade3.getName());
                } else if (staffResponse.getGrade() == StaffInfo.grade4.getType()){
                    staffResponse.setGradeName(StaffInfo.grade4.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade51.getType()){
                    staffResponse.setGradeName(StaffInfo.grade51.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade52.getType()){
                    staffResponse.setGradeName(StaffInfo.grade52.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade53.getType()){
                    staffResponse.setGradeName(StaffInfo.grade53.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade54.getType()){
                    staffResponse.setGradeName(StaffInfo.grade54.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade55.getType()){
                    staffResponse.setGradeName(StaffInfo.grade55.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade56.getType()){
                    staffResponse.setGradeName(StaffInfo.grade56.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade57.getType()){
                    staffResponse.setGradeName(StaffInfo.grade57.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade58.getType()){
                    staffResponse.setGradeName(StaffInfo.grade58.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade59.getType()){
                    staffResponse.setGradeName(StaffInfo.grade59.getName());
                } else if (staffResponse.getGrade() == StaffInfo.grade6.getType()){
                    staffResponse.setGradeName(StaffInfo.grade6.getName());
                }
                //查询当前用户关联的角色
                RlRoleStaff rlRoleStaff = new RlRoleStaff();
                rlRoleStaff.setStaffId(staffResponse.getId());
                List<RlRoleStaff> roleStaffs = rlRoleStaffDao.select(rlRoleStaff);
                if(roleStaffs!=null && roleStaffs.size()>0){
                    Example example1 = new Example(SysStoreRole.class);
                    Example.Criteria criteria1 = example1.createCriteria();
                    List<Long> roleId = roleStaffs.stream().map(RlRoleStaff::getRoleId).collect(Collectors.toList());
                    criteria1.andIn("id",roleId);
                    List<SysStoreRole> sysStoreRoles = ssmSysStoreRoleDao.selectByExample(example1);
                    staffResponse.setRoleList(sysStoreRoles);
                }
                resList.add(staffResponse);
            }
        }
        PageInfo<StaffResponse> pageInfo = new PageInfo<>(resList);
        pageInfo.setTotal(list1.size());
        return pageInfo;
    }

    @Override
    public PageInfo<StaffResponse> parentsStaff(StaffRequest staffRequest) {
        Example example = new Example(BaseStaff.class);
        Example.Criteria criteria = example.createCriteria();

        if (StringUtils.isNotBlank(staffRequest.getBrandNumber())){
            criteria.andLike("brandNumber","%" + staffRequest.getBrandNumber() + "%");
        }
        if (StringUtils.isNotBlank(staffRequest.getStaffName())){
            criteria.andLike("staffName","%" + staffRequest.getStaffName() + "%");
        }
        if (StringUtils.isNotBlank(staffRequest.getMobilePhone())){
            criteria.andEqualTo("mobilePhone", staffRequest.getMobilePhone());
        }
        if (StringUtils.isNotBlank(String.valueOf(staffRequest.getType()))){
            criteria.andEqualTo("type",staffRequest.getType());
        }
        if (null != staffRequest.getState() && staffRequest.getState() == 1 && null != staffRequest.getStartTime() && null != staffRequest.getEndTime()){
            criteria.andBetween("joinedDate",staffRequest.getStartTime(), staffRequest.getEndTime());
        }
        if (null != staffRequest.getState() && staffRequest.getState() == 0 && null != staffRequest.getStartTime() && null != staffRequest.getEndTime()){
            criteria.andBetween("leaveDate",staffRequest.getStartTime(), staffRequest.getEndTime());
        }
        if(null != staffRequest.getState()) {
            criteria.andEqualTo("state", staffRequest.getState());
        }
        BaseStore baseStore = ssmBaseStoreService.selectByPrimaryKey(staffRequest.getStoreId());
        if(baseStore.getParentId()==null){
            List<BaseStore> baseStoreList = ssmBaseStoreService.selectChildren(baseStore.getId());
            List<Long> collect = baseStoreList.stream().map(BaseStore::getId).collect(Collectors.toList());
            criteria.andIn("storeId",collect);
        }else
        criteria.andEqualTo("storeId",staffRequest.getStoreId());

        List<BaseStaff> list1 = selectByExample(example);
        PageHelper.startPage(staffRequest.getPageNum(),staffRequest.getPageSize(),"CAST(brand_number AS SIGNED) asc");
        List<BaseStaff> list = selectByExample(example);
        List<StaffResponse> resList = new ArrayList<>();
        if (list.size() > 0){
            for (BaseStaff baseStaff : list) {
                StaffResponse staffResponse = new StaffResponse();
                BeanUtils.copyProperties(baseStaff,staffResponse);
                if (staffResponse.getJob() == StaffInfo.job1.getType()){
                    staffResponse.setJobName(StaffInfo.job1.getName());
                }else if (staffResponse.getJob() == StaffInfo.job2.getType()){
                    staffResponse.setJobName(StaffInfo.job2.getName());
                }else if (staffResponse.getJob() == StaffInfo.job3.getType()){
                    staffResponse.setJobName(StaffInfo.job3.getName());
                }else if (staffResponse.getJob() == StaffInfo.job4.getType()){
                    staffResponse.setJobName(StaffInfo.job4.getName());
                }else if (staffResponse.getJob() == StaffInfo.job5.getType()){
                    staffResponse.setJobName(StaffInfo.job5.getName());
                }
                if (staffResponse.getGrade() == StaffInfo.grade1.getType()){
                    staffResponse.setGradeName(StaffInfo.grade1.getName());
                } else if (staffResponse.getGrade() == StaffInfo.grade2.getType()){
                    staffResponse.setGradeName(StaffInfo.grade2.getName());
                } else if (staffResponse.getGrade() == StaffInfo.grade3.getType()){
                    staffResponse.setGradeName(StaffInfo.grade3.getName());
                } else if (staffResponse.getGrade() == StaffInfo.grade4.getType()){
                    staffResponse.setGradeName(StaffInfo.grade4.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade51.getType()){
                    staffResponse.setGradeName(StaffInfo.grade51.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade52.getType()){
                    staffResponse.setGradeName(StaffInfo.grade52.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade53.getType()){
                    staffResponse.setGradeName(StaffInfo.grade53.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade54.getType()){
                    staffResponse.setGradeName(StaffInfo.grade54.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade55.getType()){
                    staffResponse.setGradeName(StaffInfo.grade55.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade56.getType()){
                    staffResponse.setGradeName(StaffInfo.grade56.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade57.getType()){
                    staffResponse.setGradeName(StaffInfo.grade57.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade58.getType()){
                    staffResponse.setGradeName(StaffInfo.grade58.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade59.getType()){
                    staffResponse.setGradeName(StaffInfo.grade59.getName());
                } else if (staffResponse.getGrade() == StaffInfo.grade6.getType()){
                    staffResponse.setGradeName(StaffInfo.grade6.getName());
                }
                resList.add(staffResponse);
            }
        }
        PageInfo<StaffResponse> pageInfo = new PageInfo<>(resList);
        pageInfo.setTotal(list1.size());
        return pageInfo;
    }



    @Override
    public PageInfo<StaffResponse> selectPagestaff(StaffRequest staffRequest) {
        Example example = new Example(BaseStaff.class);
        Example.Criteria criteria = example.createCriteria();

        if (StringUtils.isNotBlank(staffRequest.getBrandNumber())){
            criteria.andLike("brandNumber","%" + staffRequest.getBrandNumber() + "%");
        }
        if (StringUtils.isNotBlank(staffRequest.getStaffName())){
            criteria.andLike("staffName","%" + staffRequest.getStaffName() + "%");
        }
        if (StringUtils.isNotBlank(String.valueOf(staffRequest.getType()))){
            criteria.andEqualTo("type",staffRequest.getType());
        }
        if (StringUtils.isNotBlank(staffRequest.getMobilePhone())){
            criteria.andEqualTo("mobilePhone", staffRequest.getMobilePhone());
        }
        if (null != staffRequest.getState() && staffRequest.getState() == 1 && null != staffRequest.getStartTime() && null != staffRequest.getEndTime()){
            criteria.andBetween("joinedDate",staffRequest.getStartTime(), staffRequest.getEndTime());
        }
        if (null != staffRequest.getState() && staffRequest.getState() == 0 && null != staffRequest.getStartTime() && null != staffRequest.getEndTime()){
            criteria.andBetween("leaveDate",staffRequest.getStartTime(), staffRequest.getEndTime());
        }
        if(null != staffRequest.getState()) {
            criteria.andEqualTo("state", staffRequest.getState());
        }
        criteria.andEqualTo("storeId",staffRequest.getStoreId());
        PageHelper.startPage(staffRequest.getPageNum(),staffRequest.getPageSize(),staffRequest.getOrderAndSort());
        List<BaseStaff> list = selectByExample(example);
        List<StaffResponse> resList = new ArrayList<>();
        if (list.size() > 0){
            for (BaseStaff baseStaff : list) {
                StaffResponse staffResponse = new StaffResponse();
                BeanUtils.copyProperties(baseStaff,staffResponse);
                if (staffResponse.getJob() == StaffInfo.job1.getType()){
                    staffResponse.setJobName(StaffInfo.job1.getName());
                }else if (staffResponse.getJob() == StaffInfo.job2.getType()){
                    staffResponse.setJobName(StaffInfo.job2.getName());
                }else if (staffResponse.getJob() == StaffInfo.job3.getType()){
                    staffResponse.setJobName(StaffInfo.job3.getName());
                }else if (staffResponse.getJob() == StaffInfo.job4.getType()){
                    staffResponse.setJobName(StaffInfo.job4.getName());
                }else if (staffResponse.getJob() == StaffInfo.job5.getType()){
                    staffResponse.setJobName(StaffInfo.job5.getName());
                }
                if (staffResponse.getGrade() == StaffInfo.grade1.getType()){
                    staffResponse.setGradeName(StaffInfo.grade1.getName());
                } else if (staffResponse.getGrade() == StaffInfo.grade2.getType()){
                    staffResponse.setGradeName(StaffInfo.grade2.getName());
                } else if (staffResponse.getGrade() == StaffInfo.grade3.getType()){
                    staffResponse.setGradeName(StaffInfo.grade3.getName());
                } else if (staffResponse.getGrade() == StaffInfo.grade4.getType()){
                    staffResponse.setGradeName(StaffInfo.grade4.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade51.getType()){
                    staffResponse.setGradeName(StaffInfo.grade51.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade52.getType()){
                    staffResponse.setGradeName(StaffInfo.grade52.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade53.getType()){
                    staffResponse.setGradeName(StaffInfo.grade53.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade54.getType()){
                    staffResponse.setGradeName(StaffInfo.grade54.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade55.getType()){
                    staffResponse.setGradeName(StaffInfo.grade55.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade56.getType()){
                    staffResponse.setGradeName(StaffInfo.grade56.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade57.getType()){
                    staffResponse.setGradeName(StaffInfo.grade57.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade58.getType()){
                    staffResponse.setGradeName(StaffInfo.grade58.getName());
                }else if (staffResponse.getGrade() == StaffInfo.grade59.getType()){
                    staffResponse.setGradeName(StaffInfo.grade59.getName());
                } else if (staffResponse.getGrade() == StaffInfo.grade6.getType()){
                    staffResponse.setGradeName(StaffInfo.grade6.getName());
                }
                resList.add(staffResponse);
            }
        }
        PageInfo<StaffResponse> pageInfo = new PageInfo<>(resList);
        return pageInfo;
    }

    @Override
    public List<BaseStaff> selectList(StaffRequest staffRequest) {

        Example example = new Example(BaseStaff.class);
        Example.Criteria criteria = example.createCriteria();
        if (StringUtils.isNotBlank(staffRequest.getBrandNumber())){
            criteria.andEqualTo("brandNumber", staffRequest.getBrandNumber() );
        }
        criteria.andEqualTo("storeId",staffRequest.getStoreId());
        List<BaseStaff> list = selectByExample(example);
        return list;
    }

    @Override
    public int insertBatch(List<BaseStaff> list) {
        return mapper.insertBatch(list);
    }

    @Override
    public List<StaffRequest> selectCheck(BaseStaff baseStaff) {
        List<StaffRequest> i=mapper.selectCheck(baseStaff);
        return i;
    }

    @Override
    public List<StaffRequest> CheckPhone(BaseStaff baseStaff) {
        List<StaffRequest> i=mapper.CheckPhone(baseStaff);
        return i;
    }

    @Override
    public List<BaseStaff> selectByAllSalemans() {
        return mapper.selectByAllSalemans();
    }

    @Override
    public void updateStaffState(Integer state, String identityCard, String staffName, String mobilePhone,Long storeId) {

        mapper.updateStaffState(state,identityCard,staffName,mobilePhone,storeId);
    }
}
