|
|
@ -992,4 +992,38 @@ WHERE 1 = 1 |
|
|
|
<update id="resetPoints"> |
|
|
|
update epdc_user set points = 0, UPDATED_TIME = now() where DEL_FLAG = '0' and points > 0 |
|
|
|
</update> |
|
|
|
<insert id="insertUserPointsTempCommunity"> |
|
|
|
insert into epdc_user_points_temp(ID,POINTS,CREATED_TIME) |
|
|
|
select ID,POINTS,now() from epdc_user |
|
|
|
where DEL_FLAG = '0' |
|
|
|
and FIND_IN_SET(#{communityId},ALL_DEPT_IDS) |
|
|
|
</insert> |
|
|
|
<select id="selectResetUserList" resultType="com.elink.esua.epdc.entity.UserEntity"> |
|
|
|
select * from epdc_user |
|
|
|
where DEL_FLAG = '0' |
|
|
|
and points > 0 |
|
|
|
and FIND_IN_SET(#{communityId},ALL_DEPT_IDS) |
|
|
|
</select> |
|
|
|
<update id="resetUserPointsCommunity"> |
|
|
|
update epdc_user set points = 0, UPDATED_TIME = now() |
|
|
|
where DEL_FLAG = '0' |
|
|
|
and points > 0 |
|
|
|
and FIND_IN_SET(#{communityId},ALL_DEPT_IDS) |
|
|
|
</update> |
|
|
|
<select id="getCommunityPointList" resultType="com.elink.esua.epdc.dto.CommunityPointsDTO"> |
|
|
|
SELECT |
|
|
|
substring_index( PARENT_DEPT_IDS, ',',- 1 ) AS communityId, |
|
|
|
substring_index( PARENT_DEPT_NAMES, '-',- 1 ) AS communityName, |
|
|
|
sum(POINTS) as points |
|
|
|
FROM |
|
|
|
epdc_user |
|
|
|
WHERE |
|
|
|
DEL_FLAG = '0' |
|
|
|
AND PARENT_DEPT_IDS != '' |
|
|
|
<if test="communityName != null and communityName != '' "> |
|
|
|
and PARENT_DEPT_NAMES like '%${communityName}%' |
|
|
|
</if> |
|
|
|
GROUP BY substring_index( PARENT_DEPT_IDS, ',',- 1 ) |
|
|
|
order by sum(POINTS) desc |
|
|
|
</select> |
|
|
|
</mapper> |
|
|
|