ZQualityValueMapper.xml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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.robot.remote.smartrobotremote.mapper.ZQualityValueMapper">
  6. <resultMap type="ZQualityValue" id="ZQualityValueResult">
  7. <result property="valueId" column="value_id" />
  8. <result property="deviceWorks" column="device_works" />
  9. <result property="assayItem" column="assay_item" />
  10. <result property="resultValue" column="result_value" />
  11. <result property="createTime" column="create_time" />
  12. <result property="updateTime" column="update_time" />
  13. <result property="endTime" column="end_time" />
  14. <result property="lowValue" column="low_value" />
  15. <result property="highValue" column="high_value" />
  16. <result property="beginTime" column="begin_time" />
  17. </resultMap>
  18. <sql id="selectZQualityValueVo">
  19. select value_id, device_works, assay_item, result_value, create_time, update_time, end_time, low_value, high_value, begin_time from z_quality_value
  20. </sql>
  21. <select id="selectZQualityValueList" parameterType="ZQualityValue" resultMap="ZQualityValueResult">
  22. <include refid="selectZQualityValueVo"/>
  23. <where>
  24. <if test="deviceWorks != null "> and device_works = #{deviceWorks}</if>
  25. <if test="assayItem != null and assayItem != ''"> and assay_item = #{assayItem}</if>
  26. <if test="resultValue != null "> and result_value = #{resultValue}</if>
  27. <if test="endTime != null "> and end_time = #{endTime}</if>
  28. <if test="lowValue != null "> and low_value = #{lowValue}</if>
  29. <if test="highValue != null "> and high_value = #{highValue}</if>
  30. <if test="beginTime != null "> and begin_time = #{beginTime}</if>
  31. </where>
  32. </select>
  33. <select id="selectZQualityValueByValueId" parameterType="Long" resultMap="ZQualityValueResult">
  34. <include refid="selectZQualityValueVo"/>
  35. where value_id = #{valueId}
  36. </select>
  37. <insert id="insertZQualityValue" parameterType="ZQualityValue">
  38. insert into z_quality_value
  39. <trim prefix="(" suffix=")" suffixOverrides=",">
  40. <if test="valueId != null">value_id,</if>
  41. <if test="deviceWorks != null">device_works,</if>
  42. <if test="assayItem != null">assay_item,</if>
  43. <if test="resultValue != null">result_value,</if>
  44. <if test="createTime != null">create_time,</if>
  45. <if test="updateTime != null">update_time,</if>
  46. <if test="endTime != null">end_time,</if>
  47. <if test="lowValue != null">low_value,</if>
  48. <if test="highValue != null">high_value,</if>
  49. <if test="beginTime != null">begin_time,</if>
  50. </trim>
  51. <trim prefix="values (" suffix=")" suffixOverrides=",">
  52. <if test="valueId != null">#{valueId},</if>
  53. <if test="deviceWorks != null">#{deviceWorks},</if>
  54. <if test="assayItem != null">#{assayItem},</if>
  55. <if test="resultValue != null">#{resultValue},</if>
  56. <if test="createTime != null">#{createTime},</if>
  57. <if test="updateTime != null">#{updateTime},</if>
  58. <if test="endTime != null">#{endTime},</if>
  59. <if test="lowValue != null">#{lowValue},</if>
  60. <if test="highValue != null">#{highValue},</if>
  61. <if test="beginTime != null">#{beginTime},</if>
  62. </trim>
  63. </insert>
  64. <update id="updateZQualityValue" parameterType="ZQualityValue">
  65. update z_quality_value
  66. <trim prefix="SET" suffixOverrides=",">
  67. <if test="deviceWorks != null">device_works = #{deviceWorks},</if>
  68. <if test="assayItem != null">assay_item = #{assayItem},</if>
  69. <if test="resultValue != null">result_value = #{resultValue},</if>
  70. <if test="createTime != null">create_time = #{createTime},</if>
  71. <if test="updateTime != null">update_time = #{updateTime},</if>
  72. <if test="endTime != null">end_time = #{endTime},</if>
  73. <if test="lowValue != null">low_value = #{lowValue},</if>
  74. <if test="highValue != null">high_value = #{highValue},</if>
  75. <if test="beginTime != null">begin_time = #{beginTime},</if>
  76. </trim>
  77. where value_id = #{valueId}
  78. </update>
  79. <delete id="deleteZQualityValueByValueId" parameterType="Long">
  80. delete from z_quality_value where value_id = #{valueId}
  81. </delete>
  82. <delete id="deleteZQualityValueByValueIds" parameterType="String">
  83. delete from z_quality_value where value_id in
  84. <foreach item="valueId" collection="array" open="(" separator="," close=")">
  85. #{valueId}
  86. </foreach>
  87. </delete>
  88. </mapper>