MonitorMailConfigMapper.xml
4.01 KB
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
<?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.lhcredit.project.business.monitorMailConfig.mapper.MonitorMailConfigMapper">
<resultMap type="MonitorMailConfig" id="MonitorMailConfigResult">
<result property="id" column="id" />
<result property="mail" column="mail" />
<result property="dateType" column="date_type" />
<result property="types" column="types" />
<result property="platform" column="platform" />
<result property="updateTime" column="update_time" />
<result property="status" column="status" />
</resultMap>
<sql id="selectMonitorMailConfigVo">
select id, mail, date_type, types, platform, update_time, status from monitor_mail_config
</sql>
<select id="selectMonitorMailConfigList" parameterType="MonitorMailConfig" resultMap="MonitorMailConfigResult">
<include refid="selectMonitorMailConfigVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="mail != null and mail != '' "> and mail = #{mail}</if>
<if test="dateType != null and dateType != '' "> and date_type = #{dateType}</if>
<if test="types != null and types != '' "> and types = #{types}</if>
<if test="platform != null and platform != '' "> and platform = #{platform}</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
<if test="status != null and status != '' "> and status = #{status}</if>
</where>
</select>
<select id="selectMonitorMailConfigById" parameterType="Integer" resultMap="MonitorMailConfigResult">
<include refid="selectMonitorMailConfigVo"/>
where id = #{id}
</select>
<insert id="insertMonitorMailConfig" parameterType="MonitorMailConfig" useGeneratedKeys="true" keyProperty="id">
insert into monitor_mail_config
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="mail != null and mail != '' ">mail,</if>
<if test="dateType != null and dateType != '' ">date_type,</if>
<if test="types != null and types != '' ">types,</if>
<if test="platform != null and platform != '' ">platform,</if>
<if test="updateTime != null ">update_time,</if>
<if test="status != null and status != '' ">status,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="mail != null and mail != '' ">#{mail},</if>
<if test="dateType != null and dateType != '' ">#{dateType},</if>
<if test="types != null and types != '' ">#{types},</if>
<if test="platform != null and platform != '' ">#{platform},</if>
<if test="updateTime != null ">#{updateTime},</if>
<if test="status != null and status != '' ">#{status},</if>
</trim>
</insert>
<update id="updateMonitorMailConfig" parameterType="MonitorMailConfig">
update monitor_mail_config
<trim prefix="SET" suffixOverrides=",">
<if test="mail != null and mail != '' ">mail = #{mail},</if>
<if test="dateType != null and dateType != '' ">date_type = #{dateType},</if>
<if test="types != null and types != '' ">types = #{types},</if>
<if test="platform != null and platform != '' ">platform = #{platform},</if>
<if test="updateTime != null ">update_time = #{updateTime},</if>
<if test="status != null and status != '' ">status = #{status},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteMonitorMailConfigById" parameterType="Integer">
delete from monitor_mail_config where id = #{id}
</delete>
<delete id="deleteMonitorMailConfigByIds" parameterType="String">
delete from monitor_mail_config where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>