Commit b19b1832 authored by huyuchen's avatar huyuchen

数据权限修改

parent 3efc7b76
...@@ -41,7 +41,9 @@ public interface TEmployeeInfoMapper extends BaseMapper<TEmployeeInfo> { ...@@ -41,7 +41,9 @@ public interface TEmployeeInfoMapper extends BaseMapper<TEmployeeInfo> {
IPage<TEmployeeInfo> getPage(Page<TEmployeeInfo> page, @Param("tEmployeeInfo") TEmployeeInfo tEmployeeInfo); IPage<TEmployeeInfo> getPage(Page<TEmployeeInfo> page, @Param("tEmployeeInfo") TEmployeeInfo tEmployeeInfo);
IPage<TEmployeeInfo> getLeavePage(Page<TEmployeeInfo> page, @Param("tEmployeeInfo") TEmployeeInfo tEmployeeInfo); long getLeavePageCount(@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); List<TEmployeeInfo> getList(@Param("tEmployeeInfo") TEmployeeInfo tEmployeeInfo);
......
...@@ -94,7 +94,20 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -94,7 +94,20 @@ 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) {
return baseMapper.getLeavePage(page, employeeInfo); long leavePageCount = baseMapper.getLeavePageCount(employeeInfo);
page.setTotal(leavePageCount);
if (leavePageCount > 0L) {
page.setPages((long) Math.ceil(leavePageCount / page.getSize()));
}
if (page.getCurrent() < 1) {
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;
} }
@Override @Override
......
...@@ -505,26 +505,99 @@ ...@@ -505,26 +505,99 @@
<!-- hgw 分页查询 --> <!-- hgw 分页查询 -->
<select id="getLeavePage" resultMap="tEmployeeExportMap"> <select id="getLeavePage" resultMap="tEmployeeExportMap">
SELECT * from ( SELECT
*
FROM
(
SELECT SELECT
a.ID, a.ID,
<include refid="Base_Export_List"/> a.EMP_CODE,
,GROUP_CONCAT(DISTINCT b.unit_name) UNIT_NAME a.EMP_NATRUE,
,GROUP_CONCAT(DISTINCT b.unit_no) UNIT_NO a.EMP_NAME,
,a.LEAVE_TIME a.EMP_IDCARD,
,a.LEAVE_USER_NAME a.VALIDITY_START,
,a.LEAVE_USER a.VALIDITY_END,
,a.LEAVE_REASON a.EMP_MARRI_STATUS,
from t_employee_info a a.EMP_NATIONAL,
left join t_employee_project b on a.id = b.EMP_ID and b.DELETE_FLAG = '0' a.POLITICAL_STATUS,
where a.DELETE_FLAG = '0' a.EMP_PHONE,
a.EMP_EMAIL,
a.ID_PROVINCE,
a.ID_CITY,
a.ID_TOWN,
a.EMP_REGIS_TYPE,
a.FILE_PROVINCE,
a.FILE_CITY,
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_USER_NAME,
a.LEAVE_USER,
a.LEAVE_REASON
FROM
t_employee_info a
WHERE
a.DELETE_FLAG = '0'
<include refid="employeeInfo_where"/> <include refid="employeeInfo_where"/>
<if test="null != page and null != size">
limit #{page},#{size}
</if>
) c
LEFT JOIN (
SELECT
f.DEPT_ID,
f.EMP_ID,
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_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() != ''">
AND b.UNIT_NAME like concat('%',#{tEmployeeInfo.unitName},'%')
</if>
<if test="tEmployeeInfo.deptName != null and tEmployeeInfo.deptName.trim() != ''">
AND b.DEPT_NAME like concat('%',#{tEmployeeInfo.deptName},'%')
</if>
<if test="tEmployeeInfo.deptNo != null and tEmployeeInfo.deptNo.trim() != ''">
AND b.DEPT_NO like concat('%',#{tEmployeeInfo.deptNo},'%')
</if>
<if test="tEmployeeInfo.authSql != null and tEmployeeInfo.authSql.trim() != ''"> <if test="tEmployeeInfo.authSql != null and tEmployeeInfo.authSql.trim() != ''">
${tEmployeeInfo.authSql} ${tEmployeeInfo.authSql}
</if> </if>
group by a.id order by a.CREATE_TIME desc ORDER BY c.CREATE_TIME DESC
) b </select>
<select id="getLeavePageCount" resultType="java.lang.Long">
SELECT
count(1)
FROM t_employee_info a
LEFT JOIN t_employee_project b
ON a.id = b.EMP_ID
where 1=1 where 1=1
and a.DELETE_FLAG = '0'
<include refid="employeeInfo_where"/>
<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>
...@@ -534,6 +607,9 @@ ...@@ -534,6 +607,9 @@
<if test="tEmployeeInfo.deptNo != null and tEmployeeInfo.deptNo.trim() != ''"> <if test="tEmployeeInfo.deptNo != null and tEmployeeInfo.deptNo.trim() != ''">
AND b.DEPT_NO like concat('%',#{tEmployeeInfo.deptNo},'%') AND b.DEPT_NO like concat('%',#{tEmployeeInfo.deptNo},'%')
</if> </if>
<if test="tEmployeeInfo.authSql != null and tEmployeeInfo.authSql.trim() != ''">
${tEmployeeInfo.authSql}
</if>
</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