TPssrSubcontentMapper.xml 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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.pssr.mapper.TPssrSubcontentMapper">
  6. <resultMap type="TPssrSubcontent" id="TPssrSubcontentResult">
  7. <result property="id" column="id" />
  8. <result property="approveId" column="approve_id" />
  9. <result property="aboveallId" column="aboveall_id" />
  10. <result property="serialNumber" column="serial_number" />
  11. <result property="item" column="item" />
  12. <result property="content" column="content" />
  13. <result property="confirm" column="confirm" />
  14. <result property="confirmName" column="confirm_name" />
  15. <result property="confirmationDate" column="confirmation_date" />
  16. <result property="delFlag" column="del_flag" />
  17. <result property="createrCode" column="creater_code" />
  18. <result property="createdate" column="createdate" />
  19. <result property="updaterCode" column="updater_code" />
  20. <result property="updatedate" column="updatedate" />
  21. <result property="deptId" column="dept_id" />
  22. <result property="remarks" column="remarks" />
  23. <result property="unitDes" column="unit_des" />
  24. <result property="unit" column="unit" />
  25. <result property="region" column="region" />
  26. <result property="approveStatus" column="approve_status" />
  27. <result property="deptName" column="dept_name" />
  28. <result property="forShort" column="for_short" />
  29. <result property="deptUnit" column="dept_unit" />
  30. </resultMap>
  31. <sql id="selectTPssrSubcontentVo">
  32. select d.for_short,d.dept_unit,d.id, d.approve_id, d.aboveall_id, d.serial_number, d.item, d.content, d.confirm,u.NICK_NAME confirm_name, d.confirmation_date, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.unit_des, d.unit, d.region, d.approve_status ,s.dept_name from t_pssr_subcontent d
  33. left join sys_dept s on s.dept_id = d.dept_id
  34. left join sys_user u on d.CONFIRM = u.USER_ID
  35. </sql>
  36. <select id="selectTPssrSubcontentList" parameterType="TPssrSubcontent" resultMap="TPssrSubcontentResult">
  37. <include refid="selectTPssrSubcontentVo"/>
  38. <where>
  39. <if test="approveId != null "> and approve_id = #{approveId}</if>
  40. <if test="aboveallId != null "> and aboveall_id = #{aboveallId}</if>
  41. <if test="serialNumber != null and serialNumber != ''"> and serial_number = #{serialNumber}</if>
  42. <if test="item != null and item != ''"> and item = #{item}</if>
  43. <if test="content != null and content != ''"> and content = #{content}</if>
  44. <if test="confirm != null and confirm != ''"> and confirm = #{confirm}</if>
  45. <if test="confirmationDate != null "> and confirmation_date = #{confirmationDate}</if>
  46. <if test="createrCode != null and createrCode != ''"> and creater_code = #{createrCode}</if>
  47. <if test="createdate != null "> and createdate = #{createdate}</if>
  48. <if test="updaterCode != null and updaterCode != ''"> and updater_code = #{updaterCode}</if>
  49. <if test="updatedate != null "> and updatedate = #{updatedate}</if>
  50. <if test="deptId != null "> and dept_id = #{deptId}</if>
  51. <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
  52. <if test="unitDes != null and unitDes != ''"> and unit_des = #{unitDes}</if>
  53. <if test="unit != null and unit != ''"> and unit = #{unit}</if>
  54. <if test="region != null and region != ''"> and region = #{region}</if>
  55. <if test="approveStatus != null "> and approve_status = #{approveStatus}</if>
  56. <if test="forShort != null "> and for_short = #{forShort}</if>
  57. <if test="deptUnit != null "> and dept_unit = #{deptUnit}</if>
  58. and d.del_flag = 0
  59. </where>
  60. <!-- 数据范围过滤 -->
  61. ${params.dataScope}
  62. order by serial_number
  63. </select>
  64. <select id="selectTPssrSubcontentListByForShort" parameterType="TPssrSubcontent" resultMap="TPssrSubcontentResult">
  65. <include refid="selectTPssrSubcontentVo"/>
  66. <where>
  67. <if test="aboveallId != null "> and aboveall_id = #{aboveallId}</if>
  68. <if test="forShort != null "> and for_short in
  69. <foreach item="forShort" collection="array" open="(" separator="," close=")">
  70. #{forShort}
  71. </foreach></if>
  72. and d.del_flag = 0
  73. </where>
  74. </select>
  75. <select id="selectTPssrSubcontentById" parameterType="Long" resultMap="TPssrSubcontentResult">
  76. <include refid="selectTPssrSubcontentVo"/>
  77. where id = #{id}
  78. </select>
  79. <insert id="insertTPssrSubcontent" parameterType="TPssrSubcontent">
  80. <selectKey keyProperty="id" resultType="long" order="BEFORE">
  81. SELECT seq_t_pssr_subcontent.NEXTVAL as id FROM DUAL
  82. </selectKey>
  83. insert into t_pssr_subcontent
  84. <trim prefix="(" suffix=")" suffixOverrides=",">
  85. <if test="id != null">id,</if>
  86. <if test="approveId != null">approve_id,</if>
  87. <if test="aboveallId != null">aboveall_id,</if>
  88. <if test="serialNumber != null">serial_number,</if>
  89. <if test="item != null">item,</if>
  90. <if test="content != null">content,</if>
  91. <if test="confirm != null">confirm,</if>
  92. <if test="confirmationDate != null">confirmation_date,</if>
  93. <if test="delFlag != null">del_flag,</if>
  94. <if test="createrCode != null">creater_code,</if>
  95. <if test="createdate != null">createdate,</if>
  96. <if test="updaterCode != null">updater_code,</if>
  97. <if test="updatedate != null">updatedate,</if>
  98. <if test="deptId != null">dept_id,</if>
  99. <if test="remarks != null">remarks,</if>
  100. <if test="unitDes != null">unit_des,</if>
  101. <if test="unit != null">unit,</if>
  102. <if test="region != null">region,</if>
  103. <if test="approveStatus != null">approve_status,</if>
  104. <if test="forShort != null">for_short,</if>
  105. <if test="deptUnit != null">dept_unit,</if>
  106. </trim>
  107. <trim prefix="values (" suffix=")" suffixOverrides=",">
  108. <if test="id != null">#{id},</if>
  109. <if test="approveId != null">#{approveId},</if>
  110. <if test="aboveallId != null">#{aboveallId},</if>
  111. <if test="serialNumber != null">#{serialNumber},</if>
  112. <if test="item != null">#{item},</if>
  113. <if test="content != null">#{content},</if>
  114. <if test="confirm != null">#{confirm},</if>
  115. <if test="confirmationDate != null">#{confirmationDate},</if>
  116. <if test="delFlag != null">#{delFlag},</if>
  117. <if test="createrCode != null">#{createrCode},</if>
  118. <if test="createdate != null">#{createdate},</if>
  119. <if test="updaterCode != null">#{updaterCode},</if>
  120. <if test="updatedate != null">#{updatedate},</if>
  121. <if test="deptId != null">#{deptId},</if>
  122. <if test="remarks != null">#{remarks},</if>
  123. <if test="unitDes != null">#{unitDes},</if>
  124. <if test="unit != null">#{unit},</if>
  125. <if test="region != null">#{region},</if>
  126. <if test="approveStatus != null">#{approveStatus},</if>
  127. <if test="forShort != null">#{forShort},</if>
  128. <if test="deptUnit != null">#{deptUnit},</if>
  129. </trim>
  130. </insert>
  131. <update id="updateTPssrSubcontent" parameterType="TPssrSubcontent">
  132. update t_pssr_subcontent
  133. <trim prefix="SET" suffixOverrides=",">
  134. <if test="approveId != null">approve_id = #{approveId},</if>
  135. <if test="aboveallId != null">aboveall_id = #{aboveallId},</if>
  136. <if test="serialNumber != null">serial_number = #{serialNumber},</if>
  137. <if test="item != null">item = #{item},</if>
  138. <if test="content != null">content = #{content},</if>
  139. <if test="confirm != null">confirm = #{confirm},</if>
  140. <if test="confirmationDate != null">confirmation_date = #{confirmationDate},</if>
  141. <if test="delFlag != null">del_flag = #{delFlag},</if>
  142. <if test="createrCode != null">creater_code = #{createrCode},</if>
  143. <if test="createdate != null">createdate = #{createdate},</if>
  144. <if test="updaterCode != null">updater_code = #{updaterCode},</if>
  145. <if test="updatedate != null">updatedate = #{updatedate},</if>
  146. <if test="deptId != null">dept_id = #{deptId},</if>
  147. <if test="remarks != null">remarks = #{remarks},</if>
  148. <if test="unitDes != null">unit_des = #{unitDes},</if>
  149. <if test="unit != null">unit = #{unit},</if>
  150. <if test="region != null">region = #{region},</if>
  151. <if test="approveStatus != null">approve_status = #{approveStatus},</if>
  152. <if test="forShort != null">for_short = #{forShort},</if>
  153. <if test="deptUnit != null">dept_unit = #{deptUnit},</if>
  154. </trim>
  155. where id = #{id}
  156. </update>
  157. <update id="deleteTPssrSubcontentById" parameterType="Long">
  158. update t_pssr_subcontent set del_flag = 2 where id = #{id}
  159. </update>
  160. <update id="deleteTPssrSubcontentByIds" parameterType="String">
  161. update t_pssr_subcontent set del_flag = 2 where id in
  162. <foreach item="id" collection="array" open="(" separator="," close=")">
  163. #{id}
  164. </foreach>
  165. </update>
  166. </mapper>