StoredSellerMapper.xml
3.27 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
<?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.yoho.order.dal.StoredSellerMapper" >
<resultMap id="BaseResultMap" type="com.yoho.order.model.StoredSeller" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="uid" property="uid" jdbcType="INTEGER" />
<result column="valid_status" property="validStatus" jdbcType="INTEGER" />
<result column="cert_no" property="certNo" jdbcType="VARCHAR" />
<result column="cert_name" property="certName" jdbcType="VARCHAR" />
<result column="operator_uid" property="operatorUid" jdbcType="INTEGER" />
<result column="operator_name" property="operatorName" jdbcType="VARCHAR" />
<result column="enter_time" property="enterTime" jdbcType="INTEGER" />
<result column="quit_time" property="quitTime" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="INTEGER" />
<result column="update_time" property="updateTime" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List" >
id, uid, valid_status,cert_no,cert_name,operator_uid,operator_name,enter_time,quit_time ,create_time, update_time
</sql>
<select id="selectValidByUid" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from stored_seller
where uid = #{uid} and valid_status = 1
order by id desc limit 1
</select>
<insert id="insert" parameterType="com.yoho.order.model.StoredSeller" >
insert into stored_seller (uid, valid_status,cert_no,cert_name,operator_uid,operator_name,enter_time,quit_time, create_time, update_time)
values (#{uid},#{validStatus},
#{certNo},#{certName},#{operatorUid},#{operatorName},
#{enterTime},#{quitTime},
#{createTime},#{updateTime})
</insert>
<update id="updateStatusByUid">
update stored_seller
set valid_status = #{validStatus},update_time = #{updateTime}
where uid = #{uid} and valid_status = #{expectStatus}
</update>
<!-- <update id="updateToQuitByPrimaryKey">
update stored_seller
set valid_status = #{validStatus},operator_uid = #{operatorUid},operator_name=#{operatorName},
quit_time = #{quitTime} ,update_time = #{updateTime}
where id = #{id} and valid_status = #{expectStatus}
</update>-->
<sql id="Query_Condition_Sql" >
<if test="storedSellerReq.uid != null">
and uid = #{storedSellerReq.uid}
</if>
<if test="storedSellerReq.certName != null">
and cert_name = #{storedSellerReq.certName}
</if>
<if test="storedSellerReq.validStatus != null ">
and valid_status = #{storedSellerReq.validStatus}
</if>
</sql>
<select id="selectCountByCondition" resultType="java.lang.Integer" parameterType="com.yoho.order.model.StoredSellerReqVo">
select count(id)
from stored_seller where 1=1
<include refid="Query_Condition_Sql" />
</select>
<select id="selectByConditionWithPage" resultMap="BaseResultMap" parameterType="com.yoho.order.model.StoredSellerReqVo">
select <include refid="Base_Column_List" />
from stored_seller where 1=1
<include refid="Query_Condition_Sql" />
order by id desc
limit #{storedSellerReq.start},#{storedSellerReq.size}
</select>
</mapper>