<?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.DangerousEncodeMapper">
|
|
<resultMap id="BaseResultMap" type="com.nanometer.smartlab.entity.DangerousEncode">
|
<!-- -->
|
<id column="id" property="id" />
|
<result column="container_number" jdbcType="VARCHAR" property="containerNumber" />
|
<result column="reagent_code" jdbcType="VARCHAR" property="reagentCode" />
|
<result column="reagent_name" jdbcType="VARCHAR" property="reagentName" />
|
<result column="cas" jdbcType="VARCHAR" property="cas" />
|
<result column="memo" jdbcType="VARCHAR" property="memo" />
|
<result column="property" jdbcType="VARCHAR" property="property" />
|
<result column="feature" jdbcType="VARCHAR" property="feature" />
|
<result column="avoid" jdbcType="VARCHAR" property="avoid" />
|
<result column="status" jdbcType="VARCHAR" property="status" />
|
<result column="fire" jdbcType="VARCHAR" property="fire" />
|
<result column="random" jdbcType="VARCHAR" property="random" />
|
<result column="code" jdbcType="VARCHAR" property="code" />
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
<result column="creator" jdbcType="VARCHAR" property="creator" />
|
<result column="count" jdbcType="INTEGER" property="count" />
|
</resultMap>
|
<sql id="Base_Column_List">
|
<!-- -->
|
id, container_number, reagent_code, reagent_name, cas, memo, property, feature, avoid,
|
status, fire, random, code, update_time, creator, count
|
</sql>
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap">
|
<!-- -->
|
select
|
<include refid="Base_Column_List" />
|
from sys_dangerous_encode
|
where id = #{id,jdbcType=BIGINT}
|
</select>
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
<!-- -->
|
delete from sys_dangerous_encode
|
where id = #{id,jdbcType=BIGINT}
|
</delete>
|
<insert id="insert" parameterType="com.nanometer.smartlab.entity.DangerousEncode" useGeneratedKeys = "true" keyProperty = "id">
|
<!-- -->
|
insert into sys_dangerous_encode ( container_number, reagent_code,
|
reagent_name, cas, memo,
|
property, feature, avoid,
|
status, fire, random,
|
code, update_time, creator,
|
count)
|
values ( #{containerNumber,jdbcType=VARCHAR}, #{reagentCode,jdbcType=VARCHAR},
|
#{reagentName,jdbcType=VARCHAR}, #{cas,jdbcType=VARCHAR}, #{memo,jdbcType=VARCHAR},
|
#{property,jdbcType=VARCHAR}, #{feature,jdbcType=VARCHAR}, #{avoid,jdbcType=VARCHAR},
|
#{status,jdbcType=VARCHAR}, #{fire,jdbcType=VARCHAR}, #{random,jdbcType=VARCHAR},
|
#{code,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{creator,jdbcType=VARCHAR},
|
#{count,jdbcType=INTEGER})
|
</insert>
|
<insert id="insertSelective" parameterType="com.nanometer.smartlab.entity.DangerousEncode" useGeneratedKeys = "true" keyProperty = "id">
|
<!-- -->
|
insert into sys_dangerous_encode
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="containerNumber != null">
|
container_number,
|
</if>
|
<if test="reagentCode != null">
|
reagent_code,
|
</if>
|
<if test="reagentName != null">
|
reagent_name,
|
</if>
|
<if test="cas != null">
|
cas,
|
</if>
|
<if test="memo != null">
|
memo,
|
</if>
|
<if test="property != null">
|
property,
|
</if>
|
<if test="feature != null">
|
feature,
|
</if>
|
<if test="avoid != null">
|
avoid,
|
</if>
|
<if test="status != null">
|
status,
|
</if>
|
<if test="fire != null">
|
fire,
|
</if>
|
<if test="random != null">
|
random,
|
</if>
|
<if test="code != null">
|
code,
|
</if>
|
<if test="updateTime != null">
|
update_time,
|
</if>
|
<if test="creator != null">
|
creator,
|
</if>
|
<if test="count != null">
|
count,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="containerNumber != null">
|
#{containerNumber,jdbcType=VARCHAR},
|
</if>
|
<if test="reagentCode != null">
|
#{reagentCode,jdbcType=VARCHAR},
|
</if>
|
<if test="reagentName != null">
|
#{reagentName,jdbcType=VARCHAR},
|
</if>
|
<if test="cas != null">
|
#{cas,jdbcType=VARCHAR},
|
</if>
|
<if test="memo != null">
|
#{memo,jdbcType=VARCHAR},
|
</if>
|
<if test="property != null">
|
#{property,jdbcType=VARCHAR},
|
</if>
|
<if test="feature != null">
|
#{feature,jdbcType=VARCHAR},
|
</if>
|
<if test="avoid != null">
|
#{avoid,jdbcType=VARCHAR},
|
</if>
|
<if test="status != null">
|
#{status,jdbcType=VARCHAR},
|
</if>
|
<if test="fire != null">
|
#{fire,jdbcType=VARCHAR},
|
</if>
|
<if test="random != null">
|
#{random,jdbcType=VARCHAR},
|
</if>
|
<if test="code != null">
|
#{code,jdbcType=VARCHAR},
|
</if>
|
<if test="updateTime != null">
|
#{updateTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="creator != null">
|
#{creator,jdbcType=VARCHAR},
|
</if>
|
<if test="count != null">
|
#{count,jdbcType=INTEGER},
|
</if>
|
</trim>
|
</insert>
|
<update id="updateByPrimaryKeySelective" parameterType="com.nanometer.smartlab.entity.DangerousEncode">
|
<!-- -->
|
update sys_dangerous_encode
|
<set>
|
<if test="containerNumber != null">
|
container_number = #{containerNumber,jdbcType=VARCHAR},
|
</if>
|
<if test="reagentCode != null">
|
reagent_code = #{reagentCode,jdbcType=VARCHAR},
|
</if>
|
<if test="reagentName != null">
|
reagent_name = #{reagentName,jdbcType=VARCHAR},
|
</if>
|
<if test="cas != null">
|
cas = #{cas,jdbcType=VARCHAR},
|
</if>
|
<if test="memo != null">
|
memo = #{memo,jdbcType=VARCHAR},
|
</if>
|
<if test="property != null">
|
property = #{property,jdbcType=VARCHAR},
|
</if>
|
<if test="feature != null">
|
feature = #{feature,jdbcType=VARCHAR},
|
</if>
|
<if test="avoid != null">
|
avoid = #{avoid,jdbcType=VARCHAR},
|
</if>
|
<if test="status != null">
|
status = #{status,jdbcType=VARCHAR},
|
</if>
|
<if test="fire != null">
|
fire = #{fire,jdbcType=VARCHAR},
|
</if>
|
<if test="random != null">
|
random = #{random,jdbcType=VARCHAR},
|
</if>
|
<if test="code != null">
|
code = #{code,jdbcType=VARCHAR},
|
</if>
|
<if test="updateTime != null">
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="creator != null">
|
creator = #{creator,jdbcType=VARCHAR},
|
</if>
|
<if test="count != null">
|
count = #{count,jdbcType=INTEGER},
|
</if>
|
</set>
|
where id = #{id,jdbcType=BIGINT}
|
</update>
|
<update id="updateByPrimaryKey" parameterType="com.nanometer.smartlab.entity.DangerousEncode">
|
<!-- -->
|
update sys_dangerous_encode
|
set container_number = #{containerNumber,jdbcType=VARCHAR},
|
reagent_code = #{reagentCode,jdbcType=VARCHAR},
|
reagent_name = #{reagentName,jdbcType=VARCHAR},
|
cas = #{cas,jdbcType=VARCHAR},
|
memo = #{memo,jdbcType=VARCHAR},
|
property = #{property,jdbcType=VARCHAR},
|
feature = #{feature,jdbcType=VARCHAR},
|
avoid = #{avoid,jdbcType=VARCHAR},
|
status = #{status,jdbcType=VARCHAR},
|
fire = #{fire,jdbcType=VARCHAR},
|
random = #{random,jdbcType=VARCHAR},
|
code = #{code,jdbcType=VARCHAR},
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
creator = #{creator,jdbcType=VARCHAR},
|
count = #{count,jdbcType=INTEGER}
|
where id = #{id,jdbcType=BIGINT}
|
</update>
|
|
<select id="selectAll" parameterType="java.util.Map" resultMap="BaseResultMap">
|
select
|
<include refid="Base_Column_List" />
|
from sys_dangerous_encode
|
<where>
|
1=1
|
<if test="reagentName !=null and reagentName != ''">
|
and reagent_name like concat("%",#{reagentName},"%")
|
</if>
|
<if test="cas !=null and cas != ''">
|
and cas like concat("%",#{cas},"%")
|
</if>
|
<if test="reagentCode!=null and reagentCode != ''">
|
and reagent_code like concat("%",#{reagentCode},"%")
|
</if>
|
<if test="containerNumber !=null and containerNumber != ''">
|
and container_number like concat("%",#{containerNumber},"%")
|
</if>
|
</where>
|
order by update_time desc
|
<if test="offset !=null and pageSize != null">
|
limit #{offset},#{pageSize}
|
</if>
|
</select>
|
|
<select id="countAll" parameterType="java.util.Map" resultType="java.lang.Integer">
|
select count(1)
|
from sys_dangerous_encode
|
<where>
|
1=1
|
<if test="reagentName !=null and reagentName != ''">
|
and reagent_name like concat("%",#{reagentName},"%")
|
</if>
|
<if test="cas !=null and cas != ''">
|
and cas like concat("%",#{cas},"%")
|
</if>
|
<if test="reagentCode!=null and reagentCode != ''">
|
and reagent_code like concat("%",#{reagentCode},"%")
|
</if>
|
<if test="containerNumber !=null and containerNumber != ''">
|
and container_number like concat("%",#{containerNumber},"%")
|
</if>
|
</where>
|
</select>
|
|
<select id="selectExportList" parameterType="java.util.Map" resultType="java.util.Map">
|
select
|
container_number containerNumber, reagent_code reagentCode, reagent_name reagentName, cas, memo, property, feature, avoid,
|
status, fire, random, code, update_time, creator, count
|
from sys_dangerous_encode
|
<where>
|
1=1
|
<if test="reagentName !=null and reagentName != ''">
|
and reagent_name like concat("%",#{reagentName},"%")
|
</if>
|
<if test="cas !=null and cas != ''">
|
and cas like concat("%",#{cas},"%")
|
</if>
|
<if test="reagentCode!=null and reagentCode != ''">
|
and reagent_code like concat("%",#{reagentCode},"%")
|
</if>
|
<if test="containerNumber !=null and containerNumber != ''">
|
and container_number like concat("%",#{containerNumber},"%")
|
</if>
|
</where>
|
</select>
|
<select id="selectByCodeAndName" resultType="com.nanometer.smartlab.entity.DangerousEncode">
|
select
|
id,
|
container_number containerNumber, reagent_code reagentCode, reagent_name reagentName, cas, memo, property, feature, avoid,
|
status, fire, random, code, update_time, creator, count
|
from sys_dangerous_encode
|
<where>
|
1=1
|
<if test="reagentcode != null and reagentcode != ''">
|
and reagent_code = #{reagentcode}
|
</if>
|
<if test="reagentname != null and reagentname != ''">
|
and reagent_name = #{reagentname}
|
</if>
|
<if test="cas != null and cas != ''">
|
and cas like concat("%",#{cas},"%")
|
</if>
|
<if test="code != null and code != ''">
|
and code = #{code}
|
</if>
|
</where>
|
</select>
|
<select id="selectByReagentName" resultMap="BaseResultMap">
|
select
|
container_number containerNumber, reagent_code reagentCode, reagent_name reagentName, cas, memo, property, feature, avoid,
|
status, fire, random, code, update_time, creator, count
|
from sys_dangerous_encode
|
<where>
|
1=1
|
<if test="reagentname != null and reagentname != ''">
|
and reagent_name like concat("%",#{reagentname},"%")
|
</if>
|
<if test="cas != null and cas != ''">
|
and cas like concat("%",#{cas},"%")
|
</if>
|
</where>
|
</select>
|
<select id="selectByName" resultMap="BaseResultMap">
|
select
|
id,container_number, reagent_code, reagent_name, cas, memo,
|
property, feature, avoid, status, fire, random, code, update_time, creator, count
|
from sys_dangerous_encode
|
<where>
|
1=1 and reagent_name = #{reagentname}
|
</where>
|
</select>
|
<select id="selectById" resultType="com.nanometer.smartlab.entity.DangerousEncode">
|
select
|
id,container_number containerNumber, reagent_code reagentCode, reagent_name reagentName, cas, memo,
|
property, feature, avoid, status, fire, random, code, update_time, creator, count
|
from sys_dangerous_encode
|
where id = #{id}
|
</select>
|
</mapper>
|