and p.police_code like CONCAT('%', #{policeCode}, '%')
</if>
<iftest="name!=null and name!=''">
and p.name like CONCAT('%', #{name}, '%')
</if>
<iftest="phone!=null and phone!=''">
and p.phone like CONCAT('%', #{phone}, '%')
</if>
<iftest="state!=null and state!=''">
and su.status_flag=#{state}
</if>
GROUP BY a.user_id, a.account, a.org_id, a.nick_name
) as b
<iftest="flag == 'true'">
where b.id is not null
...
...
@@ -286,35 +299,48 @@ WHERE o.org_id IN
</select>
<selectid="count"resultType="java.lang.Long">
select count(*) from(
select b.* FROM
(select
su.user_id,su.account,su.status_flag as state,suo.org_id,p.id,p.name,p.police_code,p.face_info,p.password,p.photo,p.phone,p.id_card,p.identity,p.hk_face_device
FROM sys_user su
join sys_user_org suo on su.user_id=suo.user_id and suo.org_id=#{orgId}
left join base_policeman p on p.user_id=su.user_id
and p.org_id_int=#{orgId}
where 1=1
<iftest="account!=null and account!=''">
and su.account like CONCAT('%', #{account}, '%')
</if>
<iftest="policeCode!=null and policeCode!=''">
and p.police_code like CONCAT('%', #{policeCode}, '%')
</if>
<iftest="name!=null and name!=''">
and p.name like CONCAT('%', #{name}, '%')
</if>
<iftest="phone!=null and phone!=''">
and p.phone like CONCAT('%', #{phone}, '%')
</if>
<iftest="state!=null and state!=''">
and su.status_flag=#{state}
</if>
) as b
<iftest="flag == 'true'">
where b.id is not null
</if>
)
as f
select b.* FROM(
select a.*, GROUP_CONCAT(sr.role_name SEPARATOR ',') AS role_name FROM (
select
su.user_id,su.account,su.status_flag as state,suo.org_id,max(p.id) as id,max(p.name) as name,
max(p.police_code) as police_code,max(p.face_info) as face_info,max(p.password) as password,
max(p.photo) as photo,max(p.phone) as phone,max(p.id_card) as id_card,max(p.identity) as identity,
max(p.hk_face_device) as hk_face_device,max(su.create_time) as create_time,su.nick_name
FROM sys_user su
join sys_user_org suo on su.user_id=suo.user_id and suo.org_id=#{orgId}
left join base_policeman p on p.user_id=su.user_id and p.org_id_int=#{orgId}