From 12862728f6123b2a9a927f6bad97317bc651d8c2 Mon Sep 17 00:00:00 2001
From: 李宇 <986321569@qq.com>
Date: 星期五, 23 四月 2021 15:43:39 +0800
Subject: [PATCH] 修改领用
---
src/main/java/com/nanometer/smartlab/dao/DangerousEncodeMapper.xml | 120 +++++++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 87 insertions(+), 33 deletions(-)
diff --git a/src/main/java/com/nanometer/smartlab/dao/DangerousEncodeMapper.xml b/src/main/java/com/nanometer/smartlab/dao/DangerousEncodeMapper.xml
index 5bb352b..f5678c9 100644
--- a/src/main/java/com/nanometer/smartlab/dao/DangerousEncodeMapper.xml
+++ b/src/main/java/com/nanometer/smartlab/dao/DangerousEncodeMapper.xml
@@ -4,7 +4,7 @@
<resultMap id="BaseResultMap" type="com.nanometer.smartlab.entity.DangerousEncode">
<!-- -->
- <id column="id" jdbcType="VARCHAR" property="id" />
+ <id column="id" jdbcType="BIGINT" 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" />
@@ -23,34 +23,34 @@
</resultMap>
<sql id="Base_Column_List">
<!-- -->
- id, container_number, reagent_code, reagent_name, cas, memo, property, feature, avoid,
+ id, container_number, reagent_code, reagent_name, cas, memo, property, feature, avoid,
status, fire, random, code, update_time, creator, count
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!-- -->
- select
+ select
<include refid="Base_Column_List" />
from sys_dangerous_encode
- where id = #{id,jdbcType=VARCHAR}
+ where id = #{id,jdbcType=BIGINT}
</select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
<!-- -->
delete from sys_dangerous_encode
- where id = #{id,jdbcType=VARCHAR}
+ where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.nanometer.smartlab.entity.DangerousEncode">
<!-- -->
- insert into sys_dangerous_encode (id, container_number, reagent_code,
- reagent_name, cas, memo,
- property, feature, avoid,
- status, fire, random,
- code, update_time, creator,
+ insert into sys_dangerous_encode (id, container_number, reagent_code,
+ reagent_name, cas, memo,
+ property, feature, avoid,
+ status, fire, random,
+ code, update_time, creator,
count)
- values (#{id,jdbcType=VARCHAR}, #{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},
+ values (#{id,jdbcType=BIGINT}, #{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">
@@ -108,7 +108,7 @@
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
- #{id,jdbcType=VARCHAR},
+ #{id,jdbcType=BIGINT},
</if>
<if test="containerNumber != null">
#{containerNumber,jdbcType=VARCHAR},
@@ -207,7 +207,7 @@
count = #{count,jdbcType=INTEGER},
</if>
</set>
- where id = #{id,jdbcType=VARCHAR}
+ where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.nanometer.smartlab.entity.DangerousEncode">
<!-- -->
@@ -227,7 +227,7 @@
update_time = #{updateTime,jdbcType=TIMESTAMP},
creator = #{creator,jdbcType=VARCHAR},
count = #{count,jdbcType=INTEGER}
- where id = #{id,jdbcType=VARCHAR}
+ where id = #{id,jdbcType=BIGINT}
</update>
<select id="selectAll" parameterType="java.util.Map" resultMap="BaseResultMap">
@@ -235,37 +235,42 @@
<include refid="Base_Column_List" />
from sys_dangerous_encode
<where>
+ 1=1
<if test="reagentName !=null and reagentName != ''">
- reagent_name like concat("%",#{reagentName},"%")
+ and reagent_name like concat("%",#{reagentName},"%")
</if>
<if test="cas !=null and cas != ''">
- cas like concat("%",#{cas},"%")
+ and cas like concat("%",#{cas},"%")
</if>
<if test="reagentCode!=null and reagentCode != ''">
- reagent_code like concat("%",#{reagentCode},"%")
+ and reagent_code like concat("%",#{reagentCode},"%")
</if>
<if test="containerNumber !=null and containerNumber != ''">
- container_number like concat("%",#{containerNumber},"%")
+ and container_number like concat("%",#{containerNumber},"%")
</if>
</where>
- order by update_time
+ 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 != ''">
- reagent_name like concat("%",#{reagentName},"%")
+ and reagent_name like concat("%",#{reagentName},"%")
</if>
<if test="cas !=null and cas != ''">
- cas like concat("%",#{cas},"%")
+ and cas like concat("%",#{cas},"%")
</if>
<if test="reagentCode!=null and reagentCode != ''">
- reagent_code like concat("%",#{reagentCode},"%")
+ and reagent_code like concat("%",#{reagentCode},"%")
</if>
<if test="containerNumber !=null and containerNumber != ''">
- container_number like concat("%",#{containerNumber},"%")
+ and container_number like concat("%",#{containerNumber},"%")
</if>
</where>
</select>
@@ -276,18 +281,67 @@
status, fire, random, code, update_time, creator, count
from sys_dangerous_encode
<where>
+ 1=1
<if test="reagentName !=null and reagentName != ''">
- reagent_name like concat("%",#{reagentName},"%")
+ and reagent_name like concat("%",#{reagentName},"%")
</if>
<if test="cas !=null and cas != ''">
- cas like concat("%",#{cas},"%")
+ and cas like concat("%",#{cas},"%")
</if>
<if test="reagentCode!=null and reagentCode != ''">
- reagent_code like concat("%",#{reagentCode},"%")
+ and reagent_code like concat("%",#{reagentCode},"%")
</if>
<if test="containerNumber !=null and containerNumber != ''">
- container_number like concat("%",#{containerNumber},"%")
+ and container_number like concat("%",#{containerNumber},"%")
</if>
</where>
</select>
-</mapper>
\ No newline at end of file
+ <select id="selectByCodeAndName" resultType="com.nanometer.smartlab.entity.DangerousEncode">
+ 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="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" resultType="com.nanometer.smartlab.entity.DangerousEncodeVo">
+ 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" 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="reagentname != null and reagentname != ''">
+ and reagent_name = #{reagentname}
+ </if>
+ </where>
+ </select>
+</mapper>
--
Gitblit v1.9.2