TCheckCalibrationMapper.xml 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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.check.mapper.TCheckCalibrationMapper">
  6. <resultMap type="TCheckCalibration" id="TCheckCalibrationResult">
  7. <result property="id" column="id" />
  8. <result property="calibrationTime" column="calibration_time" />
  9. <result property="calibrationUser" column="calibration_user" />
  10. <result property="instrumentId" column="instrument_id" />
  11. <result property="standardgasesId" column="standardgases_id" />
  12. <result property="zerogasConcentration" column="zerogas_concentration" />
  13. <result property="zerogasCalibration" column="zerogas_calibration" />
  14. <result property="standardgasesCalibration" column="standardgases_calibration" />
  15. <result property="driftCheck" column="drift_check" />
  16. <result property="filterCheck" column="filter_check" />
  17. <result property="airtightnessCheck" column="airtightness_check" />
  18. <result property="flowCheck" column="flow_check" />
  19. <result property="pressure" column="pressure" />
  20. <result property="remarks" column="remarks" />
  21. <result property="deptId" column="dept_id" />
  22. <result property="delFlag" column="del_flag" />
  23. <result property="createrCode" column="creater_code" />
  24. <result property="createdate" column="createdate" />
  25. <result property="updaterCode" column="updater_code" />
  26. <result property="updatedate" column="updatedate" />
  27. </resultMap>
  28. <sql id="selectTCheckCalibrationVo">
  29. select id, calibration_time, calibration_user, instrument_id, standardgases_id, zerogas_concentration, zerogas_calibration, standardgases_calibration, drift_check, filter_check, airtightness_check, flow_check, pressure, remarks, dept_id, del_flag, creater_code, createdate, updater_code, updatedate from t_check_calibration
  30. </sql>
  31. <select id="selectTCheckCalibrationList" parameterType="TCheckCalibration" resultMap="TCheckCalibrationResult">
  32. select d.*,ci.name instrumentName,ci.code instrumentCode,ci.model instrumentType,cs.name standardgasesName,cs.concentration standardgasesConcentration,cs.lifespan standardgasesLifespan from t_check_calibration d
  33. left join t_check_instrument ci on ci.id= d.instrument_id
  34. left join t_check_standardgases cs on cs.id=d.standardgases_id
  35. <where>
  36. <if test="calibrationTime != null "> and calibration_time = #{calibrationTime}</if>
  37. <if test="calibrationUser != null and calibrationUser != ''"> and calibration_user = #{calibrationUser}</if>
  38. <if test="instrumentId != null "> and instrument_id = #{instrumentId}</if>
  39. <if test="standardgasesId != null "> and standardgases_id = #{standardgasesId}</if>
  40. <if test="zerogasConcentration != null and zerogasConcentration != ''"> and zerogas_concentration = #{zerogasConcentration}</if>
  41. <if test="zerogasCalibration != null and zerogasCalibration != ''"> and zerogas_calibration = #{zerogasCalibration}</if>
  42. <if test="standardgasesCalibration != null and standardgasesCalibration != ''"> and standardgases_calibration = #{standardgasesCalibration}</if>
  43. <if test="driftCheck != null and driftCheck != ''"> and drift_check = #{driftCheck}</if>
  44. <if test="filterCheck != null and filterCheck != ''"> and filter_check = #{filterCheck}</if>
  45. <if test="airtightnessCheck != null and airtightnessCheck != ''"> and airtightness_check = #{airtightnessCheck}</if>
  46. <if test="flowCheck != null and flowCheck != ''"> and flow_check = #{flowCheck}</if>
  47. <if test="pressure != null and pressure != ''"> and pressure = #{pressure}</if>
  48. <if test="remarks != null and remarks != ''"> and d.remarks = #{remarks}</if>
  49. <if test="instrumentName != null and instrumentName != ''"> and ci.`name` like concat('%',#{instrumentName}, '%')</if>
  50. <if test="instrumentCode != null and instrumentCode != ''"> and ci.`code` like concat('%',#{instrumentCode}, '%')</if>
  51. <if test="deptId != null "> and d.dept_id = #{deptId}</if>
  52. <if test="createrCode != null "> and d.creater_code = #{createrCode}</if>
  53. <if test="createdate != null "> and d.createdate = #{createdate}</if>
  54. <if test="updaterCode != null "> and d.updater_code = #{updaterCode}</if>
  55. <if test="updatedate != null "> and d.updatedate = #{updatedate}</if>
  56. and d.del_flag = 0
  57. </where>
  58. order by d.createdate desc
  59. </select>
  60. <select id="selectTCheckCalibrationById" parameterType="Long" resultMap="TCheckCalibrationResult">
  61. <include refid="selectTCheckCalibrationVo"/>
  62. where id = #{id}
  63. </select>
  64. <insert id="insertTCheckCalibration" parameterType="TCheckCalibration" useGeneratedKeys="true" keyProperty="id">
  65. insert into t_check_calibration
  66. <trim prefix="(" suffix=")" suffixOverrides=",">
  67. <if test="calibrationTime != null">calibration_time,</if>
  68. <if test="calibrationUser != null">calibration_user,</if>
  69. <if test="instrumentId != null">instrument_id,</if>
  70. <if test="standardgasesId != null">standardgases_id,</if>
  71. <if test="zerogasConcentration != null">zerogas_concentration,</if>
  72. <if test="zerogasCalibration != null">zerogas_calibration,</if>
  73. <if test="standardgasesCalibration != null">standardgases_calibration,</if>
  74. <if test="driftCheck != null">drift_check,</if>
  75. <if test="filterCheck != null">filter_check,</if>
  76. <if test="airtightnessCheck != null">airtightness_check,</if>
  77. <if test="flowCheck != null">flow_check,</if>
  78. <if test="pressure != null">pressure,</if>
  79. <if test="remarks != null">remarks,</if>
  80. <if test="deptId != null">dept_id,</if>
  81. <if test="delFlag != null">del_flag,</if>
  82. <if test="createrCode != null">creater_code,</if>
  83. <if test="createdate != null">createdate,</if>
  84. <if test="updaterCode != null">updater_code,</if>
  85. <if test="updatedate != null">updatedate,</if>
  86. </trim>
  87. <trim prefix="values (" suffix=")" suffixOverrides=",">
  88. <if test="calibrationTime != null">#{calibrationTime},</if>
  89. <if test="calibrationUser != null">#{calibrationUser},</if>
  90. <if test="instrumentId != null">#{instrumentId},</if>
  91. <if test="standardgasesId != null">#{standardgasesId},</if>
  92. <if test="zerogasConcentration != null">#{zerogasConcentration},</if>
  93. <if test="zerogasCalibration != null">#{zerogasCalibration},</if>
  94. <if test="standardgasesCalibration != null">#{standardgasesCalibration},</if>
  95. <if test="driftCheck != null">#{driftCheck},</if>
  96. <if test="filterCheck != null">#{filterCheck},</if>
  97. <if test="airtightnessCheck != null">#{airtightnessCheck},</if>
  98. <if test="flowCheck != null">#{flowCheck},</if>
  99. <if test="pressure != null">#{pressure},</if>
  100. <if test="remarks != null">#{remarks},</if>
  101. <if test="deptId != null">#{deptId},</if>
  102. <if test="delFlag != null">#{delFlag},</if>
  103. <if test="createrCode != null">#{createrCode},</if>
  104. <if test="createdate != null">#{createdate},</if>
  105. <if test="updaterCode != null">#{updaterCode},</if>
  106. <if test="updatedate != null">#{updatedate},</if>
  107. </trim>
  108. </insert>
  109. <update id="updateTCheckCalibration" parameterType="TCheckCalibration">
  110. update t_check_calibration
  111. <trim prefix="SET" suffixOverrides=",">
  112. <if test="calibrationTime != null">calibration_time = #{calibrationTime},</if>
  113. <if test="calibrationUser != null">calibration_user = #{calibrationUser},</if>
  114. <if test="instrumentId != null">instrument_id = #{instrumentId},</if>
  115. <if test="standardgasesId != null">standardgases_id = #{standardgasesId},</if>
  116. <if test="zerogasConcentration != null">zerogas_concentration = #{zerogasConcentration},</if>
  117. <if test="zerogasCalibration != null">zerogas_calibration = #{zerogasCalibration},</if>
  118. <if test="standardgasesCalibration != null">standardgases_calibration = #{standardgasesCalibration},</if>
  119. <if test="driftCheck != null">drift_check = #{driftCheck},</if>
  120. <if test="filterCheck != null">filter_check = #{filterCheck},</if>
  121. <if test="airtightnessCheck != null">airtightness_check = #{airtightnessCheck},</if>
  122. <if test="flowCheck != null">flow_check = #{flowCheck},</if>
  123. <if test="pressure != null">pressure = #{pressure},</if>
  124. <if test="remarks != null">remarks = #{remarks},</if>
  125. <if test="deptId != null">dept_id = #{deptId},</if>
  126. <if test="delFlag != null">del_flag = #{delFlag},</if>
  127. <if test="createrCode != null">creater_code = #{createrCode},</if>
  128. <if test="createdate != null">createdate = #{createdate},</if>
  129. <if test="updaterCode != null">updater_code = #{updaterCode},</if>
  130. <if test="updatedate != null">updatedate = #{updatedate},</if>
  131. </trim>
  132. where id = #{id}
  133. </update>
  134. <delete id="deleteTCheckCalibrationById" parameterType="Long">
  135. update t_check_calibration set del_flag=1 where id = #{id}
  136. </delete>
  137. <delete id="deleteTCheckCalibrationByIds" parameterType="String">
  138. update t_check_calibration set del_flag=1 where id in
  139. <foreach item="id" collection="array" open="(" separator="," close=")">
  140. #{id}
  141. </foreach>
  142. </delete>
  143. </mapper>