WL 2024-06-21 08:55:21 +08:00
commit a772967bc5
10 changed files with 549 additions and 194 deletions

View File

@ -1,21 +1,24 @@
package com.zcloud.controller.safetyInvestment; package com.zcloud.controller.safetyInvestment;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.mchange.lang.DoubleUtils;
import com.zcloud.controller.base.BaseController; import com.zcloud.controller.base.BaseController;
import com.zcloud.entity.Page; import com.zcloud.entity.Page;
import com.zcloud.entity.PageData; import com.zcloud.entity.PageData;
import com.zcloud.logs.LogAnno; import com.zcloud.logs.LogAnno;
import com.zcloud.service.safetyInvestment.SafetyInvestmentUseService; import com.zcloud.service.safetyInvestment.SafetyInvestmentUseService;
import com.zcloud.util.DateUtil; import com.zcloud.util.*;
import com.zcloud.util.Jurisdiction; import org.apache.commons.lang.ObjectUtils;
import com.zcloud.util.ObjectExcelView;
import com.zcloud.util.Tools;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.shiro.util.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import java.nio.charset.StandardCharsets;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -133,7 +136,6 @@ public class SafetyInvestmentUseController extends BaseController {
pd = this.getPageData(); pd = this.getPageData();
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
List<PageData> varList = safetyinvestmentuseService.listAll(pd); //列出SafetyInvestmentUse列表 List<PageData> varList = safetyinvestmentuseService.listAll(pd); //列出SafetyInvestmentUse列表
// 计算预提额合计 // 计算预提额合计
Double drawingsTotal = varList.stream(). Double drawingsTotal = varList.stream().
filter(data -> StringUtils.equals(data.getString("USE_TYPE"), "1")) filter(data -> StringUtils.equals(data.getString("USE_TYPE"), "1"))
@ -145,14 +147,12 @@ public class SafetyInvestmentUseController extends BaseController {
.collect(Collectors.groupingBy(data -> data.getString("TYPE"))).forEach((key, value) -> { .collect(Collectors.groupingBy(data -> data.getString("TYPE"))).forEach((key, value) -> {
PageData pageData = new PageData(); PageData pageData = new PageData();
double total = value.stream().mapToDouble(data -> Double.valueOf(data.getString("AMOUNT"))).sum(); double total = value.stream().mapToDouble(data -> Double.valueOf(data.getString("AMOUNT"))).sum();
pageData.put("type", key); pageData.put("TYPE", key);
pageData.put("total", total); pageData.put("TOTAL", String.valueOf(total));
allOutlayTotalList.add(pageData); allOutlayTotalList.add(pageData);
}); });
map.put("varList", varList); map.put("varList", varList);
map.put("drawingsTotal", drawingsTotal);
map.put("allOutlayTotalList", allOutlayTotalList);
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
} }

View File

@ -3400,5 +3400,42 @@ public class UsersController extends BaseController {
return map; return map;
} }
@RequestMapping("/getUserNoCorpinfoListAll")
@ResponseBody
@LogAnno(menuType = "综合管理", menuServer = "特种设备", instructionsOperate = "设备管理", instructionsType = "用户列表")
public Object getUserNoCorpinfoListAll(Page page) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
/*检索条件*/
String NAME = pd.getString("NAME"); //关键词检索条件 姓名
if (Tools.notEmpty(NAME)) pd.put("NAME", NAME.trim());
String ID_CARD = pd.getString("ID_CARD"); //关键词检索条件 身份证号
if (Tools.notEmpty(ID_CARD)) pd.put("ID_CARD", ID_CARD.trim());
String PHONE = pd.getString("PHONE"); //关键词检索条件 手机号
if (Tools.notEmpty(PHONE)) pd.put("PHONE", PHONE);
page.setPd(pd);
List<PageData> resultList = new ArrayList<>();
List<PageData> userList = usersService.getUserNoCorpinfoListAll(page); // 所有无企业信息的所有用户
Map<String, List<PageData>> dataList = userList.stream().collect(Collectors.groupingBy(data -> data.getString("USER_ID")));
dataList.forEach((key,value) -> {
resultList.add(value.get(0));
});
List<PageData> collect = resultList.stream().filter(data -> StringUtils.equals(data.getString("APPLY_TYPE"), "4")).collect(Collectors.toList());
System.out.println("collect = " + collect);
/*List<PageData> dimissionList = userCorpService.getDimissionUser();
System.out.println("dimissionList = " + dimissionList);*/
map.put("userList", collect);
map.put("page", page);
map.put("pd", pd);
map.put("result", errInfo);
return map;
}
} }

