吉安感知网项目-后端
linwei
8 days ago 8edf0004e4bd8b758b0fc5940a8a83f0f7948f74
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/mapper/GdClueEventMapper.xml
@@ -65,6 +65,9 @@
    <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">
@@ -164,10 +167,13 @@
    <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>