| | |
| | | from rm_loss_day |
| | | <where> |
| | | <if test="startDt != null "> |
| | | AND dt <![CDATA[>=]]> #{startDt, jdbcType=DATE, jdbcType=DATE} |
| | | AND dt <![CDATA[>=]]> #{startDt, javaType=DATE, jdbcType=DATE} |
| | | </if> |
| | | <if test="endDt != null "> |
| | | AND dt <![CDATA[<]]> #{endDt, jdbcType=DATE, jdbcType=DATE} |
| | | AND dt <![CDATA[<]]> #{endDt, javaType=DATE, jdbcType=DATE} |
| | | </if> |
| | | </where> |
| | | order by intake_id DESC, id ASC |
| | |
| | | |
| | | |
| | | <sql id="selectLossAmountOfDay_with"> |
| | | WITH intakeLossAmountDay AS ( |
| | | SELECT intaId.intakeId AS intakeId, |
| | | rld.dt AS dt, |
| | | rld.loss_amount AS lossAmount |
| | |
| | | INNER JOIN rm_loss_day rld ON rld.intake_id = intaId.intakeId |
| | | <where> |
| | | <if test="startDt != null "> |
| | | AND rld.dt <![CDATA[>=]]> #{startDt, jdbcType=DATE, jdbcType=DATE} |
| | | AND rld.dt <![CDATA[>=]]> #{startDt, javaType=DATE, jdbcType=DATE} |
| | | </if> |
| | | <if test="endDt != null "> |
| | | AND rld.dt <![CDATA[<=]]> #{endDt, jdbcType=DATE, jdbcType=DATE} |
| | | AND rld.dt <![CDATA[<=]]> #{endDt, javaType=DATE, jdbcType=DATE} |
| | | </if> |
| | | </where> |
| | | ) |
| | | </sql> |
| | | |
| | | <!--统计指定月份各天漏损量(1号到5号)--> |
| | | <select id="selectLossAmountOfDay01_05" resultType="com.dy.pipIrrGlobal.voSt.VoDayLoss"> |
| | | <include refid="selectLossAmountOfDay_with" /> |
| | | WITH intakeLossAmountDay AS (<include refid="selectLossAmountOfDay_with"/>) |
| | | SELECT inta.intakeId AS intakeId, |
| | | inta.intakeNum AS intakeNum, |
| | | inta.intakeLng AS intakeLng, |
| | |
| | | |
| | | <!--统计指定月份各天漏损量(6号到10号)--> |
| | | <select id="selectLossAmountOfDay06_10" resultType="com.dy.pipIrrGlobal.voSt.VoDayLoss"> |
| | | <include refid="selectLossAmountOfDay_with" /> |
| | | WITH intakeLossAmountDay AS (<include refid="selectLossAmountOfDay_with"/>) |
| | | SELECT inta.intakeId AS intakeId, |
| | | inta.intakeNum AS intakeNum, |
| | | inta.intakeLng AS intakeLng, |
| | |
| | | |
| | | <!--统计指定月份各天漏损量(11号到15号)--> |
| | | <select id="selectLossAmountOfDay11_15" resultType="com.dy.pipIrrGlobal.voSt.VoDayLoss"> |
| | | <include refid="selectLossAmountOfDay_with" /> |
| | | WITH intakeLossAmountDay AS (<include refid="selectLossAmountOfDay_with"/>) |
| | | SELECT inta.intakeId AS intakeId, |
| | | inta.intakeNum AS intakeNum, |
| | | inta.intakeLng AS intakeLng, |
| | |
| | | |
| | | <!--统计指定月份各天漏损量(20号到16号)--> |
| | | <select id="selectLossAmountOfDay16_20" resultType="com.dy.pipIrrGlobal.voSt.VoDayLoss"> |
| | | <include refid="selectLossAmountOfDay_with" /> |
| | | WITH intakeLossAmountDay AS (<include refid="selectLossAmountOfDay_with"/>) |
| | | SELECT inta.intakeId AS intakeId, |
| | | inta.intakeNum AS intakeNum, |
| | | inta.intakeLng AS intakeLng, |
| | |
| | | |
| | | <!--统计指定月份各天漏损量(21号到25号)--> |
| | | <select id="selectLossAmountOfDay21_25" resultType="com.dy.pipIrrGlobal.voSt.VoDayLoss"> |
| | | <include refid="selectLossAmountOfDay_with" /> |
| | | WITH intakeLossAmountDay AS (<include refid="selectLossAmountOfDay_with"/>) |
| | | SELECT inta.intakeId AS intakeId, |
| | | inta.intakeNum AS intakeNum, |
| | | inta.intakeLng AS intakeLng, |
| | |
| | | |
| | | <!--统计指定月份各天漏损量(26号到31号)--> |
| | | <select id="selectLossAmountOfDay26_31" resultType="com.dy.pipIrrGlobal.voSt.VoDayLoss"> |
| | | <include refid="selectLossAmountOfDay_with" /> |
| | | WITH intakeLossAmountDay AS (<include refid="selectLossAmountOfDay_with"/>) |
| | | SELECT inta.intakeId AS intakeId, |
| | | inta.intakeNum AS intakeNum, |
| | | inta.intakeLng AS intakeLng, |