TMonthplanMapper.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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.TMonthplanMapper">
  6. <resultMap type="TMonthplan" id="TMonthplanResult">
  7. <result property="id" column="id" />
  8. <result property="plantCode" column="plant_code" />
  9. <result property="year" column="year" />
  10. <result property="ethylene" column="ethylene" />
  11. <result property="btx" column="btx" />
  12. <result property="kpi" column="kpi" />
  13. <result property="jan" column="jan" />
  14. <result property="feb" column="feb" />
  15. <result property="mar" column="mar" />
  16. <result property="apr" column="apr" />
  17. <result property="may" column="may" />
  18. <result property="jun" column="jun" />
  19. <result property="jul" column="jul" />
  20. <result property="aug" column="aug" />
  21. <result property="sep" column="sep" />
  22. <result property="oct" column="oct" />
  23. <result property="nov" column="nov" />
  24. <result property="dec" column="dec" />
  25. <result property="ytd" column="ytd" />
  26. <result property="target" column="target" />
  27. <result property="sort" column="sort" />
  28. <result property="item" column="item" />
  29. <result property="delFlag" column="del_flag" />
  30. <result property="createrCode" column="creater_code" />
  31. <result property="createdate" column="createdate" />
  32. <result property="updaterCode" column="updater_code" />
  33. <result property="updatedate" column="updatedate" />
  34. <result property="remarks" column="remarks" />
  35. <result property="deptId" column="dept_id" />
  36. <result property="deptName" column="dept_name" />
  37. </resultMap>
  38. <sql id="selectTMonthplanVo">
  39. select d.id, d.plant_code, d.year, d.ethylene, d.btx, d.kpi, d.jan, d.feb, d.mar, d.apr, d.may, d.jun, d.jul, d.aug, d.sep, d.oct, d.nov, d.dec, d.ytd, d.target, d.sort, d.item, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.remarks, d.dept_id ,s.dept_name from t_monthplan d
  40. left join sys_dept s on s.dept_id = d.dept_id
  41. </sql>
  42. <select id="selectTMonthplanList" parameterType="TMonthplan" resultMap="TMonthplanResult">
  43. <include refid="selectTMonthplanVo"/>
  44. <where>
  45. <if test="plantCode != null and plantCode != ''"> and plant_code = #{plantCode}</if>
  46. <if test="year != null "> and year = #{year}</if>
  47. <if test="ethylene != null and ethylene != ''"> and ethylene = #{ethylene}</if>
  48. <if test="btx != null and btx != ''"> and btx = #{btx}</if>
  49. <if test="kpi != null and kpi != ''"> and kpi = #{kpi}</if>
  50. <if test="jan != null "> and jan = #{jan}</if>
  51. <if test="feb != null "> and feb = #{feb}</if>
  52. <if test="mar != null "> and mar = #{mar}</if>
  53. <if test="apr != null "> and apr = #{apr}</if>
  54. <if test="may != null "> and may = #{may}</if>
  55. <if test="jun != null "> and jun = #{jun}</if>
  56. <if test="jul != null "> and jul = #{jul}</if>
  57. <if test="aug != null "> and aug = #{aug}</if>
  58. <if test="sep != null "> and sep = #{sep}</if>
  59. <if test="oct != null "> and oct = #{oct}</if>
  60. <if test="nov != null "> and nov = #{nov}</if>
  61. <if test="dec != null "> and dec = #{dec}</if>
  62. <if test="ytd != null "> and ytd = #{ytd}</if>
  63. <if test="target != null "> and target = #{target}</if>
  64. <if test="sort != null "> and sort = #{sort}</if>
  65. <if test="item != null "> and item = #{item}</if>
  66. <if test="createrCode != null and createrCode != ''"> and creater_code = #{createrCode}</if>
  67. <if test="createdate != null "> and createdate = #{createdate}</if>
  68. <if test="updaterCode != null and updaterCode != ''"> and updater_code = #{updaterCode}</if>
  69. <if test="updatedate != null "> and updatedate = #{updatedate}</if>
  70. <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
  71. <if test="deptId != null "> and dept_id = #{deptId}</if>
  72. and d.del_flag = 0
  73. </where>
  74. <!-- 数据范围过滤 -->
  75. ${params.dataScope}
  76. order by d.sort
  77. </select>
  78. <select id="selectTMonthplanById" parameterType="Long" resultMap="TMonthplanResult">
  79. <include refid="selectTMonthplanVo"/>
  80. where id = #{id}
  81. </select>
  82. <insert id="insertTMonthplan" parameterType="TMonthplan">
  83. <selectKey keyProperty="id" resultType="long" order="BEFORE">
  84. SELECT seq_t_monthplan.NEXTVAL as id FROM DUAL
  85. </selectKey>
  86. insert into t_monthplan
  87. <trim prefix="(" suffix=")" suffixOverrides=",">
  88. <if test="id != null">id,</if>
  89. <if test="plantCode != null and plantCode != ''">plant_code,</if>
  90. <if test="year != null">year,</if>
  91. <if test="ethylene != null">ethylene,</if>
  92. <if test="btx != null">btx,</if>
  93. <if test="kpi != null">kpi,</if>
  94. <if test="jan != null">jan,</if>
  95. <if test="feb != null">feb,</if>
  96. <if test="mar != null">mar,</if>
  97. <if test="apr != null">apr,</if>
  98. <if test="may != null">may,</if>
  99. <if test="jun != null">jun,</if>
  100. <if test="jul != null">jul,</if>
  101. <if test="aug != null">aug,</if>
  102. <if test="sep != null">sep,</if>
  103. <if test="oct != null">oct,</if>
  104. <if test="nov != null">nov,</if>
  105. <if test="dec != null">dec,</if>
  106. <if test="ytd != null">ytd,</if>
  107. <if test="target != null">target,</if>
  108. <if test="sort != null">sort,</if>
  109. <if test="item != null">item,</if>
  110. <if test="delFlag != null">del_flag,</if>
  111. <if test="createrCode != null">creater_code,</if>
  112. <if test="createdate != null">createdate,</if>
  113. <if test="updaterCode != null">updater_code,</if>
  114. <if test="updatedate != null">updatedate,</if>
  115. <if test="remarks != null">remarks,</if>
  116. <if test="deptId != null">dept_id,</if>
  117. </trim>
  118. <trim prefix="values (" suffix=")" suffixOverrides=",">
  119. <if test="id != null">#{id},</if>
  120. <if test="plantCode != null and plantCode != ''">#{plantCode},</if>
  121. <if test="year != null">#{year},</if>
  122. <if test="ethylene != null">#{ethylene},</if>
  123. <if test="btx != null">#{btx},</if>
  124. <if test="kpi != null">#{kpi},</if>
  125. <if test="jan != null">#{jan},</if>
  126. <if test="feb != null">#{feb},</if>
  127. <if test="mar != null">#{mar},</if>
  128. <if test="apr != null">#{apr},</if>
  129. <if test="may != null">#{may},</if>
  130. <if test="jun != null">#{jun},</if>
  131. <if test="jul != null">#{jul},</if>
  132. <if test="aug != null">#{aug},</if>
  133. <if test="sep != null">#{sep},</if>
  134. <if test="oct != null">#{oct},</if>
  135. <if test="nov != null">#{nov},</if>
  136. <if test="dec != null">#{dec},</if>
  137. <if test="ytd != null">#{ytd},</if>
  138. <if test="target != null">#{target},</if>
  139. <if test="sort != null">#{sort},</if>
  140. <if test="item != null">#{item},</if>
  141. <if test="delFlag != null">#{delFlag},</if>
  142. <if test="createrCode != null">#{createrCode},</if>
  143. <if test="createdate != null">#{createdate},</if>
  144. <if test="updaterCode != null">#{updaterCode},</if>
  145. <if test="updatedate != null">#{updatedate},</if>
  146. <if test="remarks != null">#{remarks},</if>
  147. <if test="deptId != null">#{deptId},</if>
  148. </trim>
  149. </insert>
  150. <update id="updateTMonthplan" parameterType="TMonthplan">
  151. update t_monthplan
  152. <trim prefix="SET" suffixOverrides=",">
  153. <if test="plantCode != null and plantCode != ''">plant_code = #{plantCode},</if>
  154. <if test="year != null">year = #{year},</if>
  155. <if test="ethylene != null">ethylene = #{ethylene},</if>
  156. <if test="btx != null">btx = #{btx},</if>
  157. <if test="kpi != null">kpi = #{kpi},</if>
  158. <if test="jan != null">jan = #{jan},</if>
  159. <if test="feb != null">feb = #{feb},</if>
  160. <if test="mar != null">mar = #{mar},</if>
  161. <if test="apr != null">apr = #{apr},</if>
  162. <if test="may != null">may = #{may},</if>
  163. <if test="jun != null">jun = #{jun},</if>
  164. <if test="jul != null">jul = #{jul},</if>
  165. <if test="aug != null">aug = #{aug},</if>
  166. <if test="sep != null">sep = #{sep},</if>
  167. <if test="oct != null">oct = #{oct},</if>
  168. <if test="nov != null">nov = #{nov},</if>
  169. <if test="dec != null">dec = #{dec},</if>
  170. <if test="ytd != null">ytd = #{ytd},</if>
  171. <if test="target != null">target = #{target},</if>
  172. <if test="sort != null">sort = #{sort},</if>
  173. <if test="item != null">item = #{item},</if>
  174. <if test="delFlag != null">del_flag = #{delFlag},</if>
  175. <if test="createrCode != null">creater_code = #{createrCode},</if>
  176. <if test="createdate != null">createdate = #{createdate},</if>
  177. <if test="updaterCode != null">updater_code = #{updaterCode},</if>
  178. <if test="updatedate != null">updatedate = #{updatedate},</if>
  179. <if test="remarks != null">remarks = #{remarks},</if>
  180. <if test="deptId != null">dept_id = #{deptId},</if>
  181. </trim>
  182. where id = #{id}
  183. </update>
  184. <update id="deleteTMonthplanById" parameterType="Long">
  185. update t_monthplan set del_flag = 2 where id = #{id}
  186. </update>
  187. <update id="deleteTMonthplanByIds" parameterType="String">
  188. update t_monthplan set del_flag = 2 where id in
  189. <foreach item="id" collection="array" open="(" separator="," close=")">
  190. #{id}
  191. </foreach>
  192. </update>
  193. </mapper>