1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.robot.remote.smartrobotremote.mapper.SysAssayItemMapper">
-
- <resultMap type="SysAssayItem" id="SysAssayItemResult">
- <result property="assayItem" column="assay_item" />
- <result property="itemName" column="item_name" />
- </resultMap>
- <sql id="selectSysAssayItemVo">
- select assay_item, item_name from sys_assay_item
- </sql>
- <select id="selectSysAssayItemList" parameterType="SysAssayItem" resultMap="SysAssayItemResult">
- <include refid="selectSysAssayItemVo"/>
- <where>
- <if test="assayItem != null "> and assay_item = #{assayItem}</if>
- <if test="itemName != null and itemName != ''"> and item_name like concat('%', #{itemName}, '%')</if>
- </where>
- </select>
-
- <select id="selectSysAssayItemByAssayItem" parameterType="Long" resultMap="SysAssayItemResult">
- <include refid="selectSysAssayItemVo"/>
- where assay_item = #{assayItem}
- </select>
- <insert id="insertSysAssayItem" parameterType="SysAssayItem">
- insert into sys_assay_item
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="assayItem != null">assay_item,</if>
- <if test="itemName != null and itemName != ''">item_name,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="assayItem != null">#{assayItem},</if>
- <if test="itemName != null and itemName != ''">#{itemName},</if>
- </trim>
- </insert>
- <update id="updateSysAssayItem" parameterType="SysAssayItem">
- update sys_assay_item
- <trim prefix="SET" suffixOverrides=",">
- <if test="itemName != null and itemName != ''">item_name = #{itemName},</if>
- </trim>
- where assay_item = #{assayItem}
- </update>
- <delete id="deleteSysAssayItemByAssayItem" parameterType="Long">
- delete from sys_assay_item where assay_item = #{assayItem}
- </delete>
- <delete id="deleteSysAssayItemByAssayItems" parameterType="String">
- delete from sys_assay_item where assay_item in
- <foreach item="assayItem" collection="array" open="(" separator="," close=")">
- #{assayItem}
- </foreach>
- </delete>
- </mapper>
|