guoshilong
2023-11-05 24c1d61aefa5cdfd5043aa2773062e8e281bb1ec
测站类型sql修改
1 files modified
10 ■■■■ changed files
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/jcsb/mapper/DbReporttMapper.xml 10 ●●●● patch | view | raw | blame | history
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/jcsb/mapper/DbReporttMapper.xml
@@ -45,12 +45,13 @@
        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
        SDR.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 SDR.TYPE = #{vo.type}
            AND acb."cd_type" = #{vo.type}
    </if>
    <if test="vo.startTime !=null and vo.startTime !=''">
        AND DATE_FORMAT(sdr.record_time,'%Y-%m-%d') &gt;= DATE_FORMAT( #{vo.startTime},'%Y-%m-%d')
@@ -81,6 +82,7 @@
        WHERE SDR.IS_DELETED = 0
        <if test="vo.type != null and vo.type != ''">
            AND SDR.TYPE = #{vo.type}
            AND awcb."cd_type" = #{vo.type}
        </if>
        <if test="vo.startTime !=null and vo.startTime !=''">
            AND DATE_FORMAT(sdr.record_time,'%Y-%m-%d') &gt;= DATE_FORMAT( #{vo.startTime},'%Y-%m-%d')
@@ -109,7 +111,8 @@
        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}
            AND  SDR.TYPE = #{vo.type}
            AND acb."cd_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')
@@ -142,7 +145,8 @@
        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}
            AND  SDR.TYPE = #{vo.type}
            AND awcb."cd_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')