forked from taobao/sqlautoreview
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.xml
58 lines (54 loc) · 1.46 KB
/
test.xml
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
<?xml version="1.0" encoding="GB2312"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="Activity">
<typeAlias alias="activity"
type="com.taobao.test.domain.Activity" />
<resultMap id="activityResult" class="activity">
<result property="id" column="ID" />
<result property="gmtCreate" column="GMT_CREATE" />
<result property="gmtModified" column="GMT_MODIFIED" />
<result property="description" column="INFO" />
<result property="displaySendNumber" column="SMS_FACK_MAX" />
<result property="sendNumber" column="SMS_REAL_MAX" />
<result property="status" column="STATUS" />
<result property="name" column="NAME" />
<result property="startTime" column="START_TIME" />
<result property="endTime" column="END_TIME" />
</resultMap>
<!-- 根据id查询活动 -->
<select id="getActivityById" resultMap="activityResult" parameterClass="java.lang.Long">
SELECT
ID,
GMT_CREATE,
GMT_MODIFIED,
NAME,
INFO,
SMS_FACK_MAX,
SMS_REAL_MAX,
START_TIME,
END_TIME,
STATUS
FROM
test
WHERE
ID = #activityId#
</select>
<!-- 根据当前时间获取当前任务 -->
<select id="getCurrentActivity" resultMap="activityResult">
SELECT
ID,
GMT_CREATE,
GMT_MODIFIED,
NAME,
INFO,
SMS_FACK_MAX,
SMS_REAL_MAX,
START_TIME,
END_TIME,
STATUS
FROM
test
WHERE
<![CDATA[ START_TIME <=NOW() AND END_TIME>=NOW() ]]>
</select>
</sqlMap>