|
@@ -37,4 +37,82 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
where d.report_year = #{year}
|
|
|
</select>
|
|
|
|
|
|
+ <select id="selectTMonthlyProductionReportCountByDate" parameterType="int" resultType="int">
|
|
|
+ select count(id)
|
|
|
+ from t_monthly_production_report d
|
|
|
+ where d.report_month = #{reportMonth} and d.report_year = #{reportYear}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertTMonthlyProductionReport" parameterType="TMonthlyProductionReport">
|
|
|
+ <selectKey keyProperty="id" resultType="long" order="BEFORE">
|
|
|
+ SELECT SEQ_T_MONTHLY_REPORT.NEXTVAL as id FROM DUAL
|
|
|
+ </selectKey>
|
|
|
+ insert into t_monthly_production_report
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">id,</if>
|
|
|
+ <if test="reportMonth != null">report_month,</if>
|
|
|
+ <if test="reportYear != null">report_year,</if>
|
|
|
+ <if test="nap != null">nap,</if>
|
|
|
+ <if test="c5 != null">c5,</if>
|
|
|
+ <if test="c6C8Na != null">c6_c8_na,</if>
|
|
|
+ <if test="wisonEthane != null">wison_ethane,</if>
|
|
|
+ <if test="lpgToFurnace != null">lpg_to_furnace,</if>
|
|
|
+ <if test="raff3FrBdAnd2ph != null">raff3_fr_bd_and_2ph,</if>
|
|
|
+ <if test="c2FrLdpe != null">c2_fr_ldpe,</if>
|
|
|
+ <if test="c3FrOxo != null">c3_fr_oxo,</if>
|
|
|
+ <if test="mixedC3C4 != null">mixed_c3_c4,</if>
|
|
|
+ <if test="hyC9 != null">hy_c9,</if>
|
|
|
+ <if test="pguOffgas != null">pgu_offgas,</if>
|
|
|
+ <if test="washOil != null">wash_oil,</if>
|
|
|
+ <if test="toluene != null">toluene,</if>
|
|
|
+ <if test="hyC4FrR800 != null">hy_c4_fr_r800,</if>
|
|
|
+ <if test="crackerRawInput != null">cracker_raw_input,</if>
|
|
|
+ <if test="crackerRawFeed != null">cracker_raw_feed,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">#{id},</if>
|
|
|
+ <if test="reportMonth != null">#{reportMonth},</if>
|
|
|
+ <if test="reportYear != null">#{reportYear},</if>
|
|
|
+ <if test="nap != null">#{nap},</if>
|
|
|
+ <if test="c5 != null">#{c5},</if>
|
|
|
+ <if test="c6C8Na != null">#{c6C8Na},</if>
|
|
|
+ <if test="wisonEthane != null">#{wisonEthane},</if>
|
|
|
+ <if test="lpgToFurnace != null">#{lpgToFurnace},</if>
|
|
|
+ <if test="raff3FrBdAnd2ph != null">#{raff3FrBdAnd2ph},</if>
|
|
|
+ <if test="c2FrLdpe != null">#{c2FrLdpe},</if>
|
|
|
+ <if test="c3FrOxo != null">#{c3FrOxo},</if>
|
|
|
+ <if test="mixedC3C4 != null">#{mixedC3C4},</if>
|
|
|
+ <if test="hyC9 != null">#{hyC9},</if>
|
|
|
+ <if test="pguOffgas != null">#{pguOffgas},</if>
|
|
|
+ <if test="washOil != null">#{washOil},</if>
|
|
|
+ <if test="toluene != null">#{toluene},</if>
|
|
|
+ <if test="hyC4FrR800 != null">#{hyC4FrR800},</if>
|
|
|
+ <if test="crackerRawInput != null">#{crackerRawInput},</if>
|
|
|
+ <if test="crackerRawFeed != null">#{crackerRawFeed},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateTMonthlyProductionReport" parameterType="TMonthlyProductionReport">
|
|
|
+ update t_monthly_production_report
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="nap != null">nap = #{nap},</if>
|
|
|
+ <if test="c5 != null">c5 = #{c5},</if>
|
|
|
+ <if test="c6C8Na != null">c6_c8_na = #{c6C8Na},</if>
|
|
|
+ <if test="wisonEthane != null">wison_ethane = #{wisonEthane},</if>
|
|
|
+ <if test="lpgToFurnace != null">lpg_to_furnace = #{lpgToFurnace},</if>
|
|
|
+ <if test="raff3FrBdAnd2ph != null">raff3_fr_bd_and_2ph = #{raff3FrBdAnd2ph},</if>
|
|
|
+ <if test="c2FrLdpe != null">c2_fr_ldpe = #{c2FrLdpe},</if>
|
|
|
+ <if test="c3FrOxo != null">c3_fr_oxo = #{c3FrOxo},</if>
|
|
|
+ <if test="mixedC3C4 != null">mixed_c3_c4 = #{mixedC3C4},</if>
|
|
|
+ <if test="hyC9 != null">hy_c9 = #{hyC9},</if>
|
|
|
+ <if test="pguOffgas != null">pgu_offgas = #{pguOffgas},</if>
|
|
|
+ <if test="washOil != null">wash_oil = #{washOil},</if>
|
|
|
+ <if test="toluene != null">toluene = #{toluene},</if>
|
|
|
+ <if test="hyC4FrR800 != null">hy_c4_fr_r800 = #{hyC4FrR800},</if>
|
|
|
+ <if test="crackerRawInput != null">cracker_raw_input = #{crackerRawInput},</if>
|
|
|
+ <if test="crackerRawFeed != null">cracker_raw_feed = #{crackerRawFeed},</if>
|
|
|
+ </trim>
|
|
|
+ where report_month = #{reportMonth} and report_year = #{reportYear}
|
|
|
+ </update>
|
|
|
+
|
|
|
</mapper>
|