地质所 沉降监测网建设项目
chenhuan
2024-05-16 0fdd42e318f51f9e3c6581473416af1cca69877f
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?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.ruoyi.third.mapper.SmsHisMapper">
    
    <resultMap type="SmsHis" id="SmsHisResult">
        <result property="id"    column="id"    />
        <result property="yhid"    column="yhid"    />
        <result property="yhmc"    column="yhmc"    />
        <result property="carrieroperator"    column="carrieroperator"    />
        <result property="phone"    column="phone"    />
        <result property="content"    column="content"    />
        <result property="returncode"    column="returncode"    />
        <result property="createTime"    column="createTime"    />
    </resultMap>
 
    <sql id="selectSmsHisVo">
        select id, yhid, yhmc, carrieroperator, phone, content, returncode, createTime from third_sms_his
    </sql>
 
    <select id="selectSmsHisList" parameterType="SmsHis" resultMap="SmsHisResult">
        <include refid="selectSmsHisVo"/>
        <where>  
            <if test="yhid != null  and yhid != ''"> and yhid = #{yhid}</if>
            <if test="yhmc != null  and yhmc != ''"> and yhmc = #{yhmc}</if>
            <if test="carrieroperator != null  and carrieroperator != ''"> and carrieroperator = #{carrieroperator}</if>
            <if test="phone != null  and phone != ''"> and phone = #{phone}</if>
            <if test="content != null  and content != ''"> and content = #{content}</if>
            <if test="returncode != null  and returncode != ''"> and returncode = #{returncode}</if>
            <if test="createTime != null "> and createTime &gt; #{createTime}</if>
        </where>
        order by createTime desc
    </select>
    
    <select id="selectSmsHisById" parameterType="Long" resultMap="SmsHisResult">
        <include refid="selectSmsHisVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertSmsHis" parameterType="SmsHis" useGeneratedKeys="true" keyProperty="id">
        insert into third_sms_his
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="yhid != null  and yhid != ''">yhid,</if>
            <if test="yhmc != null  and yhmc != ''">yhmc,</if>
            <if test="carrieroperator != null  and carrieroperator != ''">carrieroperator,</if>
            <if test="phone != null  and phone != ''">phone,</if>
            <if test="content != null  and content != ''">content,</if>
            <if test="returncode != null  and returncode != ''">returncode,</if>
            createTime,
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="yhid != null  and yhid != ''">#{yhid},</if>
            <if test="yhmc != null  and yhmc != ''">#{yhmc},</if>
            <if test="carrieroperator != null  and carrieroperator != ''">#{carrieroperator},</if>
            <if test="phone != null  and phone != ''">#{phone},</if>
            <if test="content != null  and content != ''">#{content},</if>
            <if test="returncode != null  and returncode != ''">#{returncode},</if>
            now()
         </trim>
    </insert>
 
    <update id="updateSmsHis" parameterType="SmsHis">
        update third_sms_his
        <trim prefix="SET" suffixOverrides=",">
            <if test="yhid != null  and yhid != ''">yhid = #{yhid},</if>
            <if test="yhmc != null  and yhmc != ''">yhmc = #{yhmc},</if>
            <if test="carrieroperator != null  and carrieroperator != ''">carrieroperator = #{carrieroperator},</if>
            <if test="phone != null  and phone != ''">phone = #{phone},</if>
            <if test="content != null  and content != ''">content = #{content},</if>
            <if test="returncode != null  and returncode != ''">returncode = #{returncode},</if>
            <if test="createTime != null ">createTime = #{createTime},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteSmsHisById" parameterType="Long">
        delete from third_sms_his where id = #{id}
    </delete>
 
    <delete id="deleteSmsHisByIds" parameterType="String">
        delete from third_sms_his where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
    
</mapper>