SendMessageMapper.xml
2.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
<?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.sincere.xiaoanSearch.mapper.SendMessageMapper">
<resultMap id="BaseResultMap" type="com.sincere.xiaoanSearch.model.SendMessage">
<id column="id" property="id" jdbcType="BIGINT"/>
<result column="device_id" property="deviceId" jdbcType="VARCHAR"/>
<result column="card_no" property="cardNo" jdbcType="VARCHAR"/>
<result column="serial_number" property="index" jdbcType="BIGINT"/>
<result column="send" property="send" jdbcType="VARCHAR"/>
<result column="result" property="result" jdbcType="VARCHAR"/>
<result column="correct" property="correct" jdbcType="INTEGER"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
<result column="function_id" property="functionId" jdbcType="VARCHAR"/>
</resultMap>
<insert id="insert" parameterType="com.sincere.xiaoanSearch.model.SendMessage" useGeneratedKeys="true"
keyColumn="id" keyProperty="id">
insert into WG_send_message (device_id,card_no,serial_number,send,result,correct,create_time,function_id)
values (#{deviceId},#{cardNo},#{index},#{send},#{result},#{correct},#{createTime},#{functionId})
</insert>
<select id="selectMessage" parameterType="com.sincere.xiaoanSearch.model.SendMessage" resultMap="BaseResultMap">
select * from WG_send_message
<where>
<if test="deviceId != 0">
and device_id =#{deviceId}
</if>
<if test="cardNo != null">
and card_no = #{cardNo}
</if>
<if test="index != 0">
and serial_number = #{index}
</if>
<if test="functionId != null">
and function_id = #{functionId}
</if>
</where>
order by create_time desc
</select>
<select id="selectById" parameterType="java.lang.Long" resultMap="BaseResultMap">
select * from WG_send_message where id =#{id}
</select>
<update id="update" parameterType="com.sincere.xiaoanSearch.model.SendMessage">
update WG_send_message set result = #{result} , correct =#{correct}
where id = #{id}
</update>
</mapper>