Commit 7cdc04ca authored by huyuchen's avatar huyuchen

线上问题修改

parent cd7adf9e
...@@ -45,6 +45,8 @@ public interface TEmployeeInfoMapper extends BaseMapper<TEmployeeInfo> { ...@@ -45,6 +45,8 @@ public interface TEmployeeInfoMapper extends BaseMapper<TEmployeeInfo> {
List<TEmployeeInfo> getLeavePage(@Param("tEmployeeInfo") TEmployeeInfo tEmployeeInfo, @Param("page")Long page, @Param("size")Long size); List<TEmployeeInfo> getLeavePage(@Param("tEmployeeInfo") TEmployeeInfo tEmployeeInfo, @Param("page")Long page, @Param("size")Long size);
IPage<TEmployeeInfo> getLeaveIPage(Page<TEmployeeInfo> page,@Param("tEmployeeInfo") TEmployeeInfo tEmployeeInfo);
List<TEmployeeInfo> getList(@Param("tEmployeeInfo") TEmployeeInfo tEmployeeInfo); List<TEmployeeInfo> getList(@Param("tEmployeeInfo") TEmployeeInfo tEmployeeInfo);
// hgw 2022-6-22 15:32:39 根据身份证查询一批档案 // hgw 2022-6-22 15:32:39 根据身份证查询一批档案
......
...@@ -94,20 +94,26 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -94,20 +94,26 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
@Override @Override
public IPage<TEmployeeInfo> getLeavePage(Page<TEmployeeInfo> page, TEmployeeInfo employeeInfo) { public IPage<TEmployeeInfo> getLeavePage(Page<TEmployeeInfo> page, TEmployeeInfo employeeInfo) {
long leavePageCount = baseMapper.getLeavePageCount(employeeInfo); long leavePageCount;
page.setTotal(leavePageCount); if (Common.isEmpty(employeeInfo.getUnitName()) && Common.isEmpty(employeeInfo.getDeptName())
if (leavePageCount > 0L) { && Common.isEmpty(employeeInfo.getDeptNo()) && Common.isEmpty(employeeInfo.getAuthSql())) {
page.setPages((long) Math.ceil(leavePageCount / page.getSize())); leavePageCount = baseMapper.getLeavePageCount(employeeInfo);
} page.setTotal(leavePageCount);
if (page.getCurrent() < 1) { if (leavePageCount > 0L) {
page.setCurrent(1L); page.setPages((long) Math.ceil(leavePageCount / page.getSize()));
} }
if (page.getSize() < 1) { if (page.getCurrent() < 1) {
page.setSize(10L); page.setCurrent(1L);
}
if (page.getSize() < 1) {
page.setSize(10L);
}
List<TEmployeeInfo> list = baseMapper.getLeavePage(employeeInfo,(page.getCurrent() - 1) * page.getSize(), page.getSize());
page.setRecords(list);
return page;
} else {
return baseMapper.getLeaveIPage(page, employeeInfo);
} }
List<TEmployeeInfo> list = baseMapper.getLeavePage(employeeInfo,(page.getCurrent() - 1) * page.getSize(), page.getSize());
page.setRecords(list);
return page;
} }
@Override @Override
......
...@@ -506,7 +506,23 @@ ...@@ -506,7 +506,23 @@
<!-- hgw 分页查询 --> <!-- hgw 分页查询 -->
<select id="getLeavePage" resultMap="tEmployeeExportMap"> <select id="getLeavePage" resultMap="tEmployeeExportMap">
SELECT SELECT
* c.ID,
c.EMP_CODE,
c.EMP_NATRUE,
c.EMP_NAME,
c.EMP_IDCARD,
c.EMP_PHONE,
c.FILE_PROVINCE,
c.FILE_CITY,
c.FILE_TOWN,
c.LEAVE_TIME,
c.LEAVE_USER_NAME,
c.CREATE_TIME,
b.DEPT_ID,
b.EMP_ID,
b.UNIT_NAME,
b.DEPT_NAME,
b.DEPT_NO
FROM FROM
( (
SELECT SELECT
...@@ -515,41 +531,13 @@ ...@@ -515,41 +531,13 @@
a.EMP_NATRUE, a.EMP_NATRUE,
a.EMP_NAME, a.EMP_NAME,
a.EMP_IDCARD, a.EMP_IDCARD,
a.VALIDITY_START,
a.VALIDITY_END,
a.EMP_MARRI_STATUS,
a.EMP_NATIONAL,
a.POLITICAL_STATUS,
a.EMP_PHONE, a.EMP_PHONE,
a.EMP_EMAIL,
a.ID_PROVINCE,
a.ID_CITY,
a.ID_TOWN,
a.EMP_REGIS_TYPE,
a.FILE_PROVINCE, a.FILE_PROVINCE,
a.FILE_CITY, a.FILE_CITY,
a.FILE_TOWN, a.FILE_TOWN,
a.IS_COLLEGE,
a.HIGN_EDUCATION,
a.SCHOOL,
a.MAJOR,
a.ADMISSION_DATE,
a.GRADUTION_DATE,
a.REMARK,
a.FILE_SOURCE,
a.PROJECT_NUM,
a.CONTRACT_STATUS,
a.INSURANCE_STATUS,
a.SOCIAL_STATUS,
a.FUND_STATUS,
a.SALARY_STATUS,
a.CREATE_NAME,
a.CREATE_TIME,
a.CONTACT_ADDRESS,
a.LEAVE_TIME, a.LEAVE_TIME,
a.LEAVE_USER_NAME, a.LEAVE_USER_NAME,
a.LEAVE_USER, a.CREATE_TIME
a.LEAVE_REASON
FROM FROM
t_employee_info a t_employee_info a
WHERE WHERE
...@@ -563,8 +551,7 @@ ...@@ -563,8 +551,7 @@
SELECT SELECT
f.DEPT_ID, f.DEPT_ID,
f.EMP_ID, f.EMP_ID,
GROUP_CONCAT(DISTINCT f.unit_name) UNIT_NAME, GROUP_CONCAT(DISTINCT f.UNIT_NAME) UNIT_NAME,
GROUP_CONCAT(DISTINCT f.unit_no) UNIT_NO,
GROUP_CONCAT(DISTINCT f.DEPT_NAME) DEPT_NAME, GROUP_CONCAT(DISTINCT f.DEPT_NAME) DEPT_NAME,
GROUP_CONCAT(DISTINCT f.DEPT_NO) DEPT_NO GROUP_CONCAT(DISTINCT f.DEPT_NO) DEPT_NO
FROM FROM
...@@ -589,15 +576,61 @@ ...@@ -589,15 +576,61 @@
ORDER BY c.CREATE_TIME DESC ORDER BY c.CREATE_TIME DESC
</select> </select>
<select id="getLeavePageCount" resultType="java.lang.Long"> <!-- hgw 分页查询 -->
<select id="getLeaveIPage" resultMap="tEmployeeExportMap">
SELECT SELECT
count(1) c.ID,
FROM t_employee_info a c.EMP_CODE,
LEFT JOIN t_employee_project b c.EMP_NATRUE,
ON a.id = b.EMP_ID c.EMP_NAME,
where 1=1 c.EMP_IDCARD,
and a.DELETE_FLAG = '0' c.EMP_PHONE,
c.FILE_PROVINCE,
c.FILE_CITY,
c.FILE_TOWN,
c.LEAVE_TIME,
c.LEAVE_USER_NAME,
c.CREATE_TIME,
b.DEPT_ID,
b.EMP_ID,
b.UNIT_NAME,
b.DEPT_NAME,
b.DEPT_NO
FROM
(
SELECT
a.ID,
a.EMP_CODE,
a.EMP_NATRUE,
a.EMP_NAME,
a.EMP_IDCARD,
a.EMP_PHONE,
a.FILE_PROVINCE,
a.FILE_CITY,
a.FILE_TOWN,
a.LEAVE_TIME,
a.LEAVE_USER_NAME,
a.CREATE_TIME
FROM
t_employee_info a
WHERE
a.DELETE_FLAG = '0'
<include refid="employeeInfo_where"/> <include refid="employeeInfo_where"/>
) c
LEFT JOIN (
SELECT
f.DEPT_ID,
f.EMP_ID,
GROUP_CONCAT(DISTINCT f.UNIT_NAME) UNIT_NAME,
GROUP_CONCAT(DISTINCT f.DEPT_NAME) DEPT_NAME,
GROUP_CONCAT(DISTINCT f.DEPT_NO) DEPT_NO
FROM
t_employee_project f
WHERE
f.DELETE_FLAG = '0'
GROUP BY f.EMP_ID
) b ON c.id = b.EMP_ID
where 1 = 1
<if test="tEmployeeInfo.unitName != null and tEmployeeInfo.unitName.trim() != ''"> <if test="tEmployeeInfo.unitName != null and tEmployeeInfo.unitName.trim() != ''">
AND b.UNIT_NAME like concat('%',#{tEmployeeInfo.unitName},'%') AND b.UNIT_NAME like concat('%',#{tEmployeeInfo.unitName},'%')
</if> </if>
...@@ -610,6 +643,16 @@ ...@@ -610,6 +643,16 @@
<if test="tEmployeeInfo.authSql != null and tEmployeeInfo.authSql.trim() != ''"> <if test="tEmployeeInfo.authSql != null and tEmployeeInfo.authSql.trim() != ''">
${tEmployeeInfo.authSql} ${tEmployeeInfo.authSql}
</if> </if>
ORDER BY c.CREATE_TIME DESC
</select>
<select id="getLeavePageCount" resultType="java.lang.Long">
SELECT
count(1)
FROM t_employee_info a
where 1=1
and a.DELETE_FLAG = '0'
<include refid="employeeInfo_where"/>
</select> </select>
<!-- hgw list查询 --> <!-- hgw list查询 -->
......
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