Commit 4d7fa256 authored by chenyuxi's avatar chenyuxi

feat: 预入职里的批量更新

parent bf4067b2
......@@ -19,10 +19,12 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.LocalDateTimeUtils;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
/**
......@@ -97,6 +99,27 @@ public class PreUploadEmpImportTwoVo implements Serializable {
@ExcelAttribute(name = "毕业时间", isDate = true, pattern = "entryDate")
private String gradutionDate;
// 1.9.7:主要工作经历(t_emp_work_recording)
@ExcelAttribute(name = "是否为首份工作", isDataId = true, readConverterExp = "0=否,1=是")
private String isFirstWork;
@ExcelAttribute(name = "工作单位", maxLength = 100)
private String workUnit;
@ExcelAttribute(name = "工作岗位", maxLength = 100)
private String workJob;
@ExcelAttribute(name = "开始工作日期", isDate = true, dateFormat = LocalDateTimeUtils.DATE_TIME_PATTERN_DEFAULT)
private String startDate;
@ExcelAttribute(name = "结束工作日期", isDate = true, pattern = "startDate", dateFormat = LocalDateTimeUtils.DATE_TIME_PATTERN_DEFAULT)
private String endDate;
// 1.9.7:主要家庭成员信息(t_emp_family)
@ExcelAttribute(name = "家庭成员姓名", maxLength = 20)
private String familyName;
@ExcelAttribute(name = "家庭成员与本人关系", isDataId = true,dataType = ExcelAttributeConstants.FAMILY_RELATION, maxLength = 32)
private String relationshipSelf;
@ExcelAttribute(name = "手机号码(家庭成员)", isPhone = true, maxLength = 32)
private String contractTel;
// 紧急联系人
// private TPreEmpContactInfo tpreEmpContactInfo
// 紧急联系人姓名 与本人关系 联系地址-省 联系地址-市 联系地址-区/县 联系地址-详细地址 手机号码(紧急联系人)
......@@ -129,6 +152,37 @@ public class PreUploadEmpImportTwoVo implements Serializable {
@ExcelAttribute(name = "计税月份", isDate = true, dateFormat = "yyyyMM", maxLength = 6)
private String taxMonth;
@ExcelAttribute(name = "是否有不良记录", isDataId = true, readConverterExp = "0=是,1=否")
private String badRecordFlag;
@ExcelAttribute(name = "是否有职业资格证书", isDataId = true, readConverterExp = "0=是,1=否")
private String haveQualification;
// 1.9.7: 职业资格信息
@ExcelAttribute(name = "申报年度", isDate = true, dateFormat = "yyyy", maxLength = 32)
private String declareYear;
@ExcelAttribute(name = "职业资格名称", isDataId = true, dataType = ExcelAttributeConstants.QUALIFICATION_TYPE, maxLength = 32)
private String qualificationType;
// 1.9.7: 伤残信息(t_emp_disability_info)
@ExcelAttribute(name = "是否曾被认定为工伤", isDataId = true, readConverterExp = "0=是,1=否", maxLength = 1)
private String injuryIdentification;
@ExcelAttribute(name = "是否有职业病", isDataId = true, readConverterExp = "0=是,1=否", maxLength = 1)
private String occupationalDiseaseFlag;
@ExcelAttribute(name = "职业病名称", maxLength = 50)
private String occupationalDisease;
@ExcelAttribute(name = "是否有传染性疾病", isDataId = true, readConverterExp = "0=是,1=否", maxLength = 1)
private String infectiousDiseaseFlag;
@ExcelAttribute(name = "传染病名称", maxLength = 50)
private String infectiousName;
@ExcelAttribute(name = "是否被劳动能力鉴定委员会鉴定为具有伤残等级", isDataId = true, readConverterExp = "0=是,1=否", maxLength = 1)
private String disabilityFlag;
@ExcelAttribute(name = "伤残病名称", maxLength = 50)
private String disabilityName;
@ExcelAttribute(name = "伤残等级",isDataId = true, dataType = ExcelAttributeConstants.DISABILITY_GRADE, maxLength = 32)
private String disabilityLevel;
@ExcelAttribute(name = "是否从事过井下、高空、高温、特别繁重体力劳动以及有毒有害工种", isDataId = true, readConverterExp = "0=是,1=否", maxLength = 1)
private String otherFlag;
// 字典值起始
@ExcelAttribute(name = "员工类型-值")
private String empNatrueValue;
......@@ -187,11 +241,32 @@ public class PreUploadEmpImportTwoVo implements Serializable {
@ExcelAttribute(name = "身份证截止日期-值")
private Date validityEndValue;
@ExcelAttribute(name = "是否有不良记录", isDataId = true, readConverterExp = "0=是,1=否")
private String badRecordFlag;
@ExcelAttribute(name = "开始工作日期-值")
private LocalDateTime startDateValue;
@ExcelAttribute(name = "结束工作日期-值")
private LocalDateTime endDateValue;
@ExcelAttribute(name = "与本人关系")
private String relationshipSelfValue;
@ExcelAttribute(name = "申报年度")
private String declareYearValue;
@ExcelAttribute(name = "职业资格名称")
private String qualificationTypeValue;
@ExcelAttribute(name = "是否曾被认定为工伤")
private String injuryIdentificationValue;
@ExcelAttribute(name = "是否有职业病")
private String occupationalDiseaseFlagValue;
@ExcelAttribute(name = "是否有传染性疾病")
private String infectiousDiseaseFlagValue;
@ExcelAttribute(name = "是否被劳动能力鉴定委员会鉴定为具有伤残等级")
private String disabilityFlagValue;
@ExcelAttribute(name = "伤残等级")
private String disabilityLevelValue;
@ExcelAttribute(name = "是否从事过井下、高空、高温、特别繁重体力劳动以及有毒有害工种")
private String otherFlagValue;
@ExcelAttribute(name = "是否有职业资格证书", isDataId = true, readConverterExp = "0=是,1=否")
private String haveQualification;
// 字典值结束
@TableField(exist = false)
......
......@@ -133,6 +133,10 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
private final TCompleteMonitorService completeMonitorService;
private final TEmpBadRecordService tEmpBadRecordService;
private final TEmpWorkRecordingService tEmpWorkRecordingService;
private final TEmpFamilyService tEmpFamilyService;
private final TEmpProfessionalQualificationService tEmpProfessionalQualificationService;
private final TEmpDisabilityInfoService tEmpDisabilityInfoService;
@Autowired
private OSSUtil ossUtil;
......@@ -3203,9 +3207,14 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
}
String[] modelTitle = {"员工姓名", "身份证号", "员工类型", "身份证开始日期", "身份证截止日期", "婚姻状况", "民族"
, "政治面貌", "手机号码", "邮箱", "户籍所在地-省", "户籍所在地-市", "户籍所在地-区/县", "户口性质", "档案所在地-省"
, "档案所在地-市", "档案所在地-区/县", "通信地址-省", "通信地址-市", "通信地址-区/县", "通信地址-详细地址"
, "备注", "是否有职业资格证书","是否有不良记录","是否大专及以上", "最高学历", "学校", "专业", "入学时间", "毕业时间", "紧急联系人姓名"
, "紧急联系人与本人关系", "联系地址-省", "联系地址-市", "联系地址-区/县", "联系地址-详细地址"
, "档案所在地-市", "档案所在地-区/县", "通信地址-省", "通信地址-市", "通信地址-区/县", "通信地址-详细地址", "备注"
, "是否大专及以上", "最高学历", "学校", "专业", "入学时间", "毕业时间"
, "是否为首份工作", "工作单位", "工作岗位", "开始工作日期", "结束工作日期"
, "家庭成员姓名", "家庭成员与本人关系", "手机号码(家庭成员)"
, "是否有职业资格证书", "申报年度", "职业资格名称"
, "是否曾被认定为工伤", "是否有职业病", "职业病名称", "是否有传染性疾病", "传染病名称", "是否被劳动能力鉴定委员会鉴定为具有伤残等级", "伤残病名称", "伤残等级", "是否从事过井下、高空、高温、特别繁重体力劳动以及有毒有害工种"
, "是否有不良记录"
, "紧急联系人姓名", "紧急联系人与本人关系", "联系地址-省", "联系地址-市", "联系地址-区/县", "联系地址-详细地址"
, "手机号码(紧急联系人)", "银行卡号", "开户总行", "开户省", "开户市", "开户支行", "计税月份"};
Map<String, String> modelTitleMap = new HashMap<>();
for (String title : modelTitle) {
......@@ -3239,6 +3248,11 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
Map<String, Integer> pairsKai = new HashMap<>();
pairsKai.put("开户省", CommonConstants.ZERO_INT);
pairsKai.put("开户市", CommonConstants.ZERO_INT);
// 1.9.7: 主要工作经历 表头需要成对的
Map<String, Integer> pairsWork = new HashMap<>();
pairsWork.put("开始工作日期", CommonConstants.ZERO_INT);
pairsWork.put("结束工作日期", CommonConstants.ZERO_INT);
// 1 验证表头:
ExcelColumnVo title;
// 标题行的内容
......@@ -3273,6 +3287,10 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if (pairsKai.get(titleStr) != null) {
pairsKai.remove(titleStr);
}
// 1.9.7: 主要工作经历 表头需要成对的
if (pairsWork.get(titleStr) != null) {
pairsWork.remove(titleStr);
}
}
if (pairsSchool.size() == 1) {
errorTitle.append("入学时间与毕业时间需要成对出现;");
......@@ -3295,6 +3313,11 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if (pairsKai.size() == 1) {
errorTitle.append("开户省市需要成对出现;");
}
// 1.9.7: 主要工作经历 表头需要成对的
if (pairsWork.size() == 1) {
errorTitle.append("开始工作日期与结束工作日期需要成对出现;");
}
if (errorTitle.length() > 0) {
return R.failed("表头错误:" + errorTitle + " 请检查调整后再次导入");
}
......@@ -3501,6 +3524,53 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if (Common.isNotNull(detail.getTel())) {
mobileList.add(detail.getTel());
}
// 1.9.7 新增必填校验
// 1.9.7 工作经历必填校验
if ("否".equals(detail.getIsFirstWork())) {
if(Common.isEmpty(detail.getWorkUnit())|| Common.isEmpty(detail.getWorkJob())
||Common.isEmpty(detail.getStartDate())||Common.isEmpty(detail.getEndDate())){
errorMust.append("首份工作为【否】时,工作单位、工作岗位、开始工作日期、结束工作日期同时必填!");
}
}
// 1.9.7家庭成员信息必填校验
if (Common.isNotNull(detail.getFamilyName())) {
if(Common.isEmpty(detail.getRelationshipSelf())|| Common.isEmpty(detail.getContractTel())){
errorMust.append("有成员姓名时,家庭成员与本人关系、手机号码(家庭成员)同时必填!");
}
}
// 1.9.7 职业资格信息必填校验
if ("是".equals(detail.getHaveQualification())) {
if(Common.isEmpty(detail.getDeclareYear())|| Common.isEmpty(detail.getQualificationType())){
errorMust.append("是否有职业资格证书为【是】时,申报年度、职业资格名称同时必填!");
}
}
// 1.9.7 伤残信息必填校验
if (Common.isEmpty(detail.getInjuryIdentification()) && Common.isEmpty(detail.getOccupationalDiseaseFlag()) &&
Common.isEmpty(detail.getInfectiousDiseaseFlag()) && Common.isEmpty(detail.getDisabilityFlag()) &&
Common.isEmpty(detail.getOtherFlag())
) {
} else{
if (Common.isNotNull(detail.getInjuryIdentification()) && Common.isNotNull(detail.getOccupationalDiseaseFlag()) &&
Common.isNotNull(detail.getInfectiousDiseaseFlag()) && Common.isNotNull(detail.getDisabilityFlag()) &&
Common.isNotNull(detail.getOtherFlag())
) {
if ("是".equals(detail.getOccupationalDiseaseFlag()) && Common.isEmpty(detail.getOccupationalDisease())) {
errorMust.append("是否有职业病为【是】时,职业病名称必填!");
}
if ("是".equals(detail.getInfectiousDiseaseFlag()) && Common.isEmpty(detail.getInfectiousName())) {
errorMust.append("是否有传染性疾病为【是】时,传染病名称必填!");
}
if ("是".equals(detail.getDisabilityFlag())) {
if(Common.isEmpty(detail.getDisabilityLevel())|| Common.isEmpty(detail.getDisabilityName())){
errorMust.append("是否被劳动能力鉴定委员会鉴定为具有伤残等级为【是】时,伤残病名称、伤残等级同时必填!");
}
}
} else {
errorMust.append("是否曾被认定为工伤,是否有职业病、是否有传染性疾病、是否被劳动能力鉴定委员会鉴定为具有伤残等级 必须同时必填!");
}
}
} else if (saveEmp.getFileStatus() == CommonConstants.ONE_INT) {
errorCur = errorCurInfoStatus;
}
......@@ -3536,6 +3606,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
.after(DateUtil.stringToDate(detail.getValidityStart(),DateUtil.ISO_EXPANDED_DATE_FORMAT))){
detail.setErrorInfo(EmployeeConstants.EMP_VALIDITY_END_START_DATE);
}
excelList.add(detail);
}
......@@ -3643,6 +3714,18 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
// 1.9.6 加不良记录
TEmpBadRecord badRecord;
List<TEmpBadRecord> empBadRecordList = new ArrayList<>();
// 1.9.7 加员工工作履历信息
TEmpWorkRecording workRecord;
List<TEmpWorkRecording> workRecordList = new ArrayList<>();
// 1.9.7 加员工家庭信息
TEmpFamily familyRecord;
List<TEmpFamily> familyRecordList = new ArrayList<>();
// 1.9.7 加职业资格信息信息
TEmpProfessionalQualification qualificationRecord;
List<TEmpProfessionalQualification> qualificationRecordList = new ArrayList<>();
// 1.9.7 加职业资格信息信息
TEmpDisabilityInfo disabilityRecord;
List<TEmpDisabilityInfo> disabilityRecordList = new ArrayList<>();
for (PreUploadEmpImportTwoVo excel : saveExcelList) {
saveEmp = existEmpMap.get(excel.getEmpIdcard());
......@@ -3777,6 +3860,14 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
}
saveEmp.setHaveQualification(flag);
}
// 1.9.7: 是否为首份工作
if (Common.isNotNull(excel.getIsFirstWork())) {
String workFlag = CommonConstants.ZERO_STRING;
if("否".equals(excel.getIsFirstWork())){
workFlag = CommonConstants.ONE_STRING;
}
saveEmp.setFirstWorkFlag(workFlag);
}
// 更新时,不需要更新其余信息
newOld = new EmployeeNewOldVO();
......@@ -3846,6 +3937,93 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
}
empBadRecordList.add(badRecord);
}
// 1.9.7 存主要工作经历
if ("否".equals(excel.getIsFirstWork())) {
workRecord = new TEmpWorkRecording();
workRecord.setEmpName(saveEmp.getEmpName());
workRecord.setEmpId(saveEmp.getId());
workRecord.setEmpCode(saveEmp.getEmpCode());
workRecord.setEmpIdcard(saveEmp.getEmpIdcard());
workRecord.setWorkUnit(excel.getWorkUnit());
workRecord.setWorkJob(excel.getWorkJob());
// 存时间
workRecord.setStartDate(excel.getStartDateValue());
workRecord.setEndDate(excel.getEndDateValue());
workRecord.setCreateBy(user.getId());
workRecord.setCreateName(user.getNickname());
workRecord.setCreateTime(LocalDateTime.now());
workRecord.setWorkingStatus(CommonConstants.ONE_STRING);
workRecordList.add(workRecord);
}
// 1.9.7 存家庭成员
if(Common.isNotNull(excel.getFamilyName())){
familyRecord = new TEmpFamily();
familyRecord.setEmpName(saveEmp.getEmpName());
familyRecord.setEmpId(saveEmp.getId());
familyRecord.setEmpCode(saveEmp.getEmpCode());
familyRecord.setEmpIdcard(saveEmp.getEmpIdcard());
familyRecord.setFamilyName(excel.getFamilyName());
familyRecord.setRelationshipSelf(excel.getRelationshipSelfValue());
familyRecord.setContractTel(excel.getContractTel());
familyRecord.setCreateBy(user.getId());
familyRecord.setCreateName(user.getNickname());
familyRecord.setCreateTime(LocalDateTime.now());
familyRecordList.add(familyRecord);
}
// 1.9.7 加职业资格信息信息
if ("是".equals(excel.getHaveQualification())) {
qualificationRecord = new TEmpProfessionalQualification();
String qualificationFlag = CommonConstants.ZERO_STRING;
qualificationRecord.setHaveQualification(qualificationFlag);
qualificationRecord.setEmpName(saveEmp.getEmpName());
qualificationRecord.setEmpId(saveEmp.getId());
qualificationRecord.setEmpCode(saveEmp.getEmpCode());
qualificationRecord.setEmpIdcard(saveEmp.getEmpIdcard());
qualificationRecord.setDeclareYear(excel.getDeclareYearValue());
qualificationRecord.setQualificationType(excel.getQualificationTypeValue());
qualificationRecord.setCreateBy(user.getId());
qualificationRecord.setCreateName(user.getNickname());
qualificationRecord.setCreateTime(LocalDateTime.now());
qualificationRecordList.add(qualificationRecord);
}
// 1.9.7 加伤残信息
if (Common.isNotNull(excel.getInjuryIdentification()) && Common.isNotNull(excel.getOccupationalDiseaseFlag()) &&
Common.isNotNull(excel.getInfectiousDiseaseFlag()) && Common.isNotNull(excel.getDisabilityFlag()) &&
Common.isNotNull(excel.getOtherFlag())
) {
disabilityRecord = new TEmpDisabilityInfo();
disabilityRecord.setInjuryIdentification(excel.getInjuryIdentificationValue());
disabilityRecord.setOccupationalDiseaseFlag(excel.getOccupationalDiseaseFlagValue());
if ("是".equals(excel.getOccupationalDiseaseFlag())) {
disabilityRecord.setOccupationalDisease(excel.getOccupationalDisease());
}
disabilityRecord.setInfectiousDiseaseFlag(excel.getInfectiousDiseaseFlagValue());
if ("是".equals(excel.getInfectiousDiseaseFlag())) {
disabilityRecord.setInfectiousName(excel.getInfectiousName());
}
disabilityRecord.setDisabilityFlag(excel.getDisabilityFlagValue());
if ("是".equals(excel.getDisabilityFlag())) {
disabilityRecord.setDisabilityLevel(excel.getDisabilityLevelValue());
disabilityRecord.setDisabilityName(excel.getDisabilityName());
}
disabilityRecord.setOtherFlag(excel.getOtherFlagValue());
disabilityRecord.setEmpName(saveEmp.getEmpName());
disabilityRecord.setEmpId(saveEmp.getId());
disabilityRecord.setEmpCode(saveEmp.getEmpCode());
disabilityRecord.setEmpIdcard(saveEmp.getEmpIdcard());
disabilityRecord.setCreateBy(user.getId());
disabilityRecord.setCreateName(user.getNickname());
disabilityRecord.setCreateTime(LocalDateTime.now());
disabilityRecordList.add(disabilityRecord);
}
}
}
......@@ -3861,6 +4039,14 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
// 1.9.6 加不良记录
this.saveBadRecord(empBadRecordList);
// 1.9.7 加主要工作经历
this.saveWorkRecord(workRecordList);
// 1.9.7 加家庭成员
this.saveFamilyRecord(familyRecordList);
// 1.9.7 加职业资格
this.saveQualificationRecord(qualificationRecordList);
// 1.9.7 加伤残信息
this.saveDisabilityRecord(disabilityRecordList);
// 记录变更日志
for (EmployeeNewOldVO newOldInfo : updateList) {
......@@ -3947,4 +4133,29 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
tEmpBadRecordService.saveBatch(empBadRecordList);
}
}
// 1.9.7:加工作经历
private void saveWorkRecord(List<TEmpWorkRecording> workRecordList) {
if (workRecordList.size()>0) {
tEmpWorkRecordingService.saveBatch(workRecordList);
}
}
// 1.9.7:加家庭成员
private void saveFamilyRecord(List<TEmpFamily> familyRecordList) {
if (familyRecordList.size()>0) {
tEmpFamilyService.saveBatch(familyRecordList);
}
}
// 1.9.7:加职业资格
private void saveQualificationRecord(List<TEmpProfessionalQualification> qualificationRecordList) {
if (qualificationRecordList.size()>0) {
tEmpProfessionalQualificationService.saveBatch(qualificationRecordList);
}
}
// 1.9.7:加伤残信息
private void saveDisabilityRecord(List<TEmpDisabilityInfo> disabilityRecordList) {
if (disabilityRecordList.size()>0) {
tEmpDisabilityInfoService.saveBatch(disabilityRecordList);
}
}
}
......@@ -17,6 +17,7 @@ import java.io.InputStream;
import java.io.Serializable;
import java.lang.reflect.Field;
import java.text.DecimalFormat;
import java.time.LocalDateTime;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
......@@ -771,6 +772,9 @@ public class DiyExcelImportUtil implements Serializable {
setStringField(field, cellValueStr, entity);
} else if (Date.class == fieldType && Common.isNotNull(cellValueStr.trim())) {
setDateField(field, cellValueStr, entity);
} else if (LocalDateTime.class == fieldType && Common.isNotNull(cellValueStr.trim())) {
// 1.9.7: 加时间格式转化
setDateTimeField(field, cellValueStr, entity);
} else if ((Integer.TYPE == fieldType) || (Integer.class == fieldType)) {
setIntegerField(field, cellValueStr, entity);
} else {
......@@ -784,6 +788,9 @@ public class DiyExcelImportUtil implements Serializable {
field.set(entity, cellValueStr);
} else if (Date.class == fieldType && Common.isNotNull(cellValueStr.trim())) {
setDateField(field, cellValueStr, entity);
} else if (LocalDateTime.class == fieldType && Common.isNotNull(cellValueStr.trim())) {
// 1.9.7: 加时间格式转化
setDateTimeField(field, cellValueStr, entity);
} else if ((Integer.TYPE == fieldType) || (Integer.class == fieldType)) {
setIntegerField(field, cellValueStr, entity);
} else {
......@@ -817,6 +824,17 @@ public class DiyExcelImportUtil implements Serializable {
field.set(entity, DateUtil.stringDateFormat(cellValueStr.trim(), patten));
}
public static <T> void setDateTimeField(Field field, String cellValueStr, T entity) throws IllegalAccessException {
String patten = DateUtil.ISO_DATE_FORMAT;
if (cellValueStr.contains("-")) {
patten = DateUtil.ISO_EXPANDED_DATE_FORMAT;
} else if (cellValueStr.contains("/")) {
patten = DateUtil.DATETIME_PATTERN_XIEGANG;
}
String pattenTime = patten+" 00:00:00";
field.set(entity, LocalDateTimeUtils.formatTime(cellValueStr.trim(), pattenTime));
}
public static <T> void setIntegerField(Field field, String cellValueStr, T entity) throws IllegalAccessException {
if ("否".equals(cellValueStr)) {
field.set(entity, 0);
......
......@@ -396,7 +396,8 @@
<select id="getAllUserPageWhere" resultType="com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser">
select u.* from
(SELECT user_id,nickname,phone,create_time,username FROM sys_user
(
SELECT user_id,nickname,phone,create_time,username FROM sys_user
where del_flag = '0' and lock_flag = '0'
<if test="query.nameOrPhone != null and query.nameOrPhone != ''">
<bind name="usernameLike" value="'%' + query.nameOrPhone + '%'"/>
......@@ -405,6 +406,13 @@
union
SELECT user_id,nickname,phone,create_time,username FROM sys_user
where del_flag = '0' and lock_flag = '0'
<if test="query.nameOrPhone != null and query.nameOrPhone != ''">
<bind name="usernameLike" value="'%' + query.nameOrPhone + '%'"/>
and username LIKE #{usernameLike}
</if>
union
SELECT user_id,nickname,phone,create_time,username FROM sys_user
where del_flag = '0' and lock_flag = '0'
<if test="query.nameOrPhone != null and query.nameOrPhone != ''">
and phone = #{query.nameOrPhone}
</if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment