TValveNoncMapper.xml 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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.cpms.project.process.mapper.TValveNoncMapper">
  6. <resultMap type="TValveNonc" id="TValveNoncResult">
  7. <result property="id" column="id" />
  8. <result property="vtNo" column="vt_no" />
  9. <result property="pidNo" column="pid_no" />
  10. <result property="locationAt" column="location_at" />
  11. <result property="medium" column="medium" />
  12. <result property="valveType" column="valve_type" />
  13. <result property="valveSize" column="valve_size" />
  14. <result property="responsibility" column="responsibility" />
  15. <result property="pidStatus" column="pid_status" />
  16. <result property="riskLevel" column="risk_level" />
  17. <result property="remarks" column="remarks" />
  18. <result property="delFlag" column="del_flag" />
  19. <result property="createrCode" column="creater_code" />
  20. <result property="createdate" column="createdate" />
  21. <result property="updaterCode" column="updater_code" />
  22. <result property="updatedate" column="updatedate" />
  23. <result property="deptId" column="dept_id" />
  24. </resultMap>
  25. <sql id="selectTValveNoncVo">
  26. select id, vt_no, pid_no, location_at, medium, valve_type, valve_size, responsibility, pid_status, risk_level, remarks, del_flag, creater_code, createdate, updater_code, updatedate, dept_id from t_valve_nonc
  27. </sql>
  28. <select id="selectTValveNoncList" parameterType="TValveNonc" resultMap="TValveNoncResult">
  29. <include refid="selectTValveNoncVo"/>
  30. <where>
  31. <if test="vtNo != null and vtNo != ''"> and vt_no = #{vtNo}</if>
  32. <if test="pidNo != null and pidNo != ''"> and pid_no = #{pidNo}</if>
  33. <if test="locationAt != null and locationAt != ''"> and location_at = #{locationAt}</if>
  34. <if test="medium != null and medium != ''"> and medium = #{medium}</if>
  35. <if test="valveType != null and valveType != ''"> and valve_type = #{valveType}</if>
  36. <if test="valveSize != null and valveSize != ''"> and valve_size = #{valveSize}</if>
  37. <if test="responsibility != null and responsibility != ''"> and responsibility = #{responsibility}</if>
  38. <if test="pidStatus != null and pidStatus != ''"> and pid_status = #{pidStatus}</if>
  39. <if test="riskLevel != null and riskLevel != ''"> and risk_level = #{riskLevel}</if>
  40. <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
  41. <if test="createrCode != null and createrCode != ''"> and creater_code = #{createrCode}</if>
  42. <if test="createdate != null "> and createdate = #{createdate}</if>
  43. <if test="updaterCode != null and updaterCode != ''"> and updater_code = #{updaterCode}</if>
  44. <if test="updatedate != null "> and updatedate = #{updatedate}</if>
  45. <if test="deptId != null "> and dept_id = #{deptId}</if>
  46. and del_flag=0
  47. </where>
  48. </select>
  49. <select id="selectTValveNoncById" parameterType="Long" resultMap="TValveNoncResult">
  50. <include refid="selectTValveNoncVo"/>
  51. where id = #{id}
  52. </select>
  53. <insert id="insertTValveNonc" parameterType="TValveNonc" useGeneratedKeys="true" keyProperty="id">
  54. insert into t_valve_nonc
  55. <trim prefix="(" suffix=")" suffixOverrides=",">
  56. <if test="vtNo != null">vt_no,</if>
  57. <if test="pidNo != null">pid_no,</if>
  58. <if test="locationAt != null">location_at,</if>
  59. <if test="medium != null">medium,</if>
  60. <if test="valveType != null">valve_type,</if>
  61. <if test="valveSize != null">valve_size,</if>
  62. <if test="responsibility != null">responsibility,</if>
  63. <if test="pidStatus != null">pid_status,</if>
  64. <if test="riskLevel != null">risk_level,</if>
  65. <if test="remarks != null">remarks,</if>
  66. <if test="delFlag != null">del_flag,</if>
  67. <if test="createrCode != null">creater_code,</if>
  68. <if test="createdate != null">createdate,</if>
  69. <if test="updaterCode != null">updater_code,</if>
  70. <if test="updatedate != null">updatedate,</if>
  71. <if test="deptId != null">dept_id,</if>
  72. </trim>
  73. <trim prefix="values (" suffix=")" suffixOverrides=",">
  74. <if test="vtNo != null">#{vtNo},</if>
  75. <if test="pidNo != null">#{pidNo},</if>
  76. <if test="locationAt != null">#{locationAt},</if>
  77. <if test="medium != null">#{medium},</if>
  78. <if test="valveType != null">#{valveType},</if>
  79. <if test="valveSize != null">#{valveSize},</if>
  80. <if test="responsibility != null">#{responsibility},</if>
  81. <if test="pidStatus != null">#{pidStatus},</if>
  82. <if test="riskLevel != null">#{riskLevel},</if>
  83. <if test="remarks != null">#{remarks},</if>
  84. <if test="delFlag != null">#{delFlag},</if>
  85. <if test="createrCode != null">#{createrCode},</if>
  86. <if test="createdate != null">#{createdate},</if>
  87. <if test="updaterCode != null">#{updaterCode},</if>
  88. <if test="updatedate != null">#{updatedate},</if>
  89. <if test="deptId != null">#{deptId},</if>
  90. </trim>
  91. </insert>
  92. <update id="updateTValveNonc" parameterType="TValveNonc">
  93. update t_valve_nonc
  94. <trim prefix="SET" suffixOverrides=",">
  95. <if test="vtNo != null">vt_no = #{vtNo},</if>
  96. <if test="pidNo != null">pid_no = #{pidNo},</if>
  97. <if test="locationAt != null">location_at = #{locationAt},</if>
  98. <if test="medium != null">medium = #{medium},</if>
  99. <if test="valveType != null">valve_type = #{valveType},</if>
  100. <if test="valveSize != null">valve_size = #{valveSize},</if>
  101. <if test="responsibility != null">responsibility = #{responsibility},</if>
  102. <if test="pidStatus != null">pid_status = #{pidStatus},</if>
  103. <if test="riskLevel != null">risk_level = #{riskLevel},</if>
  104. <if test="remarks != null">remarks = #{remarks},</if>
  105. <if test="delFlag != null">del_flag = #{delFlag},</if>
  106. <if test="createrCode != null">creater_code = #{createrCode},</if>
  107. <if test="createdate != null">createdate = #{createdate},</if>
  108. <if test="updaterCode != null">updater_code = #{updaterCode},</if>
  109. <if test="updatedate != null">updatedate = #{updatedate},</if>
  110. <if test="deptId != null">dept_id = #{deptId},</if>
  111. </trim>
  112. where id = #{id}
  113. </update>
  114. <delete id="deleteTValveNoncById" parameterType="Long">
  115. delete from t_valve_nonc where id = #{id}
  116. </delete>
  117. <delete id="deleteTValveNoncByIds" parameterType="String">
  118. delete from t_valve_nonc where id in
  119. <foreach item="id" collection="array" open="(" separator="," close=")">
  120. #{id}
  121. </foreach>
  122. </delete>
  123. </mapper>