TCheckStandardgasesMapper.xml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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.TCheckStandardgasesMapper">
  6. <resultMap type="TCheckStandardgases" id="TCheckStandardgasesResult">
  7. <result property="id" column="id" />
  8. <result property="code" column="code" />
  9. <result property="name" column="name" />
  10. <result property="concentration" column="concentration" />
  11. <result property="lifespan" column="lifespan" />
  12. <result property="factory" column="factory" />
  13. <result property="cylinderCode" column="cylinder_code" />
  14. <result property="remarks" column="remarks" />
  15. <result property="deptId" column="dept_id" />
  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="updater" column="user_name" />
  21. <result property="updatedate" column="updatedate" />
  22. <result property="describe" column="describe" />
  23. </resultMap>
  24. <sql id="selectTCheckStandardgasesVo">
  25. select id, code, name, concentration, lifespan, factory, cylinder_code, remarks, dept_id, del_flag, creater_code, createdate, updater_code, updatedate from t_check_standardgases
  26. </sql>
  27. <select id="selectTCheckStandardgasesList" parameterType="TCheckStandardgases" resultMap="TCheckStandardgasesResult">
  28. select d.*,su.user_name from t_check_standardgases d
  29. left join sys_user su on su.user_id=d.updater_code
  30. <where>
  31. <if test="code != null and code != ''"> and code = #{code}</if>
  32. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  33. <if test="concentration != null and concentration != ''"> and concentration = #{concentration}</if>
  34. <if test="lifespan != null and lifespan != ''"> and lifespan = #{lifespan}</if>
  35. <if test="factory != null and factory != ''"> and factory = #{factory}</if>
  36. <if test="cylinderCode != null and cylinderCode != ''"> and cylinder_code = #{cylinderCode}</if>
  37. <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
  38. <if test="deptId != null "> and d.dept_id = #{deptId}</if>
  39. <if test="createrCode != null "> and creater_code = #{createrCode}</if>
  40. <if test="createdate != null "> and createdate = #{createdate}</if>
  41. <if test="updaterCode != null "> and updater_code = #{updaterCode}</if>
  42. <if test="updatedate != null "> and updatedate = #{updatedate}</if>
  43. and d.del_flag = 0
  44. </where>
  45. order by d.createdate desc
  46. </select>
  47. <select id="selectAllStandardgases" resultMap="TCheckStandardgasesResult">
  48. select d.*,concat(d.name, '_',d.code) `describe`
  49. from t_check_standardgases d
  50. left join sys_dept s on d.dept_id = s.dept_id
  51. <where> and d.del_flag = 0</where>
  52. </select>
  53. <select id="selectTCheckStandardgasesById" parameterType="Long" resultMap="TCheckStandardgasesResult">
  54. <include refid="selectTCheckStandardgasesVo"/>
  55. where id = #{id}
  56. </select>
  57. <insert id="insertTCheckStandardgases" parameterType="TCheckStandardgases" useGeneratedKeys="true" keyProperty="id">
  58. insert into t_check_standardgases
  59. <trim prefix="(" suffix=")" suffixOverrides=",">
  60. <if test="code != null">code,</if>
  61. <if test="name != null">name,</if>
  62. <if test="concentration != null">concentration,</if>
  63. <if test="lifespan != null">lifespan,</if>
  64. <if test="factory != null">factory,</if>
  65. <if test="cylinderCode != null">cylinder_code,</if>
  66. <if test="remarks != null">remarks,</if>
  67. <if test="deptId != null">dept_id,</if>
  68. <if test="delFlag != null">del_flag,</if>
  69. <if test="createrCode != null">creater_code,</if>
  70. <if test="createdate != null">createdate,</if>
  71. <if test="updaterCode != null">updater_code,</if>
  72. <if test="updatedate != null">updatedate,</if>
  73. </trim>
  74. <trim prefix="values (" suffix=")" suffixOverrides=",">
  75. <if test="code != null">#{code},</if>
  76. <if test="name != null">#{name},</if>
  77. <if test="concentration != null">#{concentration},</if>
  78. <if test="lifespan != null">#{lifespan},</if>
  79. <if test="factory != null">#{factory},</if>
  80. <if test="cylinderCode != null">#{cylinderCode},</if>
  81. <if test="remarks != null">#{remarks},</if>
  82. <if test="deptId != null">#{deptId},</if>
  83. <if test="delFlag != null">#{delFlag},</if>
  84. <if test="createrCode != null">#{createrCode},</if>
  85. <if test="createdate != null">#{createdate},</if>
  86. <if test="updaterCode != null">#{updaterCode},</if>
  87. <if test="updatedate != null">#{updatedate},</if>
  88. </trim>
  89. </insert>
  90. <update id="updateTCheckStandardgases" parameterType="TCheckStandardgases">
  91. update t_check_standardgases
  92. <trim prefix="SET" suffixOverrides=",">
  93. <if test="code != null">code = #{code},</if>
  94. <if test="name != null">name = #{name},</if>
  95. <if test="concentration != null">concentration = #{concentration},</if>
  96. <if test="lifespan != null">lifespan = #{lifespan},</if>
  97. <if test="factory != null">factory = #{factory},</if>
  98. <if test="cylinderCode != null">cylinder_code = #{cylinderCode},</if>
  99. <if test="remarks != null">remarks = #{remarks},</if>
  100. <if test="deptId != null">dept_id = #{deptId},</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. </trim>
  107. where id = #{id}
  108. </update>
  109. <delete id="deleteTCheckStandardgasesById" parameterType="Long">
  110. update t_check_standardgases set del_flag=1 where id = #{id}
  111. </delete>
  112. <delete id="deleteTCheckStandardgasesByIds" parameterType="String">
  113. update t_check_standardgases set del_flag=1 where id in
  114. <foreach item="id" collection="array" open="(" separator="," close=")">
  115. #{id}
  116. </foreach>
  117. </delete>
  118. </mapper>