IntelligentReminderMapper.xml
5.31 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?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="cn.com.glsx.dj.weapp.mapper.IntelligentReminderMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.weapp.model.IntelligentReminder" >
<id column="ID" property="id" jdbcType="INTEGER" />
<result column="ACCOUNT_ID" property="accountId" jdbcType="INTEGER" />
<result column="MERCHANT_ID" property="merchantId" jdbcType="INTEGER" />
<result column="MERCHANT_NAME" property="merchantName" jdbcType="VARCHAR" />
<result column="REMINDER_ID" property="reminderId" jdbcType="INTEGER" />
<result column="REMINDER_NAME" property="reminderName" jdbcType="VARCHAR" />
<result column="REMINDER_TYPE" property="reminderType" jdbcType="TINYINT" />
<result column="REMARK" property="remark" jdbcType="VARCHAR" />
<result column="SOURCE" property="source" jdbcType="TINYINT" />
<result column="CREATED_BY" property="createdBy" jdbcType="VARCHAR" />
<result column="CREATED_DATE" property="createdDate" jdbcType="TIMESTAMP" />
<result column="UPDATED_BY" property="updatedBy" jdbcType="VARCHAR" />
<result column="UPDATED_DATE" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="DELETE_FALG" property="deleteFalg" jdbcType="CHAR" />
</resultMap>
<resultMap id="ResultMapDTO" type="cn.com.glsx.dj.weapp.dto.IntelligentReminderDTO" >
<id column="ID" property="id" jdbcType="INTEGER" />
<result column="ACCOUNT_ID" property="accountId" jdbcType="INTEGER" />
<result column="MERCHANT_ID" property="merchantId" jdbcType="INTEGER" />
<result column="MERCHANT_NAME" property="merchantName" jdbcType="VARCHAR" />
<result column="REMINDER_ID" property="reminderId" jdbcType="INTEGER" />
<result column="REMINDER_NAME" property="reminderName" jdbcType="VARCHAR" />
<result column="REMINDER_TYPE" property="reminderType" jdbcType="TINYINT" />
<result column="REMARK" property="remark" jdbcType="VARCHAR" />
<result column="SOURCE" property="source" jdbcType="TINYINT" />
<result column="CREATED_BY" property="createdBy" jdbcType="VARCHAR" />
<result column="CREATED_DATE" property="createdDate" jdbcType="TIMESTAMP" />
<result column="UPDATED_BY" property="updatedBy" jdbcType="VARCHAR" />
<result column="UPDATED_DATE" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="DELETED_FLAG" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<sql id="Base_Column_List" >
ID, ACCOUNT_ID, MERCHANT_ID, MERCHANT_NAME, REMINDER_ID, REMINDER_NAME, REMINDER_TYPE,
REMARK, SOURCE, CREATED_BY, CREATED_DATE, UPDATED_BY,UPDATED_DATE, DELETED_FLAG
</sql>
<select id="selectByCondition" parameterType="java.util.HashMap" resultMap="ResultMapDTO">
SELECT
<include refid="Base_Column_List" />
FROM dj_intelligent_reminder
WHERE 1=1
<if test="accountId != null">
AND ACCOUNT_ID = #{accountId,jdbcType=INTEGER}
</if>
<if test="merchantId != null">
AND MERCHANT_ID = #{merchantId,jdbcType=INTEGER}
</if>
AND DELETED_FLAG = 'N'
ORDER BY UPDATED_DATE DESC
</select>
<insert id="insertReminder" parameterType="cn.com.glsx.dj.weapp.model.IntelligentReminder">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
INSERT INTO dj_intelligent_reminder (ACCOUNT_ID, MERCHANT_ID, MERCHANT_NAME,REMINDER_ID,REMINDER_NAME,
REMINDER_TYPE,REMARK,SOURCE,CREATED_BY,CREATED_DATE,UPDATED_BY,UPDATED_DATE,DELETED_FLAG
)
VALUES (#{accountId,jdbcType=INTEGER}, #{merchantId,jdbcType=INTEGER}, #{merchantName,jdbcType=VARCHAR},
#{reminderId,jdbcType=INTEGER},#{reminderName,jdbcType=VARCHAR},#{reminderType,jdbcType=TINYINT},
#{remark,jdbcType=VARCHAR},#{source,jdbcType=TINYINT},
#{createdBy,jdbcType=VARCHAR}, NOW(),#{updatedBy,jdbcType=VARCHAR}, NOW(), 'N')
</insert>
<select id="getIntelligentReminderById" parameterType="java.lang.Long" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List" />
FROM dj_intelligent_reminder
WHERE ID = #{id,jdbcType=INTEGER}
</select>
<update id="updateReminderByCondition" parameterType="cn.com.glsx.dj.weapp.model.IntelligentReminder">
UPDATE dj_intelligent_reminder
SET
<if test="accountId != null">
ACCOUNT_ID = #{accountId},
</if>
<if test="merchantId != null">
MERCHANT_ID = #{merchantId},
</if>
<if test="merchantName != null">
MERCHANT_NAME = #{merchantName},
</if>
<if test="reminderName != null">
REMINDER_NAME = #{reminderName},
</if>
<if test="reminderType != null">
REMINDER_TYPE = #{reminderType},
</if>
<if test="remark != null">
REMARK = #{remark},
</if>
<if test="source != null">
SOURCE = #{source},
</if>
UPDATED_BY = #{updatedBy},
UPDATED_DATE = NOW()
WHERE
ID = #{id,jdbcType=INTEGER}
</update>
<update id="deleterReminderById" parameterType="java.lang.Long">
UPDATE dj_intelligent_reminder
SET DELETED_FLAG = 'Y' , UPDATED_DATE = NOW()
WHERE ID = #{id}
</update>
<update id="deleterReminderByReminderId" parameterType="java.lang.Integer">
UPDATE dj_intelligent_reminder
SET DELETED_FLAG = 'Y' , UPDATED_DATE = NOW()
WHERE REMINDER_ID = #{reminderId}
</update>
</mapper>