From 37f8463032c06236bfd098133c31cda51217b00f Mon Sep 17 00:00:00 2001
From: yanzhaofeige <yanzhaofeige@qq.com>
Date: Wed, 09 Oct 2024 23:08:37 +0800
Subject: [PATCH] 数据中心编号处理

---
 cpzidc-bis/src/main/resources/mapper/bis/IdcNoIndexMapper.xml |   66 +++++++++++++++++++++++++++++++++
 1 files changed, 66 insertions(+), 0 deletions(-)

diff --git a/cpzidc-bis/src/main/resources/mapper/bis/IdcNoIndexMapper.xml b/cpzidc-bis/src/main/resources/mapper/bis/IdcNoIndexMapper.xml
new file mode 100644
index 0000000..4be7b34
--- /dev/null
+++ b/cpzidc-bis/src/main/resources/mapper/bis/IdcNoIndexMapper.xml
@@ -0,0 +1,66 @@
+<?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.odcc.cpzidc.bis.mapper.IdcNoIndexMapper">
+    
+    <resultMap type="IdcNoIndex" id="IdcNoIndexResult">
+        <result property="id"    column="id"    />
+        <result property="telNo"    column="tel_no"    />
+        <result property="productionYear"    column="production_year"    />
+        <result property="index"    column="index"    />
+    </resultMap>
+
+    <sql id="selectIdcNoIndexVo">
+        select id, tel_no, production_year, 'index' from idc_no_index
+    </sql>
+
+    <select id="selectIdcNoIndexList" parameterType="IdcNoIndex" resultMap="IdcNoIndexResult">
+        <include refid="selectIdcNoIndexVo"/>
+        <where>  
+            <if test="telNo != null  and telNo != ''"> and tel_no = #{telNo}</if>
+            <if test="productionYear != null  and productionYear != ''"> and production_year = #{productionYear}</if>
+            <if test="index != null  and index != ''"> and 'index' = #{index}</if>
+        </where>
+    </select>
+    
+    <select id="selectIdcNoIndexById" parameterType="Long" resultMap="IdcNoIndexResult">
+        <include refid="selectIdcNoIndexVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertIdcNoIndex" parameterType="IdcNoIndex" useGeneratedKeys="true" keyProperty="id">
+        insert into idc_no_index
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="telNo != null">tel_no,</if>
+            <if test="productionYear != null">production_year,</if>
+            <if test="index != null">index,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="telNo != null">#{telNo},</if>
+            <if test="productionYear != null">#{productionYear},</if>
+            <if test="index != null">#{index},</if>
+         </trim>
+    </insert>
+
+    <update id="updateIdcNoIndex" parameterType="IdcNoIndex">
+        update idc_no_index
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="telNo != null">tel_no = #{telNo},</if>
+            <if test="productionYear != null">production_year = #{productionYear},</if>
+            <if test="index != null">index = #{index},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteIdcNoIndexById" parameterType="Long">
+        delete from idc_no_index where id = #{id}
+    </delete>
+
+    <delete id="deleteIdcNoIndexByIds" parameterType="String">
+        delete from idc_no_index where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>
\ No newline at end of file

--
Gitblit v1.9.3