|
|
@ -62,35 +62,43 @@ |
|
|
|
</select> |
|
|
|
<select id="selectListUserDto" resultType="com.elink.esua.epdc.dto.UserDTO"> |
|
|
|
SELECT |
|
|
|
u.id, |
|
|
|
u.REAL_NAME, |
|
|
|
u.MOBILE, |
|
|
|
u.REGISTER_TIME, |
|
|
|
IDENTITY_NO, |
|
|
|
ADDRESS, |
|
|
|
STATE, |
|
|
|
PARTY_FLAG |
|
|
|
u.id, |
|
|
|
u.REAL_NAME, |
|
|
|
u.MOBILE, |
|
|
|
u.REGISTER_TIME, |
|
|
|
IDENTITY_NO, |
|
|
|
ADDRESS, |
|
|
|
STATE, |
|
|
|
PARTY_FLAG |
|
|
|
u.id, |
|
|
|
u.REAL_NAME, |
|
|
|
u.MOBILE, |
|
|
|
u.REGISTER_TIME, |
|
|
|
IDENTITY_NO, |
|
|
|
STATE, |
|
|
|
PARTY_FLAG |
|
|
|
FROM |
|
|
|
epdc_user u |
|
|
|
LEFT JOIN epdc_user_grid_relation ug ON u.ID = ug.USER_ID |
|
|
|
epdc_user u |
|
|
|
LEFT JOIN epdc_user_grid_relation ug ON u.ID = ug.USER_ID |
|
|
|
where |
|
|
|
u.del_flag = '0' |
|
|
|
<if test="startTime != '' and endTime != ''"> and u.register_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="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> |
|
|
|
<if test="streetId != '' and streetId != null"> and ug.street_id = #{streetId}</if> |
|
|
|
<if test="communityId != '' and communityId != null"> and ug.community_id = #{communityId}</if> |
|
|
|
<if test="gridId != '' and gridId != null"> and ug.grid_id = #{gridId}</if> |
|
|
|
u.del_flag = '0' |
|
|
|
<if test="startTime != '' and endTime != ''">and u.register_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="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> |
|
|
|
<if test="streetId != '' and streetId != null">and ug.street_id = #{streetId}</if> |
|
|
|
<if test="communityId != '' and communityId != null">and ug.community_id = #{communityId}</if> |
|
|
|
<if test="gridId != '' and gridId != null">and ug.grid_id = #{gridId}</if> |
|
|
|
GROUP BY |
|
|
|
u.ID |
|
|
|
u.ID |
|
|
|
ORDER BY |
|
|
|
u.register_time desc |
|
|
|
u.register_time desc |
|
|
|
</select> |
|
|
|
<!-- 根据userId获取居民详情(已认证或待认证(提交信息待审核)的居民用户) --> |
|
|
|
<resultMap id="EpdcResidentDetailResultDtoMap" type="com.elink.esua.epdc.dto.epdc.result.EpdcResidentDetailResultDTO"> |
|
|
|
<resultMap id="EpdcResidentDetailResultDtoMap" |
|
|
|
type="com.elink.esua.epdc.dto.epdc.result.EpdcResidentDetailResultDTO"> |
|
|
|
<id column="id" property="userId"/> |
|
|
|
<result column="REAL_NAME" property="realName"/> |
|
|
|
<result column="IDENTITY_NO" property="identityNo"/> |
|
|
@ -99,7 +107,7 @@ |
|
|
|
<result column="DWELLING_PLACE" property="dwellingPlace"/> |
|
|
|
<result column="PARTY_FLAG" property="partyFlag"/> |
|
|
|
<result column="state" property="state"/> |
|
|
|
<collection property="gridList" ofType="com.elink.esua.epdc.dto.epdc.result.EpdcResidentDetailGridResultDTO" > |
|
|
|
<collection property="gridList" ofType="com.elink.esua.epdc.dto.epdc.result.EpdcResidentDetailGridResultDTO"> |
|
|
|
<result column="completeName" property="completeName"/> |
|
|
|
<result column="leaderFlag" property="leaderFlag"/> |
|
|
|
</collection> |
|
|
@ -127,53 +135,53 @@ |
|
|
|
|
|
|
|
<select id="selectListOfInviteUsers" resultType="com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO"> |
|
|
|
SELECT |
|
|
|
ID AS userId, |
|
|
|
NICKNAME, |
|
|
|
FACE_IMG AS userAvatar, |
|
|
|
PARTY_FLAG AS partyMember, |
|
|
|
MOBILE |
|
|
|
ID AS userId, |
|
|
|
NICKNAME, |
|
|
|
FACE_IMG AS userAvatar, |
|
|
|
PARTY_FLAG AS partyMember, |
|
|
|
MOBILE |
|
|
|
FROM |
|
|
|
epdc_user |
|
|
|
epdc_user |
|
|
|
WHERE |
|
|
|
DEL_FLAG = '0' |
|
|
|
AND GRID_ID = #{gridId} |
|
|
|
AND ID NOT IN |
|
|
|
<foreach item="userId" collection="userIds" open="(" separator="," close=")"> |
|
|
|
#{userId} |
|
|
|
</foreach> |
|
|
|
<if test="mobile != null and mobile != ''"> |
|
|
|
and MOBILE = #{mobile} |
|
|
|
</if> |
|
|
|
<if test="road != null and road != ''"> |
|
|
|
and ROAD like concat('%', #{road}, '%') |
|
|
|
</if> |
|
|
|
<if test="lastName != null and lastName != ''"> |
|
|
|
and LAST_NAME like concat('%', #{lastName}, '%') |
|
|
|
</if> |
|
|
|
DEL_FLAG = '0' |
|
|
|
AND GRID_ID = #{gridId} |
|
|
|
AND ID NOT IN |
|
|
|
<foreach item="userId" collection="userIds" open="(" separator="," close=")"> |
|
|
|
#{userId} |
|
|
|
</foreach> |
|
|
|
<if test="mobile != null and mobile != ''"> |
|
|
|
and MOBILE = #{mobile} |
|
|
|
</if> |
|
|
|
<if test="road != null and road != ''"> |
|
|
|
and ROAD like concat('%', #{road}, '%') |
|
|
|
</if> |
|
|
|
<if test="lastName != null and lastName != ''"> |
|
|
|
and LAST_NAME like concat('%', #{lastName}, '%') |
|
|
|
</if> |
|
|
|
ORDER BY |
|
|
|
CONVERT(NICKNAME USING gbk) ASC, |
|
|
|
REGISTER_TIME |
|
|
|
CONVERT(NICKNAME USING gbk) ASC, |
|
|
|
REGISTER_TIME |
|
|
|
</select> |
|
|
|
|
|
|
|
<resultMap id="partMemberDetail" type="com.elink.esua.epdc.dto.epdc.result.EpdcPartyMemberDetailDto"> |
|
|
|
<id column="userId" property="userId" /> |
|
|
|
<result column="realName" property="realName" /> |
|
|
|
<result column="identityNo" property="identityNo" /> |
|
|
|
<result column="road" property="road" /> |
|
|
|
<result column="villageName" property="villageName" /> |
|
|
|
<result column="dwellingPlace" property="dwellingPlace" /> |
|
|
|
<result column="authenticatedFlag" property="authenticatedFlag" /> |
|
|
|
<result column="streetName" property="streetName" /> |
|
|
|
<result column="communityName" property="communityName" /> |
|
|
|
<result column="gridName" property="gridName" /> |
|
|
|
<result column="partyFlag" property="partyFlag" /> |
|
|
|
<result column="cadreFlag" property="cadreFlag" /> |
|
|
|
<collection property="gridList" ofType="com.elink.esua.epdc.dto.epdc.result.EpdcResidentDetailGridResultDTO" > |
|
|
|
<id column="userId" property="userId"/> |
|
|
|
<result column="realName" property="realName"/> |
|
|
|
<result column="identityNo" property="identityNo"/> |
|
|
|
<result column="road" property="road"/> |
|
|
|
<result column="villageName" property="villageName"/> |
|
|
|
<result column="dwellingPlace" property="dwellingPlace"/> |
|
|
|
<result column="authenticatedFlag" property="authenticatedFlag"/> |
|
|
|
<result column="streetName" property="streetName"/> |
|
|
|
<result column="communityName" property="communityName"/> |
|
|
|
<result column="gridName" property="gridName"/> |
|
|
|
<result column="partyFlag" property="partyFlag"/> |
|
|
|
<result column="cadreFlag" property="cadreFlag"/> |
|
|
|
<collection property="gridList" ofType="com.elink.esua.epdc.dto.epdc.result.EpdcResidentDetailGridResultDTO"> |
|
|
|
<result column="completeName" property="completeName"/> |
|
|
|
<result column="leaderFlag" property="leaderFlag"/> |
|
|
|
</collection> |
|
|
|
<collection property="tagNameList" ofType="java.lang.String" > |
|
|
|
<result column="tagName" /> |
|
|
|
<collection property="tagNameList" ofType="java.lang.String"> |
|
|
|
<result column="tagName"/> |
|
|
|
</collection> |
|
|
|
</resultMap> |
|
|
|
|
|
|
@ -274,4 +282,48 @@ |
|
|
|
AND eu.id = #{userId} |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<!--获取用户列表--> |
|
|
|
<select id="selectWorkUserList" resultType="com.elink.esua.epdc.dto.epdc.result.EpdcWorkUserResultDTO"> |
|
|
|
SELECT |
|
|
|
u.ID as userId, |
|
|
|
u.NICKNAME as nickname, |
|
|
|
u.REGISTER_TIME as registerTime, |
|
|
|
u.FACE_IMG as faceImg |
|
|
|
FROM |
|
|
|
epdc_user_grid_relation ug_l |
|
|
|
LEFT JOIN epdc_user_grid_relation ug_r ON ug_l.GRID_ID = ug_r.GRID_ID |
|
|
|
LEFT JOIN epdc_user u ON ug_r.USER_ID = u.ID |
|
|
|
WHERE |
|
|
|
ug_l.USER_ID = #{userId} |
|
|
|
AND ug_l.LEADER_FLAG = '1' |
|
|
|
AND u.STATE = #{authenticatedFlag} |
|
|
|
AND u.PART_FLAG = #{partyFlag} |
|
|
|
<if test='allGridFlag=="0"'> |
|
|
|
AND ug_r.GRID_ID = #{deptId} |
|
|
|
</if> |
|
|
|
AND u.CREATED_TIME <= STR_TO_DATE( #{timestamp}, '%Y-%m-%d %H:%i:%s' ) |
|
|
|
GROUP BY |
|
|
|
u.ID |
|
|
|
ORDER BY |
|
|
|
u.CREATED_TIME DESC |
|
|
|
LIMIT #{pageIndex},#{pageSize} |
|
|
|
</select> |
|
|
|
|
|
|
|
<!--查询待认证用户数量--> |
|
|
|
<select id="selectOneAnauthorizedAmount" resultType="Integer"> |
|
|
|
SELECT |
|
|
|
COUNT(u.ID) |
|
|
|
FROM |
|
|
|
epdc_user_grid_relation ug_l |
|
|
|
LEFT JOIN epdc_user_grid_relation ug_r ON ug_l.GRID_ID = ug_r.GRID_ID |
|
|
|
LEFT JOIN epdc_user u ON ug_r.USER_ID = u.ID |
|
|
|
WHERE |
|
|
|
ug_l.USER_ID = #{userId} |
|
|
|
AND ug_l.LEADER_FLAG = '1' |
|
|
|
AND u.STATE = '1' |
|
|
|
<if test='allGridFlag=="0"'> |
|
|
|
AND ug_r.GRID_ID = #{deptId} |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
</mapper> |
|
|
|