|
|
|
@ -139,31 +139,32 @@ |
|
|
|
|
|
|
|
<select id="exportTotal" resultType="com.elink.esua.epdc.dto.result.ActivePointTotalResultDTO"> |
|
|
|
select |
|
|
|
USER_NAME, |
|
|
|
DEPT_NAME, |
|
|
|
sum(POINTS) as POINTS, |
|
|
|
OPERATION_DESC |
|
|
|
from epdc_active_point_log |
|
|
|
where DEL_FLAG = '0' |
|
|
|
user.real_name USER_NAME, |
|
|
|
pl.DEPT_NAME, |
|
|
|
sum(pl.POINTS) as POINTS, |
|
|
|
pl.OPERATION_DESC |
|
|
|
from epdc_active_point_log pl |
|
|
|
left join esua_epdc_user.epdc_user user on user.ID = pl.USER_ID and user.DEL_FLAG = '0' |
|
|
|
where pl.DEL_FLAG = '0' |
|
|
|
<if test="operationType != null and operationType != ''"> |
|
|
|
and OPERATION_TYPE = #{operationType} |
|
|
|
and pl.OPERATION_TYPE = #{operationType} |
|
|
|
</if> |
|
|
|
<if test="userName != null and userName != ''"> |
|
|
|
and USER_NAME like '%' #{userName} '%' |
|
|
|
and pl.USER_NAME like '%' #{userName} '%' |
|
|
|
</if> |
|
|
|
<if test="deptId != null and deptId != ''"> |
|
|
|
and FIND_IN_SET( #{deptId}, ALL_DEPT_IDS ) |
|
|
|
and FIND_IN_SET( #{deptId}, pl.ALL_DEPT_IDS ) |
|
|
|
</if> |
|
|
|
<if test="mobile != null and mobile != ''"> |
|
|
|
and MOBILE like '%' #{mobile} '%' |
|
|
|
and pl.MOBILE like '%' #{mobile} '%' |
|
|
|
</if> |
|
|
|
<if test="operationDesc != null and operationDesc != ''"> |
|
|
|
and OPERATION_DESC like '%' #{operationDesc} '%' |
|
|
|
and pl.OPERATION_DESC like '%' #{operationDesc} '%' |
|
|
|
</if> |
|
|
|
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> |
|
|
|
AND DATE_FORMAT( OPERATION_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} |
|
|
|
AND DATE_FORMAT( pl.OPERATION_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} |
|
|
|
</if> |
|
|
|
group by USER_NAME,OPERATION_DESC |
|
|
|
group by pl.USER_ID,pl.DEPT_ID,pl.OPERATION_DESC |
|
|
|
</select> |
|
|
|
</mapper> |
|
|
|
|
|
|
|
|