| | |
| | | <resultMap id="gdClueEventCountVoResultMap" type="org.sxkj.gd.workorder.vo.GdClueEventCountVO"> |
| | | <result column="total_count" property="totalCount"/> |
| | | <result column="my_count" property="myCount"/> |
| | | <result column="returned_count" property="returnedCount"/> |
| | | <result column="disposed_count" property="disposedCount"/> |
| | | <result column="completed_count" property="completedCount"/> |
| | | </resultMap> |
| | | |
| | | <sql id="gdClueEventDeptWhere"> |
| | |
| | | <if test="onlyMine != null and onlyMine == 1"> |
| | | and ce.dispose_user = #{userId} |
| | | </if> |
| | | order by ce.create_time desc |
| | | </select> |
| | | |
| | | <select id="selectGdClueEventDetailById" resultMap="gdClueEventVoResultMap"> |
| | |
| | | ce.area_code, |
| | | ce.event_num, |
| | | ce.event_name, |
| | | ce.attach_url, |
| | | ce.shoot_time, |
| | | ce.create_user, |
| | | ce.create_dept, |
| | | ce.create_time, |
| | |
| | | |
| | | <select id="selectGdClueEventCount" resultMap="gdClueEventCountVoResultMap"> |
| | | select count(1) as total_count, |
| | | COALESCE(sum(case when ce.dispose_user = #{userId} then 1 else 0 end), 0) as my_count |
| | | COALESCE(sum(case when ce.dispose_user = #{userId} then 1 else 0 end), 0) as my_count, |
| | | COALESCE(sum(case when ce.event_status = 2 then 1 else 0 end), 0) as returned_count, |
| | | COALESCE(sum(case when ce.event_status = 3 then 1 else 0 end), 0) as disposed_count, |
| | | COALESCE(sum(case when ce.event_status = 4 then 1 else 0 end), 0) as completed_count |
| | | from ja_gd_clue_event ce |
| | | <include refid="gdClueEventDeptWhere"/> |
| | | and ce.event_status in (1, 3) |
| | | and ce.event_status in (0, 1, 2, 3, 4) |
| | | <if test="keyword != null and keyword != ''"> |
| | | and ce.event_num like concat('%', #{keyword}, '%') |
| | | </if> |