123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
- <mapper namespace="com.zhyc.xps.goaf.mapper.GoafHdangerStatisMapper">
- <!--列表查询-->
- <select id="getStatisNum" parameterType="java.util.Map" resultType="com.zhyc.xps.goaf.vo.HdangerStatisVo">
- SELECT
- IFNULL(SUM( CASE WHEN hdanger_level = 0 THEN 1 ELSE 0 END ), 0) AS 'goafHdangerLevelLowerNum',
- IFNULL(SUM( CASE WHEN hdanger_level = 1 THEN 1 ELSE 0 END ), 0) AS 'goafHdangerLevelGeneralNum',
- IFNULL(SUM( CASE WHEN hdanger_level = 2 THEN 1 ELSE 0 END ), 0) AS 'goafHdangerLevelMajorNum',
- IFNULL(SUM( CASE WHEN hdanger_level = 3 THEN 1 ELSE 0 END ), 0) AS 'goafHdangerLevelSeriousNum',
- IFNULL(SUM( CASE WHEN status = 0 THEN 1 ELSE 0 END ), 0) AS 'goafHdangerStatusTosubmitNum',
- IFNULL(SUM( CASE WHEN status = 1 THEN 1 ELSE 0 END ), 0) AS 'goafHdangerStatusToforreviewlNum',
- IFNULL(SUM( CASE WHEN status = 2 THEN 1 ELSE 0 END ), 0) AS 'goafHdangerStatusTorectifyNum',
- IFNULL(SUM( CASE WHEN status = 3 THEN 1 ELSE 0 END ), 0) AS 'goafHdangerStatusToacceptNum',
- IFNULL(SUM( CASE WHEN status = 4 THEN 1 ELSE 0 END ), 0) AS 'goafHdangerStatusCompleteNum',
- IFNULL(SUM( CASE WHEN status = -1 THEN 1 ELSE 0 END ), 0) AS 'goafHdangerStatusCancelNum'
- FROM goaf_hdanger AS A
- WHERE A.oc_id = #{ocId ,jdbcType=BIGINT} AND A.status != -1
- <!-- <if test="keywords != null and keywords != ''">-->
- <!-- AND A.hdanger_id like "%"#{keyword}"%"-->
- <!-- </if>-->
- <if test="submitAccountId != null">
- AND A.submit_account_id = #{submitAccountId ,jdbcType=BIGINT}
- </if>
- <if test="submitGroupId != null">
- AND A.submit_group_id = #{submitGroupId ,jdbcType=BIGINT}
- </if>
- <if test="hdangerType != null">
- AND A.hdanger_type = #{hdangerType ,jdbcType=BIGINT}
- </if>
- <if test="hdangerLevel != null">
- AND A.hdanger_level = #{hdangerLevel ,jdbcType=BIGINT}
- </if>
- <if test="reviewAccountId != null">
- AND A.review_account_id = #{reviewAccountId ,jdbcType=BIGINT}
- </if>
- <if test="reviewGroupId != null">
- AND A.review_group_id = #{reviewGroupId ,jdbcType=BIGINT}
- </if>
- <if test="rectifyAccountId != null">
- AND A.rectify_account_id = #{rectifyAccountId ,jdbcType=BIGINT}
- </if>
- <if test="rectifyGroupId != null">
- AND A.rectify_group_id = #{rectifyGroupId ,jdbcType=BIGINT}
- </if>
- <if test="acceptAccountId != null">
- AND A.accept_account_id = #{acceptAccountId ,jdbcType=BIGINT}
- </if>
- <if test="acceptGroupId != null">
- AND A.accept_group_id = #{acceptGroupId ,jdbcType=BIGINT}
- </if>
- <if test="status != null">
- AND A.status = #{status ,jdbcType=BIGINT}
- </if>
- <if test="startSubmitTime != null and endSubmitTime != null">
- <![CDATA[
- AND A.submit_time >= #{startSubmitTime, jdbcType=TIMESTAMP}
- AND A.submit_time <= #{endSubmitTime, jdbcType=TIMESTAMP}
- ]]>
- </if>
- <if test="handleAccountId != null">
- AND (
- A.submit_account_id = #{submitAccountId ,jdbcType=BIGINT}
- OR
- A.review_account_id = #{handleAccountId ,jdbcType=BIGINT}
- OR
- A.rectify_account_id = #{handleAccountId ,jdbcType=BIGINT}
- OR
- A.accept_account_id = #{handleAccountId ,jdbcType=BIGINT}
- )
- </if>
- <if test="handleGroupId != null">
- AND (
- A.submit_group_id = #{submitGroupId ,jdbcType=BIGINT}
- OR
- A.review_group_id = #{handleGroupId ,jdbcType=BIGINT}
- OR
- A.rectify_group_id = #{handleGroupId ,jdbcType=BIGINT}
- OR
- A.accept_group_id = #{handleGroupId ,jdbcType=BIGINT}
- )
- </if>
- ORDER BY A.submit_time DESC
- </select>
- </mapper>
|