TPssrContentModelMapper.xml 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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.TPssrContentModelMapper">
  6. <resultMap type="TPssrContentModel" id="TPssrContentModelResult">
  7. <result property="id" column="id" />
  8. <result property="status" column="status" />
  9. <result property="serialNumber" column="serial_number" />
  10. <result property="item" column="item" />
  11. <result property="content" column="content" />
  12. <result property="delFlag" column="del_flag" />
  13. <result property="createrCode" column="creater_code" />
  14. <result property="createdate" column="createdate" />
  15. <result property="updaterCode" column="updater_code" />
  16. <result property="updatedate" column="updatedate" />
  17. <result property="deptId" column="dept_id" />
  18. <result property="remarks" column="remarks" />
  19. <result property="approveStatus" column="approve_status" />
  20. <result property="deptName" column="dept_name" />
  21. <result property="forShort" column="for_short" />
  22. <result property="deptUnit" column="dept_unit" />
  23. </resultMap>
  24. <sql id="selectTPssrContentModelVo">
  25. select d.for_short,d.dept_unit,d.id, d.status, d.serial_number, d.item, d.content, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.approve_status ,s.dept_name from t_pssr_content_model d
  26. left join sys_dept s on s.dept_id = d.dept_id
  27. </sql>
  28. <select id="selectTPssrContentModelList" parameterType="TPssrContentModel" resultMap="TPssrContentModelResult">
  29. <include refid="selectTPssrContentModelVo"/>
  30. <where>
  31. <if test="status != null "> and status = #{status}</if>
  32. <if test="serialNumber != null and serialNumber != ''"> and serial_number = #{serialNumber}</if>
  33. <if test="item != null and item != ''"> and item = #{item}</if>
  34. <if test="content != null and content != ''"> and content = #{content}</if>
  35. <if test="createrCode != null and createrCode != ''"> and creater_code = #{createrCode}</if>
  36. <if test="createdate != null "> and createdate = #{createdate}</if>
  37. <if test="updaterCode != null and updaterCode != ''"> and updater_code = #{updaterCode}</if>
  38. <if test="updatedate != null "> and updatedate = #{updatedate}</if>
  39. <if test="deptId != null "> and dept_id = #{deptId}</if>
  40. <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
  41. <if test="approveStatus != null "> and approve_status = #{approveStatus}</if>
  42. <if test="forShort != null "> and for_short = #{forShort}</if>
  43. <if test="deptUnit != null "> and dept_unit = #{deptUnit}</if>
  44. and d.del_flag = 0
  45. </where>
  46. <!-- 数据范围过滤 -->
  47. ${params.dataScope}
  48. order by serial_number
  49. </select>
  50. <select id="selectTPssrContentModelById" parameterType="Long" resultMap="TPssrContentModelResult">
  51. <include refid="selectTPssrContentModelVo"/>
  52. where id = #{id}
  53. </select>
  54. <insert id="insertTPssrContentModel" parameterType="TPssrContentModel">
  55. <selectKey keyProperty="id" resultType="long" order="BEFORE">
  56. SELECT seq_t_pssr_content_model.NEXTVAL as id FROM DUAL
  57. </selectKey>
  58. insert into t_pssr_content_model
  59. <trim prefix="(" suffix=")" suffixOverrides=",">
  60. <if test="id != null">id,</if>
  61. <if test="status != null">status,</if>
  62. <if test="serialNumber != null">serial_number,</if>
  63. <if test="item != null">item,</if>
  64. <if test="content != null">content,</if>
  65. <if test="delFlag != null">del_flag,</if>
  66. <if test="createrCode != null">creater_code,</if>
  67. <if test="createdate != null">createdate,</if>
  68. <if test="updaterCode != null">updater_code,</if>
  69. <if test="updatedate != null">updatedate,</if>
  70. <if test="deptId != null">dept_id,</if>
  71. <if test="remarks != null">remarks,</if>
  72. <if test="approveStatus != null">approve_status,</if>
  73. <if test="forShort != null">for_short,</if>
  74. <if test="deptUnit != null">dept_unit,</if>
  75. </trim>
  76. <trim prefix="values (" suffix=")" suffixOverrides=",">
  77. <if test="id != null">#{id},</if>
  78. <if test="status != null">#{status},</if>
  79. <if test="serialNumber != null">#{serialNumber},</if>
  80. <if test="item != null">#{item},</if>
  81. <if test="content != null">#{content},</if>
  82. <if test="delFlag != null">#{delFlag},</if>
  83. <if test="createrCode != null">#{createrCode},</if>
  84. <if test="createdate != null">#{createdate},</if>
  85. <if test="updaterCode != null">#{updaterCode},</if>
  86. <if test="updatedate != null">#{updatedate},</if>
  87. <if test="deptId != null">#{deptId},</if>
  88. <if test="remarks != null">#{remarks},</if>
  89. <if test="approveStatus != null">#{approveStatus},</if>
  90. <if test="forShort != null">#{forShort},</if>
  91. <if test="deptUnit != null">#{deptUnit},</if>
  92. </trim>
  93. </insert>
  94. <update id="updateTPssrContentModel" parameterType="TPssrContentModel">
  95. update t_pssr_content_model
  96. <trim prefix="SET" suffixOverrides=",">
  97. <if test="status != null">status = #{status},</if>
  98. <if test="serialNumber != null">serial_number = #{serialNumber},</if>
  99. <if test="item != null">item = #{item},</if>
  100. <if test="content != null">content = #{content},</if>
  101. <if test="delFlag != null">del_flag = #{delFlag},</if>
  102. <if test="createrCode != null">creater_code = #{createrCode},</if>
  103. <if test="createdate != null">createdate = #{createdate},</if>
  104. <if test="updaterCode != null">updater_code = #{updaterCode},</if>
  105. <if test="updatedate != null">updatedate = #{updatedate},</if>
  106. <if test="deptId != null">dept_id = #{deptId},</if>
  107. <if test="remarks != null and remarks != ''">remarks = #{remarks},</if>
  108. <if test="approveStatus != null">approve_status = #{approveStatus},</if>
  109. <if test="forShort != null">for_short = #{forShort},</if>
  110. <if test="deptUnit != null">dept_unit = #{deptUnit},</if>
  111. </trim>
  112. where id = #{id}
  113. </update>
  114. <update id="deleteTPssrContentModelById" parameterType="Long">
  115. update t_pssr_content_model set del_flag = 2 where id = #{id}
  116. </update>
  117. <update id="deleteTPssrContentModelByIds" parameterType="String">
  118. update t_pssr_content_model set del_flag = 2 where id in
  119. <foreach item="id" collection="array" open="(" separator="," close=")">
  120. #{id}
  121. </foreach>
  122. </update>
  123. </mapper>