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>
<iftest="column != null and column != '' and order != null and order != '' ">
order by ${column} ${order}
</if>
<iftest="pageNo!=null and pageNo!='' and pageSize!=null and pageSize!=''">
limit #{pageNo},#{pageSize}
</if>
</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.cabinet_box_id,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}, '%')