View File

@ -78,5 +78,9 @@ public interface UserCorpMapper {
void setPractitionerCorpInvalid(PageData pd); void setPractitionerCorpInvalid(PageData pd);
List<PageData> findByUserId(PageData data); List<PageData> findByUserId(PageData data);
List<PageData> getDimissionUser();
void modifyUserStatus(String userId);
} }

View File

@ -301,4 +301,7 @@ public interface UsersMapper {
List<PageData> listUserByIds(String[] personIds); List<PageData> listUserByIds(String[] personIds);
List<PageData> getAllUser(PageData pd); List<PageData> getAllUser(PageData pd);
List<PageData> getUserNoCorpinfoListAll(Page page);
} }

View File

@ -86,5 +86,9 @@ public interface UserCorpService {
Object setPractitionerConfirmByUser(PageData pd) throws Exception; Object setPractitionerConfirmByUser(PageData pd) throws Exception;
List<PageData> findByUserId(PageData data); List<PageData> findByUserId(PageData data);
List<PageData> getDimissionUser();
void modifyUserStatus(String userId);
} }

View File

@ -375,4 +375,7 @@ public interface UsersService {
List<PageData> listUserByIds(String[] personIds); List<PageData> listUserByIds(String[] personIds);
List<PageData> getAllUser(PageData pd); List<PageData> getAllUser(PageData pd);
List<PageData> getUserNoCorpinfoListAll(Page page);
} }

View File

@ -261,5 +261,15 @@ public class UserCorpServiceImpl implements UserCorpService {
public List<PageData> findByUserId(PageData data) { public List<PageData> findByUserId(PageData data) {
return userCorpMapper.findByUserId(data); return userCorpMapper.findByUserId(data);
} }
@Override
public List<PageData> getDimissionUser() {
return userCorpMapper.getDimissionUser();
}
@Override
public void modifyUserStatus(String userId) {
userCorpMapper.modifyUserStatus(userId);
}
} }

View File

