guoshilong
2023-11-05 cda883654e5d079dd2b95778db391248edce3a99
人工上报查询
5 files modified
134 ■■■■ changed files
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/damSecurity/mapper/DamSecurityMapper.xml 9 ●●●● patch | view | raw | blame | history
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/jcsb/mapper/DbReportMapper.java 2 ●●●●● patch | view | raw | blame | history
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/jcsb/mapper/DbReporttMapper.xml 109 ●●●● patch | view | raw | blame | history
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/jcsb/service/impl/DbReportServiceImpl.java 12 ●●●● patch | view | raw | blame | history
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/jcsb/vo/DbReportVO.java 2 ●●●●● patch | view | raw | blame | history
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/damSecurity/mapper/DamSecurityMapper.xml
@@ -1317,6 +1317,13 @@
        <if test="vo.engScal != null and vo.engScal !='' ">
            AND arb."eng_scal" = #{vo.engScal}
        </if>
        <if test="vo.resCds != null and vo.resCds != ''">
            AND NAG.dam_id in
            <foreach collection="vo.resCds.split(',')" item="item" index="index" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
        ORDER BY NAG.TIME DESC
    </select>
@@ -1422,7 +1429,7 @@
            AND arb."eng_scal" = #{vo.engScal}
        </if>
        <if test="vo.resCds != null and resCds != ''">
        <if test="vo.resCds != null and vo.resCds != ''">
            AND NAG.dam_id in
            <foreach collection="vo.resCds.split(',')" item="item" index="index" open="(" separator="," close=")">
                #{item}
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/jcsb/mapper/DbReportMapper.java
@@ -18,4 +18,6 @@
    List<DbReportVO> getDayListWy(@Param("entity") DbReportVO dbReport);
    List<DbReportVO> getYearList(@Param("vo") DbReportVO dbReport);
    List<DbReportVO> getYearListWy(@Param("vo") DbReportVO dbReport);
}
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/jcsb/mapper/DbReporttMapper.xml
@@ -24,6 +24,18 @@
        </if>
        ORDER BY sdr.create_time DESC
    </select>
    <select id="getRecordTimeData" resultType="cn.gistack.sm.jcsb.entity.DbReport">
        SELECT * FROM SM_DB_REPORT
        WHERE
            is_deleted = 0
          AND RESERVOIR_ID = #{entity.reservoirId}
          AND type = #{entity.type}
          AND station_id = #{entity.stationId}
          AND DATE_FORMAT(record_time,'%Y-%m-%d') = DATE_FORMAT(#{entity.recordTime},'%Y-%m-%d')
    </select>
    <select id="getDayList" resultType="cn.gistack.sm.jcsb.vo.DbReportVO">
    SELECT
@@ -32,6 +44,7 @@
        SDR.TYPE,
        SDR.STATION_ID,acb."cd_nm" as stationName,
        DATE_FORMAT(sdr.record_time,'%Y-%m-%d') AS record_time,
        DATE_FORMAT(sdr.record_time,'%Y-%m-%d') AS reportTime,
        SDR.VAL,SDR.DE_VAL,SDR.DN_VAL,SDR.DU_VAL
    FROM SM_DB_REPORT SDR
        LEFT JOIN SJZT_MD."att_cd_base" acb    ON acb."res_cd" = sdr.reservoir_id and acb."cd" = SDR.station_id
@@ -40,26 +53,18 @@
        AND SDR.TYPE = #{vo.type}
    </if>
    <if test="vo.startTime !=null and vo.startTime !=''">
        AND DATE_FORMAT(sdr.record_time,'%Y-%m-%d') &gt;= #{vo.startTime}
        AND DATE_FORMAT(sdr.record_time,'%Y-%m-%d') &gt;= DATE_FORMAT( #{vo.startTime},'%Y-%m-%d')
    </if>
    <if test="vo.endTime !=null and vo.endTime !=''">
        AND DATE_FORMAT(sdr.record_time,'%Y-%m-%d') &lt;= #{vo.endTime}
        AND DATE_FORMAT(sdr.record_time,'%Y-%m-%d') &lt;=  DATE_FORMAT(#{vo.endTime},'%Y-%m-%d')
    </if>
        <if test="vo.ch != null and vo.ch != ''">
            AND acb."ch" = #{vo.ch}
        </if>
    </select>
    <select id="getRecordTimeData" resultType="cn.gistack.sm.jcsb.entity.DbReport">
        SELECT * FROM SM_DB_REPORT
        WHERE
            is_deleted = 0
            AND RESERVOIR_ID = #{entity.reservoirId}
            AND type = #{entity.type}
            AND station_id = #{entity.stationId}
            AND DATE_FORMAT(record_time,'%Y-%m-%d') = DATE_FORMAT(#{entity.recordTime},'%Y-%m-%d')
        <if test="vo.reservoirId != null and vo.reservoirId !='' ">
            AND sdr.reservoir_id = #{vo.reservoirId}
        </if>
        ORDER BY reportTime ASC
    </select>
    <select id="getDayListWy" resultType="cn.gistack.sm.jcsb.vo.DbReportVO">
@@ -69,6 +74,7 @@
        SDR.TYPE,
        SDR.STATION_ID,awcb."cd_nm" as stationName,
        DATE_FORMAT(sdr.record_time,'%Y-%m-%d') AS record_time,
        DATE_FORMAT(sdr.record_time,'%Y-%m-%d') AS reportTime,
        SDR.VAL,SDR.DE_VAL,SDR.DN_VAL,SDR.DU_VAL
        FROM SM_DB_REPORT SDR
        LEFT JOIN SJZT_MD."att_wy_cd_base" awcb    ON awcb."res_cd" = sdr.reservoir_id and awcb."cd" = SDR.station_id
@@ -77,21 +83,80 @@
            AND SDR.TYPE = #{vo.type}
        </if>
        <if test="vo.startTime !=null and vo.startTime !=''">
            AND DATE_FORMAT(sdr.record_time,'%Y-%m-%d') &gt;= #{vo.startTime}
            AND DATE_FORMAT(sdr.record_time,'%Y-%m-%d') &gt;= DATE_FORMAT( #{vo.startTime},'%Y-%m-%d')
        </if>
        <if test="vo.endTime !=null and vo.endTime !=''">
            AND DATE_FORMAT(sdr.record_time,'%Y-%m-%d') &lt;= #{vo.endTime}
            AND DATE_FORMAT(sdr.record_time,'%Y-%m-%d') &lt;=  DATE_FORMAT(#{vo.endTime},'%Y-%m-%d')
        </if>
        <if test="vo.ch != null and vo.ch != ''">
            AND awcb."ch" = #{vo.ch}
        </if>
        <if test="vo.reservoirId != null and vo.reservoirId !='' ">
            AND sdr.reservoir_id = #{vo.reservoirId}
        </if>
        ORDER BY reportTime ASC
    </select>
    <select id="getYearList" resultType="cn.gistack.sm.jcsb.vo.DbReportVO">
        SELECT
        SDR.RESERVOIR_NAME,
        SDR.RESERVOIR_ID,
        SDR.TYPE,
        SDR.STATION_ID,
        acb."cd_nm" as stationName,
            DATE_FORMAT(SDR.RECORD_TIME,'%Y-%m') as reportTime,
            AVG(SDR.val) as val
        FROM SM_DB_REPORT SDR
        LEFT JOIN SJZT_MD."att_cd_base" acb    ON acb."res_cd" = sdr.reservoir_id and acb."cd" = SDR.station_id
        WHERE SDR.is_deleted = 0
        <if test="vo.type != null and vo.type != ''">
            AND  TYPE = #{vo.type}
        </if>
        <if test="vo.startTime !=null and vo.startTime !=''">
            AND DATE_FORMAT(sdr.record_time,'%Y-%m') &gt;=  DATE_FORMAT(#{vo.startTime} ,'%Y-%m')
        </if>
        <if test="vo.endTime !=null and vo.endTime !=''">
            AND DATE_FORMAT(sdr.record_time,'%Y-%m') &lt;=  DATE_FORMAT(#{vo.endTime} ,'%Y-%m')
        </if>
        <if test="vo.ch != null and vo.ch != ''">
            AND acb."ch" = #{vo.ch}
        </if>
        <if test="vo.reservoirId != null and vo.reservoirId !='' ">
            AND sdr.reservoir_id = #{vo.reservoirId}
        </if>
        GROUP BY RESERVOIR_NAME,RESERVOIR_ID,TYPE,STATION_ID,acb."cd_nm",DATE_FORMAT(RECORD_TIME,'%Y-%m')
        ORDER BY reportTime ASC
    </select>
    <select id="getYearList" resultType="cn.gistack.sm.jcsb.vo.DbReportVO">
    <select id="getYearListWy" resultType="cn.gistack.sm.jcsb.vo.DbReportVO">
        SELECT
            AVG(VAL) AS average,
            MONTH(RECORD_TIME) AS month
        FROM YWXT.SM_DB_REPORT
        where type = 'sy'
        GROUP BY MONTH(RECORD_TIME)
        SDR.RESERVOIR_NAME,
        SDR.RESERVOIR_ID,
        SDR.TYPE,
        SDR.STATION_ID,
        awcb."cd_nm" as stationName,
        DATE_FORMAT(SDR.RECORD_TIME,'%Y-%m') as reportTime,
        AVG(SDR.de_val) as deVal,
        AVG(SDR.dn_val) as dnVal,
        AVG(SDR.du_val) as duVal,
        FROM SM_DB_REPORT SDR
        LEFT JOIN SJZT_MD."att_wy_cd_base" awcb    ON awcb."res_cd" = sdr.reservoir_id and awcb."cd" = SDR.station_id
        WHERE SDR.is_deleted = 0
        <if test="vo.type != null and vo.type != ''">
            AND  TYPE = #{vo.type}
        </if>
        <if test="vo.startTime !=null and vo.startTime !=''">
            AND DATE_FORMAT(sdr.record_time,'%Y-%m') &gt;=  DATE_FORMAT(#{vo.startTime} ,'%Y-%m')
        </if>
        <if test="vo.endTime !=null and vo.endTime !=''">
            AND DATE_FORMAT(sdr.record_time,'%Y-%m') &lt;=  DATE_FORMAT(#{vo.endTime} ,'%Y-%m')
        </if>
        <if test="vo.ch != null and vo.ch != ''">
            AND awcb."ch" = #{vo.ch}
        </if>
        <if test="vo.reservoirId != null and vo.reservoirId !='' ">
            AND sdr.reservoir_id = #{vo.reservoirId}
        </if>
        GROUP BY RESERVOIR_NAME,RESERVOIR_ID,TYPE,STATION_ID,awcb."cd_nm",DATE_FORMAT(RECORD_TIME,'%Y-%m')
        ORDER BY reportTime ASC
    </select>
</mapper>
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/jcsb/service/impl/DbReportServiceImpl.java
@@ -31,12 +31,12 @@
            }
        }else if (dbReport.getTimeFlag().equals("year")){
//            if (dbReport.getType().equals("wy")){
//                //位移
//                list =  baseMapper.getYearListWy(dbReport);
//            }else{
//                list =  baseMapper.getYearList(dbReport);
//            }
            if (dbReport.getType().equals("wy")){
                //位移
                list =  baseMapper.getYearListWy(dbReport);
            }else{
                list =  baseMapper.getYearList(dbReport);
            }
        }
        return list;
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/jcsb/vo/DbReportVO.java
@@ -17,4 +17,6 @@
    //断面
    private String ch;
    private String reportTime;
}