From 47a751cb301d05276ae5d75145d57b2d090fe4e1 Mon Sep 17 00:00:00 2001
From: kongzy <kongzy>
Date: 星期一, 01 七月 2024 10:58:35 +0800
Subject: [PATCH] change

---
 src/main/java/com/nanometer/smartlab/dao/DangerousEncodeMapper.xml |   55 +++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 41 insertions(+), 14 deletions(-)

diff --git a/src/main/java/com/nanometer/smartlab/dao/DangerousEncodeMapper.xml b/src/main/java/com/nanometer/smartlab/dao/DangerousEncodeMapper.xml
index 84d2724..97b497c 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="BIGINT" property="id" />
+    <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" />
@@ -26,7 +26,7 @@
     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 id="selectByPrimaryKey"  resultMap="BaseResultMap">
     <!--          -->
     select
     <include refid="Base_Column_List" />
@@ -38,28 +38,25 @@
     delete from sys_dangerous_encode
     where id = #{id,jdbcType=BIGINT}
   </delete>
-  <insert id="insert" parameterType="com.nanometer.smartlab.entity.DangerousEncode">
+  <insert id="insert" parameterType="com.nanometer.smartlab.entity.DangerousEncode" useGeneratedKeys = "true" keyProperty = "id">
     <!--          -->
-    insert into sys_dangerous_encode (id, container_number, reagent_code,
+    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 (#{id,jdbcType=BIGINT}, #{containerNumber,jdbcType=VARCHAR}, #{reagentCode,jdbcType=VARCHAR},
+    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">
+  <insert id="insertSelective" parameterType="com.nanometer.smartlab.entity.DangerousEncode" useGeneratedKeys = "true" keyProperty = "id">
     <!--          -->
     insert into sys_dangerous_encode
     <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        id,
-      </if>
       <if test="containerNumber != null">
         container_number,
       </if>
@@ -107,9 +104,6 @@
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        #{id,jdbcType=BIGINT},
-      </if>
       <if test="containerNumber != null">
         #{containerNumber,jdbcType=VARCHAR},
       </if>
@@ -298,7 +292,9 @@
   </select>
   <select id="selectByCodeAndName" resultType="com.nanometer.smartlab.entity.DangerousEncode">
     select
-    <include refid="Base_Column_List" />
+    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
@@ -309,11 +305,42 @@
         and reagent_name =  #{reagentname}
       </if>
       <if test="cas != null and cas != ''">
-        and cas = #{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>

--
Gitblit v1.9.2