Commit d4db75dc authored by suhuiguang's avatar suhuiguang

1.需求2972开发

parent f11ea264
......@@ -25,7 +25,7 @@ public class UserPermissionDto {
/**
* 区域
*/
private String address;
private String fullAddress;
/**
* 人员类型
......
......@@ -229,7 +229,10 @@
select company_type from privilege_company where sequence_nbr = #{companySeq}
</select>
<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,
CASE
WHEN p.expiry_date is null THEN
......@@ -244,37 +247,40 @@
u.certificate_num,
u.identification,
e.use_unit,
u.post,
u.new_post as post,
u.sequence_nbr as uid,
concat(e.city, e.district) as address
concat(e.city, e.district) as fullAddress,
u.rec_date
FROM
"tzs_user_info" u
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
<where>
u.is_delete = false
<if test="filter.orgCode != null and filter.orgCode != ''">
<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>
<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 test="filter.name != null and filter.name != ''">
and u.name like concat('%',filter.name, '%')
and a.name like concat('%',#{filter.name}, '%')
</if>
<if test="filter.certificateNum != null and filter.certificateNum != ''">
and u.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, '%'))
and a.certificate_num like concat('%',#{filter.certificateNum}, '%')
</if>
<if test="postList != null and postList.size() > 0">
and
<foreach collection="postList" open="(" close=")" item="post" separator="or">
u.post like concat('%',#{post}, '%')
</foreach>
<if test="filter.fullAddress != null and filter.fullAddress != ''">
and (a.fullAddress like concat('%',#{filter.fullAddress},'%'))
</if>
</where>
order by u.rec_date
order by a.rec_date
</select>
</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