@ -1131,7 +1131,7 @@ public class UsersServiceImpl implements UsersService {
@Override @Override
public ReturnMap setPractitionerAdd(PageData pd, MultipartFile[] files) throws Exception { public ReturnMap setPractitionerAdd(PageData pd, MultipartFile[] files) throws Exception {
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
if(StringUtils.isEmpty(pd.getString("choice"))) {
if (pd.get("USERAVATARURL") != null && !pd.getString("USERAVATARURL").equals("")) { if (pd.get("USERAVATARURL") != null && !pd.getString("USERAVATARURL").equals("")) {
String USERAVATARURL64 = ImageAnd64Binary.zipBase64(pd.getString("USERAVATARURL")); String USERAVATARURL64 = ImageAnd64Binary.zipBase64(pd.getString("USERAVATARURL"));
try { try {
@ -1338,6 +1338,219 @@ public class UsersServiceImpl implements UsersService {
} }
return ReturnMap.ok(); return ReturnMap.ok();
} }
}else{
String userId = pd.getString("USER_ID");
/*userCorpService.modifyUserStatus(userId);
pd.put("USER_ID",userId);
usersMapper.editUser(pd);
return ReturnMap.ok();*/
if (pd.get("USERAVATARURL") != null && !pd.getString("USERAVATARURL").equals("")) {
String USERAVATARURL64 = ImageAnd64Binary.zipBase64(pd.getString("USERAVATARURL"));
try {
FaceUtil.compareFace(pd.getString("USERAVATARURL"), pd.getString("USERAVATARURL"));
} catch (Exception e) {
throw new Exception("人脸图像不符合要求,请重新上传");
}
}
/*if (!IdcardUtils.validateCard(pd.getString("USER_ID_CARD"))) {
return ReturnMap.error("身份证号校验不通过,请核对信息");
}*/
PageData corp = new PageData();
corp.put("CORPINFO_ID", pd.getString("CORPINFO_ID"));
corp = corpInfoService.findById(corp);
String ROLE_ID = "223f076bf20e46039e95acc091b0b47d";
if ("518eb2d1c9c1470ba552249d017d29b7".equals(corp.getString("VIPLEVEL"))) { // 双重预防基础版
ROLE_ID = "c4903c96dfe74451b41bb6daa6e47f11";
}
else if ("7ba30577e5a54eca90bcbf63f249a3bc".equals(corp.getString("VIPLEVEL"))) { // 双重预防标准版
ROLE_ID = "223f076bf20e46039e95acc091b0b47d";
}
else if ("1b47de318d5847a8aabe9bcbb6f82510".equals(corp.getString("VIPLEVEL"))) { // 双重预防升级版
ROLE_ID = "409688eeb2ad4c728c2155b2982fb3d4";
}
PageData role = new PageData();
role.put("ROLE_ID", ROLE_ID);
role = roleService.findById(role);
pd.put("USER_ID", userId);
pd.put("ROLE_ID", role.getString("ROLE_ID")); // 个人账号
pd.put("RIGHTS", role.getString("RIGHTS"));
pd.put("USERNAME", pd.getString("USER_ID_CARD"));
if ("input".equals(pd.getString("LEARNERCATEGORYSTATUS"))) {
pd.put("DICTTYPE", "APPLICABLE_PERSONNEL");
PageData lc = dictionariesCorpService.saveSelf(pd);
pd.put("LEARNERCATEGORY", lc.getString("DICTIONARIES_ID"));
}
pd.put("LAST_LOGIN", "");
pd.put("IP", "");
pd.put("STATUS", "0");
pd.put("ISMAIN", "0");
pd.put("SKIN", "pcoded-navbar navbar-image-3, navbar pcoded-header navbar-expand-lg navbar-light header-dark");
pd.put("PASSWORD", new SimpleHash("SHA-1", pd.getString("USERNAME"), "Aa@123456").toString());
if (usersMapper.findByUsername(pd) == null) {
// 申请入职企业
PageData applyCorp = new PageData();
Warden.initData(applyCorp, "app", pd);
applyCorp.put("USER_CORP_ID", Warden.get32UUID());
applyCorp.put("USER_ID", pd.getString("USER_ID"));
applyCorp.put("CORPINFO_ID", pd.getString("CORPINFO_ID")); // 入职企业
applyCorp.put("DEPARTMENT_ID", pd.getString("DEPARTMENT_ID")); // 部门
applyCorp.put("POST_ID", pd.getString("POST_ID")); // 岗位
applyCorp.put("SHIFTDUTYONE", pd.getString("SHIFTDUTYONE")); // 倒班类型-1级
applyCorp.put("SHIFTDUTYTWO", pd.getString("SHIFTDUTYTWO")); // 倒班类型-2级
applyCorp.put("DURATION", pd.getString("DURATION")); //
applyCorp.put("WORKSTATUS", pd.getString("WORKSTATUS")); //
applyCorp.put("WORKPERIOD", pd.getString("WORKPERIOD")); //
applyCorp.put("ENTRY_DATE", pd.getString("ENTRY_DATE")); // 入职时间
applyCorp.put("APPLY_STATUS", "0"); // 0.申请中
applyCorp.put("APPLY_TYPE", "2"); // 2.企业添加入职申请
applyCorp.put("APPLY_CONTENT", ""); //
if ("select".equals(pd.getString("letDutiesType"))) {
pd.put("DUTIES", pd.getString("DUTIES"));
} else {
PageData dicPd = new PageData();
dicPd.put("PARENT_ID", "09e36ac01e9540f8bc84eab1c1a78754");
dicPd.put("BIANMA", "zhiwu");
dicPd.put("NAME", pd.getString("DUTIESValue"));
dicPd = dictionariesCorpService.saveByZidongxinzeng(dicPd);
if (!StringUtils.isEmpty(dicPd.getString("NAME")) || !"".equals(dicPd.getString("NAME"))) {
pd.put("DUTIES", dicPd.getString("DICTIONARIES_ID"));
} else {
pd.put("DUTIES", pd.getString("DUTIES"));
}
}
applyCorp.put("DUTIES", pd.getString("DUTIES")); // 职务
if ("select".equals(pd.getString("letTitleType"))) {
pd.put("TITLE", pd.getString("TITLE"));
} else {
PageData dicPd = new PageData();
dicPd.put("PARENT_ID", "945a6b10e59946078b500f0fbafa8679");
dicPd.put("BIANMA", "zhicheng");
dicPd.put("NAME", pd.getString("letTitleValue"));
dicPd = dictionariesCorpService.saveByZidongxinzeng(dicPd);
if (!StringUtils.isEmpty(dicPd.getString("NAME")) || !"".equals(dicPd.getString("NAME"))) {
pd.put("TITLE", dicPd.getString("DICTIONARIES_ID"));
} else {
pd.put("TITLE", pd.getString("TITLE"));
}
}
applyCorp.put("TITLE", pd.getString("TITLE")); // 职称
userCorpService.save(applyCorp);
List<String> filePaths = new ArrayList<>();
PageData idCard = new PageData();
Warden.initData(idCard, "app", pd);
PageData driverLicense = new PageData();
Warden.initData(driverLicense, "app", pd);
PageData qualificationCertificate = new PageData();
Warden.initData(qualificationCertificate, "app", pd);
/*for (int i = 0; i < files.length; i++) {
//保存签名文件
String ffile = "practitioner" + "/" + DateUtil.getYear() + "/" + DateUtil.getMonth() + "/" + DateUtil.getOnlyDay();
String fileName = UuidUtil.get32UUID() + files[i].getOriginalFilename().substring(files[i].getOriginalFilename().lastIndexOf("."));
smb.sshSftp(files[i], fileName, Const.FILEPATHFILE + ffile);
switch (i) {
case 0:
idCard.put("ID_PHOTO_FRONT", Const.FILEPATHFILE + ffile + "/" + fileName);
break;
case 1:
idCard.put("ID_PHOTO_BACK", Const.FILEPATHFILE + ffile + "/" + fileName);
break;
case 2:
driverLicense.put("ID_PHOTO_FRONT", Const.FILEPATHFILE + ffile + "/" + fileName);
break;
case 3:
qualificationCertificate.put("ID_PHOTO_FRONT", Const.FILEPATHFILE + ffile + "/" + fileName);
break;
}
}
idCard.put("USER_CERTIFICATE_ID", Warden.get32UUID());
idCard.put("USER_ID", pd.getString("USER_ID"));
idCard.put("CERTIFICATE_CATEGORY", "1"); // 身份证
idCard.put("ID_NO", pd.getString("USER_ID_CARD"));
// idCard.put("ID_NATIONALITY", pd.getString("DRIVING_NATIONALITY"));
// idCard.put("ID_ISSUE_DATE", pd.getString("DRIVER_LICENSE_ISSUE_DATE"));
idCard.put("ID_VALIDITY_START", pd.getString("ID_CARD_VALIDITY_START"));
idCard.put("ID_VALIDITY_END", pd.getString("ID_CARD_VALIDITY_END"));
idCard.put("ID_ADDRESS", pd.getString("ID_CARD_ADDRESS"));
idCard.put("ID_ORGAN", pd.getString("ID_CARD_ORGAN"));
userCertificateService.save(idCard);*/
// 驾驶证
driverLicense.put("USER_CERTIFICATE_ID", Warden.get32UUID());
driverLicense.put("USER_ID", pd.getString("USER_ID"));
driverLicense.put("CERTIFICATE_CATEGORY", "2");
driverLicense.put("ID_NO", pd.getString("DRIVER_LICENSE_NO"));
driverLicense.put("ID_NATIONALITY", pd.getString("DRIVING_NATIONALITY"));
driverLicense.put("ID_ISSUE_DATE", pd.getString("DRIVER_LICENSE_ISSUE_DATE"));
driverLicense.put("ID_VALIDITY_START", pd.getString("DRIVER_LICENSE_VALIDITY_START"));
driverLicense.put("ID_VALIDITY_END", pd.getString("DRIVER_LICENSE_VALIDITY_END"));
driverLicense.put("ID_ADDRESS", pd.getString("ID_CARD_ADDRESS"));
driverLicense.put("ID_ORGAN", pd.getString("DRIVER_LICENSE_ORGAN"));
userCertificateService.save(driverLicense);
String[] DRIVING_MODEL = pd.getString("DRIVING_MODEL").split(",");
for (int i = 0; i < DRIVING_MODEL.length; i++) {
PageData driverLicenseCategory = new PageData();
driverLicenseCategory.put("USER_CERTIFICATE_APPENDIX_ID", Warden.get32UUID());
driverLicenseCategory.put("USER_CERTIFICATE_ID", driverLicense.getString("USER_CERTIFICATE_ID"));
driverLicenseCategory.put("USER_ID", pd.getString("USER_ID"));
driverLicenseCategory.put("ALLOW_QUALIFICATION", DRIVING_MODEL[i]);
userCertificateAppendixService.save(driverLicenseCategory);
}
// 道路运输从业资格证
qualificationCertificate.put("USER_CERTIFICATE_ID", Warden.get32UUID());
qualificationCertificate.put("USER_ID", pd.getString("USER_ID"));
qualificationCertificate.put("CERTIFICATE_CATEGORY", "3");
qualificationCertificate.put("ID_NO", pd.getString("QUALIFICATION_CERTIFICATE_NO"));
qualificationCertificate.put("ID_NATIONALITY", pd.getString("QUALIFICATION_CERTIFICATE_NATIONALITY"));
qualificationCertificate.put("ID_ISSUE_DATE", pd.getString("QUALIFICATION_CERTIFICATE_ISSUE_DATE"));
qualificationCertificate.put("ID_VALIDITY_START", pd.getString("QUALIFICATION_CERTIFICATE_VALIDITY_START"));
qualificationCertificate.put("ID_VALIDITY_END", pd.getString("QUALIFICATION_CERTIFICATE_VALIDITY_END"));
qualificationCertificate.put("ID_ADDRESS", pd.getString("ID_CARD_ADDRESS"));
qualificationCertificate.put("ID_ORGAN", pd.getString("QUALIFICATION_CERTIFICATE_ORGAN"));
userCertificateService.save(qualificationCertificate);
String[] QUALIFICATION_CERTIFICATE_CATEGORY = pd.getString("QUALIFICATION_CERTIFICATE_CATEGORY").split(",");
for (int i = 0; i < QUALIFICATION_CERTIFICATE_CATEGORY.length; i++) {
PageData qualificationCertificateCategory = new PageData();
qualificationCertificateCategory.put("USER_CERTIFICATE_APPENDIX_ID", Warden.get32UUID());
qualificationCertificateCategory.put("USER_CERTIFICATE_ID", qualificationCertificate.getString("USER_CERTIFICATE_ID"));
qualificationCertificateCategory.put("USER_ID", pd.getString("USER_ID"));
qualificationCertificateCategory.put("ALLOW_QUALIFICATION", QUALIFICATION_CERTIFICATE_CATEGORY[i]);
userCertificateAppendixService.save(qualificationCertificateCategory);
}
// pd.put("TYPE_OF_WORK", pd.getString("POST_ID"));
pd.put("CERTIFICATETYPE", "4bed7fac8fe24ad4b5c0c69321fd5916"); // sys_userinfo 证件类型:身份证
pd.put("AUTHENTICATION", "0"); // sys_userinfo 学员是否认证 0否 1是
pd.put("DUTIES", ""); // 职务
pd.put("TITLE", ""); // 职称
pd.put("ENTRY_DATE", ""); // 入职时间
/*userInfoService.save(pd);*/
pd.put("CORPINFO_ID", ""); // 入职企业
pd.put("DEPARTMENT_ID", ""); // 部门
pd.put("POST_ID", ""); // 岗位
pd.put("SHIFTDUTYONE", ""); // 倒班类型-1级
pd.put("SHIFTDUTYTWO", ""); // 倒班类型-2级
pd.put("DURATION", ""); //
pd.put("WORKSTATUS", ""); //
pd.put("WORKPERIOD", ""); //
usersMapper.editUser(pd);
String[] PERSONNEL_TYPES = pd.getString("PERSONNEL_TYPE").split(",");
for (String str : PERSONNEL_TYPES) {
PageData pdd = new PageData();
pdd.put("ID", Warden.get32UUID());
pdd.put("USER_ID", pd.getString("USER_ID"));
pdd.put("PERSONNEL_TYPE", str);
userInfoService.addUserInfoPersonnelType(pdd);
}
return ReturnMap.ok();
}
}
return ReturnMap.error("保存失败"); return ReturnMap.error("保存失败");
} }
@ -1370,4 +1583,10 @@ public class UsersServiceImpl implements UsersService {
public List<PageData> getAllUser(PageData pd) { public List<PageData> getAllUser(PageData pd) {
return usersMapper.getAllUser(pd); return usersMapper.getAllUser(pd);
} }
@Override
public List<PageData> getUserNoCorpinfoListAll(Page page) {
return usersMapper.getUserNoCorpinfoListAll(page);
}
} }

View File

@ -269,6 +269,7 @@
USER_ID = #{USER_ID} and ISDELETE = '0' USER_ID = #{USER_ID} and ISDELETE = '0'
</update> </update>
<select id="findByUserId" resultType="com.zcloud.entity.PageData"> <select id="findByUserId" resultType="com.zcloud.entity.PageData">
SELECT SELECT
<include refid="Field"/>, <include refid="Field"/>,
@ -281,4 +282,23 @@
WHERE f.USER_ID = #{USER_ID} AND f.CORPINFO_ID = #{CORPINFO_ID} WHERE f.USER_ID = #{USER_ID} AND f.CORPINFO_ID = #{CORPINFO_ID}
ORDER BY f.CREATTIME DESC ORDER BY f.CREATTIME DESC
</select> </select>
<select id="getDimissionUser" parameterType="pd" resultType="pd">
SELECT
<include refid="Field"/>
FROM
<include refid="tableName"/> f
WHERE
f.APPLY_TYPE = 4
</select>
<update id="modifyUserStatus">
update
<include refid="tableName"></include>
set
APPLY_TYPE = '1',
ISDELETE = '0'
where
USER_ID = #{USER_ID}
</update>
</mapper> </mapper>

View File

@ -2006,4 +2006,59 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by d.LEVEL asc ,d.DEP_ORDER,d.DEPARTMENT_ID asc, u.SORT asc,u.USER_ID order by d.LEVEL asc ,d.DEP_ORDER,d.DEPARTMENT_ID asc, u.SORT asc,u.USER_ID
</select> </select>
<select id="getUserNoCorpinfoListAll" parameterType="page" resultType="pd" >
SELECT DISTINCT
u.USER_ID,
u.USERNAME,
u.PASSWORD,
u.NAME,
u.ROLE_ID,
u.LAST_LOGIN,
u.IP,
u.STATUS,
u.BZ,
u.SKIN,
u.EMAIL,
u.NUMBER,
u.SEX,
u.PHONE,
u.ROLE_IDS,
u.DEPARTMENT_ID,
u.POST_ID,
u.ISMAIN,
u.FUN_IDS,
u.SORT,
u.LEARNERCATEGORY,
u.USERAVATARPREFIX,
u.USERAVATARURL,
u.SHIFTDUTYONE,
u.SHIFTDUTYTWO,
u.DURATION,
u.WORKSTATUS,
u.WORKPERIOD,
u.ISSTUDENT,
u.IS_SAFETY,
u.CORPINFO_ID,
u.ISHEAD,
u.CARDNO,
u.PLS_ID,
u.ISLEADER,
c.*
FROM
<include refid="tableName"/> u
left join sys_user_corp c on u.USER_ID = c.USER_ID
WHERE
(u.CORPINFO_ID = '' OR u.CORPINFO_ID = NULL)
<if test="pd.NAME != null and pd.NAME != ''">
and u.NAME LIKE CONCAT(CONCAT('%', #{pd.NAME}),'%')
</if>
<if test="pd.ID_CARD != null and pd.ID_CARD != ''">
and u.USERNAME LIKE CONCAT(CONCAT('%', #{pd.ID_CARD}),'%')
</if>
<if test="pd.PHONE != null and pd.PHONE != ''">
and u.PHONE LIKE CONCAT(CONCAT('%', #{pd.PHONE}),'%')
</if>
order by c.CREATTIME desc
</select>
</mapper> </mapper>