123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?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.ZDeviceSampleMapper">
-
- <resultMap type="ZDeviceSample" id="ZDeviceSampleResult">
- <result property="sampleId" column="sample_id" />
- <result property="deviceNo" column="device_no" />
- <result property="assayType" column="assay_type" />
- <result property="itemName" column="item_name" />
- <result property="createBy" column="create_by" />
- <result property="createTime" column="create_time" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- </resultMap>
- <sql id="selectZDeviceSampleVo">
- select sample_id, device_no, assay_type, item_name, create_by, create_time, update_by, update_time from z_device_sample
- </sql>
- <select id="selectZDeviceSampleList" parameterType="ZDeviceSample" resultMap="ZDeviceSampleResult">
- <include refid="selectZDeviceSampleVo"/>
- <where>
- <if test="deviceNo != null and deviceNo != ''"> and device_no = #{deviceNo}</if>
- <if test="assayType != null and assayType != ''"> and assay_type = #{assayType}</if>
- <if test="itemName != null and itemName != ''"> and item_name like concat('%', #{itemName}, '%')</if>
- </where>
- </select>
-
- <select id="selectZDeviceSampleBySampleId" parameterType="Long" resultMap="ZDeviceSampleResult">
- <include refid="selectZDeviceSampleVo"/>
- where sample_id = #{sampleId}
- </select>
- <insert id="insertZDeviceSample" parameterType="ZDeviceSample">
- insert into z_device_sample
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="sampleId != null">sample_id,</if>
- <if test="deviceNo != null">device_no,</if>
- <if test="assayType != null">assay_type,</if>
- <if test="itemName != null">item_name,</if>
- <if test="createBy != null">create_by,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="updateTime != null">update_time,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="sampleId != null">#{sampleId},</if>
- <if test="deviceNo != null">#{deviceNo},</if>
- <if test="assayType != null">#{assayType},</if>
- <if test="itemName != null">#{itemName},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="updateTime != null">#{updateTime},</if>
- </trim>
- </insert>
- <update id="updateZDeviceSample" parameterType="ZDeviceSample">
- update z_device_sample
- <trim prefix="SET" suffixOverrides=",">
- <if test="deviceNo != null">device_no = #{deviceNo},</if>
- <if test="assayType != null">assay_type = #{assayType},</if>
- <if test="itemName != null">item_name = #{itemName},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- </trim>
- where sample_id = #{sampleId}
- </update>
- <delete id="deleteZDeviceSampleBySampleId" parameterType="Long">
- delete from z_device_sample where sample_id = #{sampleId}
- </delete>
- <delete id="deleteZDeviceSampleBySampleIds" parameterType="String">
- delete from z_device_sample where sample_id in
- <foreach item="sampleId" collection="array" open="(" separator="," close=")">
- #{sampleId}
- </foreach>
- </delete>
- </mapper>
|