中国算力平台算力登记系统2.0
yanzhaofeige
5 days ago 1d25094b9f0e339d784e6f1b17c95c88c272dd45
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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>