中国算力平台算力登记系统2.0
yanzhaofeige
5 days ago 1d25094b9f0e339d784e6f1b17c95c88c272dd45
commit | author | age
1d2509 1 <?xml version="1.0" encoding="UTF-8" ?>
Y 2 <!DOCTYPE mapper
3 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5 <mapper namespace="com.odcc.cpzidc.bis.mapper.IdcNoIndexMapper">
6     
7     <resultMap type="IdcNoIndex" id="IdcNoIndexResult">
8         <result property="id"    column="id"    />
9         <result property="telNo"    column="tel_no"    />
10         <result property="productionYear"    column="production_year"    />
11         <result property="index"    column="index"    />
12     </resultMap>
13
14     <sql id="selectIdcNoIndexVo">
15         select id, tel_no, production_year, index from idc_no_index
16     </sql>
17
18     <select id="selectIdcNoIndexList" parameterType="IdcNoIndex" resultMap="IdcNoIndexResult">
19         <include refid="selectIdcNoIndexVo"/>
20         <where>  
21             <if test="telNo != null  and telNo != ''"> and tel_no = #{telNo}</if>
22             <if test="productionYear != null  and productionYear != ''"> and production_year = #{productionYear}</if>
23             <if test="index != null  and index != ''"> and index = #{index}</if>
24         </where>
25     </select>
26     
27     <select id="selectIdcNoIndexById" parameterType="Long" resultMap="IdcNoIndexResult">
28         <include refid="selectIdcNoIndexVo"/>
29         where id = #{id}
30     </select>
31
32     <insert id="insertIdcNoIndex" parameterType="IdcNoIndex" useGeneratedKeys="true" keyProperty="id">
33         insert into idc_no_index
34         <trim prefix="(" suffix=")" suffixOverrides=",">
35             <if test="telNo != null">tel_no,</if>
36             <if test="productionYear != null">production_year,</if>
37             <if test="index != null">index,</if>
38          </trim>
39         <trim prefix="values (" suffix=")" suffixOverrides=",">
40             <if test="telNo != null">#{telNo},</if>
41             <if test="productionYear != null">#{productionYear},</if>
42             <if test="index != null">#{index},</if>
43          </trim>
44     </insert>
45
46     <update id="updateIdcNoIndex" parameterType="IdcNoIndex">
47         update idc_no_index
48         <trim prefix="SET" suffixOverrides=",">
49             <if test="telNo != null">tel_no = #{telNo},</if>
50             <if test="productionYear != null">production_year = #{productionYear},</if>
51             <if test="index != null">index = #{index},</if>
52         </trim>
53         where id = #{id}
54     </update>
55
56     <delete id="deleteIdcNoIndexById" parameterType="Long">
57         delete from idc_no_index where id = #{id}
58     </delete>
59
60     <delete id="deleteIdcNoIndexByIds" parameterType="String">
61         delete from idc_no_index where id in 
62         <foreach item="id" collection="array" open="(" separator="," close=")">
63             #{id}
64         </foreach>
65     </delete>
66 </mapper>