TPpeCmldefLockerMapper.xml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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.TPpeCmldefLockerMapper">
  6. <resultMap type="TPpeCmldefLocker" id="TPpeCmldefLockerResult">
  7. <result property="id" column="id" />
  8. <result property="ppeType" column="ppe_type" />
  9. <result property="usePost" column="use_post" />
  10. <result property="isEquip" column="is_equip" />
  11. <result property="isPollution" column="is_pollution" />
  12. <result property="putAsRequired" column="put_as_required" />
  13. <result property="isIdentification" column="is_identification" />
  14. <result property="mainId" column="main_id" />
  15. <result property="delFlag" column="del_flag" />
  16. <result property="createrCode" column="creater_code" />
  17. <result property="createdate" column="createdate" />
  18. <result property="updaterCode" column="updater_code" />
  19. <result property="updatedate" column="updatedate" />
  20. <result property="remarks" column="remarks" />
  21. <result property="deptId" column="dept_id" />
  22. <result property="deptName" column="dept_name" />
  23. </resultMap>
  24. <sql id="selectTPpeCmldefLockerVo">
  25. select d.id, d.ppe_type, d.use_post, d.is_equip, d.is_pollution, d.put_as_required, d.is_identification, d.main_id, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.remarks, d.dept_id ,s.dept_name from t_ppe_cmldef_locker d
  26. left join sys_dept s on s.dept_id = d.dept_id
  27. </sql>
  28. <select id="selectTPpeCmldefLockerList" parameterType="TPpeCmldefLocker" resultMap="TPpeCmldefLockerResult">
  29. <include refid="selectTPpeCmldefLockerVo"/>
  30. <where>
  31. <if test="ppeType != null and ppeType != ''"> and ppe_type = #{ppeType}</if>
  32. <if test="usePost != null and usePost != ''"> and use_post = #{usePost}</if>
  33. <if test="isEquip != null and isEquip != ''"> and is_equip = #{isEquip}</if>
  34. <if test="isPollution != null and isPollution != ''"> and is_pollution = #{isPollution}</if>
  35. <if test="putAsRequired != null and putAsRequired != ''"> and put_as_required = #{putAsRequired}</if>
  36. <if test="isIdentification != null and isIdentification != ''"> and is_identification = #{isIdentification}</if>
  37. <if test="mainId != null "> and main_id = #{mainId}</if>
  38. <if test="createrCode != null and createrCode != ''"> and creater_code = #{createrCode}</if>
  39. <if test="createdate != null "> and createdate = #{createdate}</if>
  40. <if test="updaterCode != null and updaterCode != ''"> and updater_code = #{updaterCode}</if>
  41. <if test="updatedate != null "> and updatedate = #{updatedate}</if>
  42. <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
  43. <if test="deptId != null "> and dept_id = #{deptId}</if>
  44. and d.del_flag = 0
  45. </where>
  46. <!-- 数据范围过滤 -->
  47. ${params.dataScope}
  48. order by createdate asc
  49. </select>
  50. <select id="selectTPpeCmldefLockerById" parameterType="Long" resultMap="TPpeCmldefLockerResult">
  51. <include refid="selectTPpeCmldefLockerVo"/>
  52. where id = #{id}
  53. </select>
  54. <select id="selectTPpeCmldefLockerListByMainId" parameterType="Long" resultMap="TPpeCmldefLockerResult">
  55. <include refid="selectTPpeCmldefLockerVo"/>
  56. where main_id = #{mainId}
  57. order by createdate
  58. </select>
  59. <insert id="insertTPpeCmldefLocker" parameterType="TPpeCmldefLocker">
  60. <selectKey keyProperty="id" resultType="long" order="BEFORE">
  61. SELECT seq_t_ppe_cmldef_locker.NEXTVAL as id FROM DUAL
  62. </selectKey>
  63. insert into t_ppe_cmldef_locker
  64. <trim prefix="(" suffix=")" suffixOverrides=",">
  65. <if test="id != null">id,</if>
  66. <if test="ppeType != null">ppe_type,</if>
  67. <if test="usePost != null">use_post,</if>
  68. <if test="isEquip != null">is_equip,</if>
  69. <if test="isPollution != null">is_pollution,</if>
  70. <if test="putAsRequired != null">put_as_required,</if>
  71. <if test="isIdentification != null">is_identification,</if>
  72. <if test="mainId != null">main_id,</if>
  73. <if test="delFlag != null">del_flag,</if>
  74. <if test="createrCode != null">creater_code,</if>
  75. <if test="createdate != null">createdate,</if>
  76. <if test="updaterCode != null">updater_code,</if>
  77. <if test="updatedate != null">updatedate,</if>
  78. <if test="remarks != null">remarks,</if>
  79. <if test="deptId != null">dept_id,</if>
  80. </trim>
  81. <trim prefix="values (" suffix=")" suffixOverrides=",">
  82. <if test="id != null">#{id},</if>
  83. <if test="ppeType != null">#{ppeType},</if>
  84. <if test="usePost != null">#{usePost},</if>
  85. <if test="isEquip != null">#{isEquip},</if>
  86. <if test="isPollution != null">#{isPollution},</if>
  87. <if test="putAsRequired != null">#{putAsRequired},</if>
  88. <if test="isIdentification != null">#{isIdentification},</if>
  89. <if test="mainId != null">#{mainId},</if>
  90. <if test="delFlag != null">#{delFlag},</if>
  91. <if test="createrCode != null">#{createrCode},</if>
  92. <if test="createdate != null">#{createdate},</if>
  93. <if test="updaterCode != null">#{updaterCode},</if>
  94. <if test="updatedate != null">#{updatedate},</if>
  95. <if test="remarks != null">#{remarks},</if>
  96. <if test="deptId != null">#{deptId},</if>
  97. </trim>
  98. </insert>
  99. <update id="updateTPpeCmldefLocker" parameterType="TPpeCmldefLocker">
  100. update t_ppe_cmldef_locker
  101. <trim prefix="SET" suffixOverrides=",">
  102. <if test="ppeType != null">ppe_type = #{ppeType},</if>
  103. <if test="usePost != null">use_post = #{usePost},</if>
  104. <if test="isEquip != null">is_equip = #{isEquip},</if>
  105. <if test="isPollution != null">is_pollution = #{isPollution},</if>
  106. <if test="putAsRequired != null">put_as_required = #{putAsRequired},</if>
  107. <if test="isIdentification != null">is_identification = #{isIdentification},</if>
  108. <if test="mainId != null">main_id = #{mainId},</if>
  109. <if test="delFlag != null">del_flag = #{delFlag},</if>
  110. <if test="createrCode != null">creater_code = #{createrCode},</if>
  111. <if test="createdate != null">createdate = #{createdate},</if>
  112. <if test="updaterCode != null">updater_code = #{updaterCode},</if>
  113. <if test="updatedate != null">updatedate = #{updatedate},</if>
  114. <if test="remarks != null">remarks = #{remarks},</if>
  115. <if test="deptId != null">dept_id = #{deptId},</if>
  116. </trim>
  117. where id = #{id}
  118. </update>
  119. <update id="deleteTPpeCmldefLockerById" parameterType="Long">
  120. update t_ppe_cmldef_locker set del_flag = 2 where id = #{id}
  121. </update>
  122. <update id="deleteTPpeCmldefLockerByIds" parameterType="String">
  123. update t_ppe_cmldef_locker set del_flag = 2 where id in
  124. <foreach item="id" collection="array" open="(" separator="," close=")">
  125. #{id}
  126. </foreach>
  127. </update>
  128. </mapper>