Commit d4db75dc authored by suhuiguang's avatar suhuiguang

1.需求2972开发

parent f11ea264
...@@ -25,7 +25,7 @@ public class UserPermissionDto { ...@@ -25,7 +25,7 @@ public class UserPermissionDto {
/** /**
* 区域 * 区域
*/ */
private String address; private String fullAddress;
/** /**
* 人员类型 * 人员类型
......
...@@ -229,52 +229,58 @@ ...@@ -229,52 +229,58 @@
select company_type from privilege_company where sequence_nbr = #{companySeq} select company_type from privilege_company where sequence_nbr = #{companySeq}
</select> </select>
<select id="queryUserByPermissionPage" resultType="com.yeejoin.amos.boot.module.common.api.dto.UserPermissionDto"> <select id="queryUserByPermissionPage" resultType="com.yeejoin.amos.boot.module.common.api.dto.UserPermissionDto">
SELECT select
a.*
from
(SELECT
COALESCE (p.sequence_nbr, u.sequence_nbr) as sequence_nbr, COALESCE (p.sequence_nbr, u.sequence_nbr) as sequence_nbr,
CASE CASE
WHEN p.expiry_date is null THEN WHEN p.expiry_date is null THEN
'无资质要求' '无资质要求'
WHEN p.expiry_date <![CDATA[<]]> CURRENT_DATE THEN WHEN p.expiry_date <![CDATA[<]]> CURRENT_DATE THEN
'资质超期' '资质超期'
WHEN (p.expiry_date - CURRENT_DATE > 0 and p.expiry_date - CURRENT_DATE <![CDATA[<=]]> 30 ) THEN WHEN (p.expiry_date - CURRENT_DATE > 0 and p.expiry_date - CURRENT_DATE <![CDATA[<=]]> 30 ) THEN
'资质临期' '资质临期'
ELSE '正常' ELSE '正常'
end as permissionStatus, end as permissionStatus,
u."name", u."name",
u.certificate_num, u.certificate_num,
u.identification, u.identification,
e.use_unit, e.use_unit,
u.post, u.new_post as post,
u.sequence_nbr as uid, u.sequence_nbr as uid,
concat(e.city, e.district) as address concat(e.city, e.district) as fullAddress,
FROM u.rec_date
FROM
"tzs_user_info" u "tzs_user_info" u
left join tzs_user_permission p on u.sequence_nbr = p.user_seq left join tzs_user_permission p on u.sequence_nbr = p.user_seq
left join tz_base_enterprise_info e on u.unit_code = e.use_unit_code left join tz_base_enterprise_info e on u.unit_code = e.use_unit_code
<where>u.is_delete = false
<if test="
filter.orgCode != null and filter.orgCode != ''">
and ((e.supervise_org_code != '50' and e.supervise_org_code LIKE CONCAT (#{filter.orgCode}, '%')) or (e.supervise_org_code = '50' and e.office_region LIKE CONCAT ('%', #{filter.cityCode}, '%')))
</if>
<if test="postList != null and postList.size() > 0">
and
<foreach collection="postList" open="(" close=")" item="post" separator="or">
u.new_post like concat('%',#{post}, '%')
</foreach>
</if>
</where>) as a
<where> <where>
u.is_delete = false
<if test="filter.orgCode != null and filter.orgCode != ''">
and ((e.supervise_org_code != '50' and e.supervise_org_code LIKE CONCAT (#{filter.orgCode}, '%')) or (e.supervise_org_code = '50' and e.office_region LIKE CONCAT ('%', #{filter.cityCode}, '%')))
</if>
<if test="filter.useUnit != null and filter.useUnit != ''"> <if test="filter.useUnit != null and filter.useUnit != ''">
and e.use_unit like concat('%',filter.useUnit, '%') and a.use_unit like concat('%',#{filter.useUnit}, '%')
</if> </if>
<if test="filter.name != null and filter.name != ''"> <if test="filter.name != null and filter.name != ''">
and u.name like concat('%',filter.name, '%') and a.name like concat('%',#{filter.name}, '%')
</if> </if>
<if test="filter.certificateNum != null and filter.certificateNum != ''"> <if test="filter.certificateNum != null and filter.certificateNum != ''">
and u.certificate_num like concat('%',filter.certificateNum, '%') and a.certificate_num like concat('%',#{filter.certificateNum}, '%')
</if>
<if test="filter.address != null and filter.address != ''">
and (e.city like concat('%',filter.address, '%') or e.district like concat('%',filter.address, '%'))
</if> </if>
<if test="postList != null and postList.size() > 0"> <if test="filter.fullAddress != null and filter.fullAddress != ''">
and and (a.fullAddress like concat('%',#{filter.fullAddress},'%'))
<foreach collection="postList" open="(" close=")" item="post" separator="or">
u.post like concat('%',#{post}, '%')
</foreach>
</if> </if>
</where> </where>
order by u.rec_date order by a.rec_date
</select> </select>
</mapper> </mapper>
\ No newline at end of file
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