|
|
@ -70,30 +70,34 @@ |
|
|
|
LIMIT 1 |
|
|
|
</select> |
|
|
|
<select id="selectListUserDto" resultType="com.elink.esua.epdc.dto.UserDTO"> |
|
|
|
SELECT |
|
|
|
u.id, |
|
|
|
select * from( |
|
|
|
SELECT u.id, |
|
|
|
u.REAL_NAME, |
|
|
|
u.NICKNAME, |
|
|
|
u.MOBILE, |
|
|
|
u.REGISTER_TIME, |
|
|
|
u.CREATED_TIME, |
|
|
|
u.UPDATED_TIME, |
|
|
|
IDENTITY_NO, |
|
|
|
ADDRESS, |
|
|
|
STATE, |
|
|
|
PARTY_FLAG, |
|
|
|
ug.ALL_DEPT_NAMES AS myGridName |
|
|
|
FROM |
|
|
|
epdc_user u |
|
|
|
LEFT JOIN epdc_user_grid_relation ug ON u.ID = ug.USER_ID |
|
|
|
ug.ALL_DEPT_NAMES AS myGridName, |
|
|
|
u.DEL_FLAG, |
|
|
|
IF((u.DEPT_ID is null or u.DEPT_ID = '0'), ug.GRID_ID, u.DEPT_ID) as GRID_ID, |
|
|
|
IF((u.DEPT_ID is null or u.DEPT_ID = '0'), ug.PARENT_DEPT_IDS, u.PARENT_DEPT_IDS) as PARENT_DEPT_IDS, |
|
|
|
IF((u.DEPT_ID is null or u.DEPT_ID = '0'), ug.ALL_DEPT_IDS, u.ALL_DEPT_IDS) as ALL_DEPT_IDS |
|
|
|
FROM epdc_user u |
|
|
|
LEFT JOIN ( select * from (select * from epdc_user_grid_relation order by CREATED_TIME)t group by t.USER_ID) ug ON u.ID = ug.USER_ID)ug |
|
|
|
where |
|
|
|
u.del_flag = '0' |
|
|
|
<if test="startTime != '' and endTime != ''">and u.CREATED_TIME between #{startTime} and #{endTime}</if> |
|
|
|
<if test="state != '' and state != null">and u.state = #{state}</if> |
|
|
|
<if test="realName != '' and realName != null">and u.real_name like '%${realName}%'</if> |
|
|
|
<if test="nickname != '' and nickname != null">and u.NICKNAME like '%${nickname}%'</if> |
|
|
|
<if test="mobile != '' and mobile != null">and u.mobile like '%${mobile}%'</if> |
|
|
|
<if test="identityNo != '' and identityNo != null">and u.identity_no like '%${identityNo}%'</if> |
|
|
|
<if test="partyFlag != '' and partyFlag != null">and u.party_flag = #{partyFlag}</if> |
|
|
|
ug.del_flag = '0' |
|
|
|
<if test="startTime != '' and endTime != ''">and ug.CREATED_TIME between #{startTime} and #{endTime}</if> |
|
|
|
<if test="state != '' and state != null">and ug.state = #{state}</if> |
|
|
|
<if test="realName != '' and realName != null">and ug.real_name like '%${realName}%'</if> |
|
|
|
<if test="nickname != '' and nickname != null">and ug.NICKNAME like '%${nickname}%'</if> |
|
|
|
<if test="mobile != '' and mobile != null">and ug.mobile like '%${mobile}%'</if> |
|
|
|
<if test="identityNo != '' and identityNo != null">and ug.identity_no like '%${identityNo}%'</if> |
|
|
|
<if test="partyFlag != '' and partyFlag != null">and ug.party_flag = #{partyFlag}</if> |
|
|
|
<if test="streetId != '' and streetId != null"> |
|
|
|
AND (find_in_set(#{streetId},ug.PARENT_DEPT_IDS) |
|
|
|
OR find_in_set(#{streetId},ug.ALL_DEPT_IDS)) |
|
|
@ -107,9 +111,9 @@ |
|
|
|
OR find_in_set(#{gridId},ug.ALL_DEPT_IDS)) |
|
|
|
</if> |
|
|
|
GROUP BY |
|
|
|
u.ID |
|
|
|
ug.ID |
|
|
|
ORDER BY |
|
|
|
u.register_time desc |
|
|
|
ug.register_time desc |
|
|
|
</select> |
|
|
|
<!-- 根据userId获取居民详情(已认证或待认证(提交信息待审核)的居民用户) --> |
|
|
|
<resultMap id="EpdcResidentDetailResultDtoMap" |
|
|
|