陈昶聿
2 天以前 8de44bc87172f479b79832535a64584ba0a65d08
smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -2257,4 +2257,32 @@
        </if>
    </select>
    <select id="getCurrentUserServiceSubtaskCount" parameterType="com.smartor.domain.entity.ServiceSubtaskEntity" resultType="map">
        SELECT
        COUNT(CASE WHEN sendstate IN (1, 2) AND date_format(endSendDateTime,'%y%m%d') &lt;= date_format(CURDATE(),'%y%m%d') THEN 1 END) AS pendingVisitCount,
        COUNT(CASE WHEN sendstate = 5 THEN 1 END) AS failedVisitCount,
        COUNT(CASE WHEN isabnormal IN (1, 2) THEN 1 END) AS abnormalVisitCount,
        COUNT(*) AS allVisitCount
        FROM service_subtask
        WHERE del_flag = '0'
        <if test="orgid != null and orgid != ''">
            AND orgid = #{orgid}
        </if>
        <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">
            AND leavehospitaldistrictcode IN
            <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="("
                     separator=","
                     close=")">
                #{leavehospitaldistrictcode}
            </foreach>
        </if>
        <if test=" leaveldeptcodes != null and leaveldeptcodes.size()>0">
            AND deptcode IN
            <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","
                     close=")">
                #{leaveldeptcode}
            </foreach>
        </if>
    </select>
</mapper>