TMonthlyProductionReportMapper.xml 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.project.production.mapper.TMonthlyProductionReportMapper">
  6. <resultMap type="TMonthlyProductionReport" id="TMonthlyProductionReportResult">
  7. <result property="id" column="id" />
  8. <result property="reportMonth" column="report_month" />
  9. <result property="reportYear" column="report_year" />
  10. <result property="nap" column="nap" />
  11. <result property="c5" column="c5" />
  12. <result property="c6C8Na" column="c6_c8_na" />
  13. <result property="wisonEthane" column="wison_ethane" />
  14. <result property="lpgToFurnace" column="lpg_to_furnace" />
  15. <result property="raff3FrBd" column="raff3_fr_bd" />
  16. <result property="raffinate2pFr2ph" column="raffinate2p_fr_2ph" />
  17. <result property="c2FrLdpe" column="c2_fr_ldpe" />
  18. <result property="c3FrOxo" column="c3_fr_oxo" />
  19. <result property="mixedC3C4" column="mixed_c3_c4" />
  20. <result property="hyC9" column="hy_c9" />
  21. <result property="pguOffgas" column="pgu_offgas" />
  22. <result property="washOil" column="wash_oil" />
  23. <result property="toluene" column="toluene" />
  24. <result property="hyC4FrR800" column="hy_c4_fr_r800" />
  25. <result property="crackerRawInput" column="cracker_raw_input" />
  26. <result property="crackerRawFeed" column="cracker_raw_feed" />
  27. <result property="deptName" column="dept_name" />
  28. </resultMap>
  29. <sql id="selectTMonthlyProductionReportVo">
  30. select d.id, d.report_month, d.report_year, d.nap, d.c5, d.c6_c8_na, d.wison_ethane, d.lpg_to_furnace, d.raff3_fr_bd, d.raffinate2p_fr_2ph, d.c2_fr_ldpe, d.c3_fr_oxo, d.mixed_c3_c4, d.hy_c9, d.pgu_offgas, d.wash_oil, d.toluene, d.hy_c4_fr_r800, d.cracker_raw_input, d.cracker_raw_feed from t_monthly_production_report d
  31. </sql>
  32. <select id="selectCrackerRawMaterialByYear" parameterType="Long" resultMap="TMonthlyProductionReportResult">
  33. select
  34. d.id, d.report_month, d.report_year, d.nap, d.c5, d.c6_c8_na, d.wison_ethane, d.lpg_to_furnace,
  35. d.raff3_fr_bd, d.raffinate2p_fr_2ph, d.c2_fr_ldpe, d.c3_fr_oxo, d.mixed_c3_c4, d.hy_c9, d.pgu_offgas,
  36. d.wash_oil, d.toluene, d.hy_c4_fr_r800, d.cracker_raw_input, d.cracker_raw_feed
  37. from
  38. t_monthly_production_report d
  39. where d.report_year = #{year}
  40. </select>
  41. <select id="selectTMonthlyProductionReportList" parameterType="TMonthlyProductionReport" resultMap="TMonthlyProductionReportResult">
  42. <include refid="selectTMonthlyProductionReportVo"/>
  43. <where>
  44. <if test="reportMonth != null "> and report_month = #{reportMonth}</if>
  45. <if test="reportYear != null "> and report_year = #{reportYear}</if>
  46. <if test="nap != null and nap != ''"> and nap = #{nap}</if>
  47. <if test="c5 != null and c5 != ''"> and c5 = #{c5}</if>
  48. <if test="c6C8Na != null and c6C8Na != ''"> and c6_c8_na = #{c6C8Na}</if>
  49. <if test="wisonEthane != null and wisonEthane != ''"> and wison_ethane = #{wisonEthane}</if>
  50. <if test="lpgToFurnace != null and lpgToFurnace != ''"> and lpg_to_furnace = #{lpgToFurnace}</if>
  51. <if test="raff3FrBd != null and raff3FrBd != ''"> and raff3_fr_bd = #{raff3FrBd}</if>
  52. <if test="raffinate2pFr2ph != null and raffinate2pFr2ph != ''"> and raffinate2p_fr_2ph = #{raffinate2pFr2ph}</if>
  53. <if test="c2FrLdpe != null and c2FrLdpe != ''"> and c2_fr_ldpe = #{c2FrLdpe}</if>
  54. <if test="c3FrOxo != null and c3FrOxo != ''"> and c3_fr_oxo = #{c3FrOxo}</if>
  55. <if test="mixedC3C4 != null and mixedC3C4 != ''"> and mixed_c3_c4 = #{mixedC3C4}</if>
  56. <if test="hyC9 != null and hyC9 != ''"> and hy_c9 = #{hyC9}</if>
  57. <if test="pguOffgas != null and pguOffgas != ''"> and pgu_offgas = #{pguOffgas}</if>
  58. <if test="washOil != null and washOil != ''"> and wash_oil = #{washOil}</if>
  59. <if test="toluene != null and toluene != ''"> and toluene = #{toluene}</if>
  60. <if test="hyC4FrR800 != null and hyC4FrR800 != ''"> and hy_c4_fr_r800 = #{hyC4FrR800}</if>
  61. <if test="crackerRawInput != null and crackerRawInput != ''"> and cracker_raw_input = #{crackerRawInput}</if>
  62. <if test="crackerRawFeed != null and crackerRawFeed != ''"> and cracker_raw_feed = #{crackerRawFeed}</if>
  63. and d.del_flag = 0
  64. </where>
  65. <!-- 数据范围过滤 -->
  66. ${params.dataScope}
  67. </select>
  68. <select id="selectTMonthlyProductionReportById" parameterType="Long" resultMap="TMonthlyProductionReportResult">
  69. <include refid="selectTMonthlyProductionReportVo"/>
  70. where id = #{id}
  71. </select>
  72. <insert id="insertTMonthlyProductionReport" parameterType="TMonthlyProductionReport">
  73. <selectKey keyProperty="id" resultType="long" order="BEFORE">
  74. SELECT SEQ_T_MONTHLY_REPORT.NEXTVAL as id FROM DUAL
  75. </selectKey>
  76. insert into t_monthly_production_report
  77. <trim prefix="(" suffix=")" suffixOverrides=",">
  78. <if test="id != null">id,</if>
  79. <if test="reportMonth != null">report_month,</if>
  80. <if test="reportYear != null">report_year,</if>
  81. <if test="nap != null">nap,</if>
  82. <if test="c5 != null">c5,</if>
  83. <if test="c6C8Na != null">c6_c8_na,</if>
  84. <if test="wisonEthane != null">wison_ethane,</if>
  85. <if test="lpgToFurnace != null">lpg_to_furnace,</if>
  86. <if test="raff3FrBd != null">raff3_fr_bd,</if>
  87. <if test="raffinate2pFr2ph != null">raffinate2p_fr_2ph,</if>
  88. <if test="c2FrLdpe != null">c2_fr_ldpe,</if>
  89. <if test="c3FrOxo != null">c3_fr_oxo,</if>
  90. <if test="mixedC3C4 != null">mixed_c3_c4,</if>
  91. <if test="hyC9 != null">hy_c9,</if>
  92. <if test="pguOffgas != null">pgu_offgas,</if>
  93. <if test="washOil != null">wash_oil,</if>
  94. <if test="toluene != null">toluene,</if>
  95. <if test="hyC4FrR800 != null">hy_c4_fr_r800,</if>
  96. <if test="crackerRawInput != null">cracker_raw_input,</if>
  97. <if test="crackerRawFeed != null">cracker_raw_feed,</if>
  98. </trim>
  99. <trim prefix="values (" suffix=")" suffixOverrides=",">
  100. <if test="id != null">#{id},</if>
  101. <if test="reportMonth != null">#{reportMonth},</if>
  102. <if test="reportYear != null">#{reportYear},</if>
  103. <if test="nap != null">#{nap},</if>
  104. <if test="c5 != null">#{c5},</if>
  105. <if test="c6C8Na != null">#{c6C8Na},</if>
  106. <if test="wisonEthane != null">#{wisonEthane},</if>
  107. <if test="lpgToFurnace != null">#{lpgToFurnace},</if>
  108. <if test="raff3FrBd != null">#{raff3FrBd},</if>
  109. <if test="raffinate2pFr2ph != null">#{raffinate2pFr2ph},</if>
  110. <if test="c2FrLdpe != null">#{c2FrLdpe},</if>
  111. <if test="c3FrOxo != null">#{c3FrOxo},</if>
  112. <if test="mixedC3C4 != null">#{mixedC3C4},</if>
  113. <if test="hyC9 != null">#{hyC9},</if>
  114. <if test="pguOffgas != null">#{pguOffgas},</if>
  115. <if test="washOil != null">#{washOil},</if>
  116. <if test="toluene != null">#{toluene},</if>
  117. <if test="hyC4FrR800 != null">#{hyC4FrR800},</if>
  118. <if test="crackerRawInput != null">#{crackerRawInput},</if>
  119. <if test="crackerRawFeed != null">#{crackerRawFeed},</if>
  120. </trim>
  121. </insert>
  122. <update id="updateTMonthlyProductionReport" parameterType="TMonthlyProductionReport">
  123. update t_monthly_production_report
  124. <trim prefix="SET" suffixOverrides=",">
  125. <if test="reportMonth != null">report_month = #{reportMonth},</if>
  126. <if test="reportYear != null">report_year = #{reportYear},</if>
  127. <if test="nap != null">nap = #{nap},</if>
  128. <if test="c5 != null">c5 = #{c5},</if>
  129. <if test="c6C8Na != null">c6_c8_na = #{c6C8Na},</if>
  130. <if test="wisonEthane != null">wison_ethane = #{wisonEthane},</if>
  131. <if test="lpgToFurnace != null">lpg_to_furnace = #{lpgToFurnace},</if>
  132. <if test="raff3FrBd != null">raff3_fr_bd = #{raff3FrBd},</if>
  133. <if test="raffinate2pFr2ph != null">raffinate2p_fr_2ph = #{raffinate2pFr2ph},</if>
  134. <if test="c2FrLdpe != null">c2_fr_ldpe = #{c2FrLdpe},</if>
  135. <if test="c3FrOxo != null">c3_fr_oxo = #{c3FrOxo},</if>
  136. <if test="mixedC3C4 != null">mixed_c3_c4 = #{mixedC3C4},</if>
  137. <if test="hyC9 != null">hy_c9 = #{hyC9},</if>
  138. <if test="pguOffgas != null">pgu_offgas = #{pguOffgas},</if>
  139. <if test="washOil != null">wash_oil = #{washOil},</if>
  140. <if test="toluene != null">toluene = #{toluene},</if>
  141. <if test="hyC4FrR800 != null">hy_c4_fr_r800 = #{hyC4FrR800},</if>
  142. <if test="crackerRawInput != null">cracker_raw_input = #{crackerRawInput},</if>
  143. <if test="crackerRawFeed != null">cracker_raw_feed = #{crackerRawFeed},</if>
  144. </trim>
  145. where id = #{id}
  146. </update>
  147. <update id="deleteTMonthlyProductionReportById" parameterType="Long">
  148. update t_monthly_production_report set del_flag = 2 where id = #{id}
  149. </update>
  150. <update id="deleteTMonthlyProductionReportByIds" parameterType="String">
  151. update t_monthly_production_report set del_flag = 2 where id in
  152. <foreach item="id" collection="array" open="(" separator="," close=")">
  153. #{id}
  154. </foreach>
  155. </update>
  156. </mapper>