<?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.nanometer.smartlab.dao.OpeLaboratoryReserveDao">
|
<resultMap id="OpeLaboratoryReserve" type="com.nanometer.smartlab.entity.OpeLaboratoryReserve">
|
<id property="id" column="id"/>
|
<result property="reagentId" column="reagent_id"></result>
|
<result property="articleNumber" column="article_number"></result>
|
<result property="reserve" column="reserve"></result>
|
<result property="updateTime" column="update_time"></result>
|
<result property="validFlag" column="valid_flag" typeHandler="com.nanometer.smartlab.entity.handler.ValidFlagHandler"></result>
|
<result property="userId" column="user_id"></result>
|
<result property="houseId" column="house_id"></result>
|
<result property="containerId" column="container_id"></result>
|
</resultMap>
|
|
<insert id="insertOpeLaboratoryReserve" parameterType="com.nanometer.smartlab.entity.OpeLaboratoryReserve" useGeneratedKeys = "true" keyProperty = "id">
|
insert into ope_laboratory_reserve( reagent_id, article_number,reserve, valid_flag, update_time,user_id,house_id,container_id)
|
values (#{reagentId},#{articleNumber},#{reserve},#{validFlag},now(),#{userId},#{houseId},#{containerId})
|
</insert>
|
|
<insert id="batchInsert">
|
insert into ope_laboratory_reserve( reagent_id, article_number,reserve, valid_flag, user_id,house_id,container_id)
|
values
|
<foreach collection="list" item="item" separator=",">
|
(#{item.reagentId},#{item.articleNumber},#{item.reserve},#{item.validFlag},#{item.userId},#{item.houseId},#{item.containerId})
|
</foreach>
|
</insert>
|
|
<select id="selectByReId" resultMap="OpeLaboratoryReserve">
|
select * from ope_laboratory_reserve where reagent_id=#{id}
|
</select>
|
|
<update id="updateByReId" parameterType="java.util.Map">
|
update ope_laboratory_reserve set reagent_id=#{newReId} where reagent_id=#{oldReId}
|
</update>
|
<update id="updateByReagent">
|
update ope_laboratory_reserve
|
set valid_flag = 0
|
where reagent_id=#{reagentId}
|
and house_id = #{houseId}
|
and container_id = #{containerId}
|
and user_id = #{userId}
|
and valid_flag = 1
|
</update>
|
</mapper>
|