SysAssayItemMapper.xml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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.SysAssayItemMapper">
  6. <resultMap type="SysAssayItem" id="SysAssayItemResult">
  7. <result property="assayItem" column="assay_item" />
  8. <result property="itemName" column="item_name" />
  9. </resultMap>
  10. <sql id="selectSysAssayItemVo">
  11. select assay_item, item_name from sys_assay_item
  12. </sql>
  13. <select id="selectSysAssayItemList" parameterType="SysAssayItem" resultMap="SysAssayItemResult">
  14. <include refid="selectSysAssayItemVo"/>
  15. <where>
  16. <if test="assayItem != null "> and assay_item = #{assayItem}</if>
  17. <if test="itemName != null and itemName != ''"> and item_name like concat('%', #{itemName}, '%')</if>
  18. </where>
  19. </select>
  20. <select id="selectSysAssayItemByAssayItem" parameterType="Long" resultMap="SysAssayItemResult">
  21. <include refid="selectSysAssayItemVo"/>
  22. where assay_item = #{assayItem}
  23. </select>
  24. <insert id="insertSysAssayItem" parameterType="SysAssayItem">
  25. insert into sys_assay_item
  26. <trim prefix="(" suffix=")" suffixOverrides=",">
  27. <if test="assayItem != null">assay_item,</if>
  28. <if test="itemName != null and itemName != ''">item_name,</if>
  29. </trim>
  30. <trim prefix="values (" suffix=")" suffixOverrides=",">
  31. <if test="assayItem != null">#{assayItem},</if>
  32. <if test="itemName != null and itemName != ''">#{itemName},</if>
  33. </trim>
  34. </insert>
  35. <update id="updateSysAssayItem" parameterType="SysAssayItem">
  36. update sys_assay_item
  37. <trim prefix="SET" suffixOverrides=",">
  38. <if test="itemName != null and itemName != ''">item_name = #{itemName},</if>
  39. </trim>
  40. where assay_item = #{assayItem}
  41. </update>
  42. <delete id="deleteSysAssayItemByAssayItem" parameterType="Long">
  43. delete from sys_assay_item where assay_item = #{assayItem}
  44. </delete>
  45. <delete id="deleteSysAssayItemByAssayItems" parameterType="String">
  46. delete from sys_assay_item where assay_item in
  47. <foreach item="assayItem" collection="array" open="(" separator="," close=")">
  48. #{assayItem}
  49. </foreach>
  50. </delete>
  51. </mapper>