Commit 3d20c4ee authored by huyuchen's avatar huyuchen

线上问题修改

parent 0e905600
......@@ -41,9 +41,12 @@ public interface TEmployeeInfoMapper extends BaseMapper<TEmployeeInfo> {
IPage<TEmployeeInfo> getPage(Page<TEmployeeInfo> page, @Param("tEmployeeInfo") TEmployeeInfo tEmployeeInfo);
long getLeavePageCount(@Param("tEmployeeInfo") TEmployeeInfo tEmployeeInfo);
long getLeavePageCount(@Param("tEmployeeInfo") TEmployeeInfo tEmployeeInfo, @Param("idList")List<String> idList);
List<TEmployeeInfo> getLeavePage(@Param("tEmployeeInfo") TEmployeeInfo tEmployeeInfo, @Param("page")Long page, @Param("size")Long size);
List<String> getProjectEmpId(@Param("tEmployeeInfo") TEmployeeInfo tEmployeeInfo);
List<TEmployeeInfo> getLeavePage(@Param("tEmployeeInfo") TEmployeeInfo tEmployeeInfo,
@Param("page")Long page, @Param("size")Long size);
List<TEmployeeInfo> getList(@Param("tEmployeeInfo") TEmployeeInfo tEmployeeInfo);
......
......@@ -94,7 +94,13 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
@Override
public IPage<TEmployeeInfo> getLeavePage(Page<TEmployeeInfo> page, TEmployeeInfo employeeInfo) {
long leavePageCount = baseMapper.getLeavePageCount(employeeInfo);
List<String> projectList = baseMapper.getProjectEmpId(employeeInfo);
long leavePageCount;
if (projectList.isEmpty()) {
leavePageCount = 0L;
} else {
leavePageCount = baseMapper.getLeavePageCount(employeeInfo, projectList);
}
page.setTotal(leavePageCount);
if (leavePageCount > 0L) {
page.setPages((long) Math.ceil(leavePageCount / page.getSize()));
......
......@@ -593,11 +593,23 @@
SELECT
count(1)
FROM t_employee_info a
LEFT JOIN t_employee_project b
ON a.id = b.EMP_ID
where 1=1
and a.DELETE_FLAG = '0'
<include refid="employeeInfo_where"/>
<if test="idList != null and idList.size>0">
AND a.id in
<foreach item="idStr" index="index" collection="idList" open="(" separator="," close=")">
#{idStr}
</foreach>
</if>
</select>
<select id="getProjectEmpId" resultType="java.lang.String">
SELECT
b.EMP_ID
FROM t_employee_project b
where 1=1
AND b.DELETE_FLAG = '0'
<if test="tEmployeeInfo.unitName != null and tEmployeeInfo.unitName.trim() != ''">
AND b.UNIT_NAME like concat('%',#{tEmployeeInfo.unitName},'%')
</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