SMSLogsMapper.xml
2.56 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
<?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.monitor.mysql.mapper.SMSLogsMapper" >
<resultMap id="BaseResultMap" type="com.model.SMSLogs" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="template_id" property="templateId" jdbcType="INTEGER" />
<result column="template_name" property="templateName" jdbcType="VARCHAR" />
<result column="ip" property="ip" jdbcType="VARCHAR" />
<result column="area" property="area" jdbcType="VARCHAR" />
<result column="mobile" property="mobile" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
<result column="manage_status" property="manageStatus" jdbcType="INTEGER" />
<result column="first_service" property="firstService" jdbcType="INTEGER" />
<result column="first_service_reuslt" property="firstServiceReuslt" jdbcType="VARCHAR" />
<result column="first_service_status" property="firstServiceStatus" jdbcType="INTEGER" />
<result column="second_service" property="secondService" jdbcType="INTEGER" />
<result column="second_service_result" property="secondServiceResult" jdbcType="VARCHAR" />
<result column="second_service_status" property="secondServiceStatus" jdbcType="INTEGER" />
<result column="ext1" property="ext1" jdbcType="VARCHAR" />
<result column="ext2" property="ext2" jdbcType="VARCHAR" />
<result column="ext3" property="ext3" jdbcType="VARCHAR" />
</resultMap>
<resultMap id="ResultMapWithBLOBs" type="com.model.SMSLogs" extends="BaseResultMap" >
<result column="content" property="content" jdbcType="LONGVARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
id, template_id, template_name, ip, area, mobile, create_time, update_time, manage_status,
first_service, first_service_reuslt, first_service_status, second_service, second_service_result,
second_service_status, ext1, ext2, ext3
</sql>
<sql id="Blob_Column_List" >
content
</sql>
<select id="selectByMobile" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from sms_logs
where mobile = #{params.mobile}
order by create_time desc limit 10
</select>
<select id="selectCountByMobile" resultType="java.lang.Integer">
select
count(1)
from sms_logs where mobile = #{params.mobile}
</select>
</mapper>