ZhimaCertMapper.xml
3.57 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
<?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.ZhimaCertMapper" >
<resultMap id="BaseResultMap" type="com.yoho.order.model.ZhimaCert" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="uid" property="uid" jdbcType="INTEGER" />
<result column="valid_status" property="validStatus" jdbcType="TINYINT" />
<result column="cert_name" property="certName" jdbcType="VARCHAR" />
<result column="cert_no" property="certNo" jdbcType="VARCHAR" />
<result column="biz_no" property="bizNo" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="INTEGER" />
<result column="update_time" property="updateTime" jdbcType="INTEGER" />
<result column="valid_photo" property="validPhoto" jdbcType="TINYINT" />
<result column="image_url" property="imageUrl" jdbcType="VARCHAR" />
<result column="invest_name" property="investName" jdbcType="VARCHAR" />
<result column="entry_type" property="entryType" jdbcType="INTEGER" />
<result column="enter_time" property="enterTime" jdbcType="INTEGER" />
<result column="quit_time" property="quitTime" jdbcType="INTEGER" />
<result column="s_create_time" property="sCreateTime" jdbcType="INTEGER" />
<result column="s_valid_status" property="sValidStatus" jdbcType="TINYINT" />
</resultMap>
<sql id="Base_Column_List" >
id, uid, valid_status, cert_name, cert_no, biz_no, create_time, update_time, valid_photo,
image_url, invest_name
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from zhima_cert
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectCountByCondition" resultType="java.lang.Integer" >
select count(1)
from zhima_cert z left join ufo_order.stored_seller s
on z.uid = s.uid
where z.valid_status = 1
<include refid="Query_Condition_Sql" />
</select>
<select id="selectByConditionPage" resultMap="BaseResultMap">
select z.uid,z.cert_name,s.entry_type,z.cert_no,z.image_url,z.invest_name,s.enter_time,s.quit_time,s.create_time s_create_time,
s.valid_status s_valid_status
from zhima_cert z left join ufo_order.stored_seller s
on z.uid = s.uid
where z.valid_status = 1
<include refid="Query_Condition_Sql" />
order by z.id desc
limit #{sellerReqBO.start},#{sellerReqBO.size}
</select>
<sql id="Query_Condition_Sql" >
<if test="sellerReqBO.uid != null">
and z.uid = #{sellerReqBO.uid}
</if>
<if test="sellerReqBO.certName != null">
and z.cert_name = #{sellerReqBO.certName}
</if>
<if test="sellerReqBO.validStatus != null and sellerReqBO.validStatus != 0">
and s.valid_status = #{sellerReqBO.validStatus}
</if>
<if test="sellerReqBO.sellerType != null and sellerReqBO.sellerType != 0 and sellerReqBO.sellerType != 4">
and s.entry_type = #{sellerReqBO.sellerType} and s.valid_status = 1
</if>
<if test="sellerReqBO.sellerType != null and sellerReqBO.sellerType == 4">
and (s.entry_type = null or s.entry_type = '' or s.entry_type is null or s.valid_status = 9)
</if>
<if test="sellerReqBO.investName != null">
and z.invest_name LIKE '%${sellerReqBO.investName}%'
</if>
</sql>
<update id="updateInvestNameByUid">
update zhima_cert
set invest_name = #{investName,jdbcType=VARCHAR}
where valid_status = 1 and uid = #{uid,jdbcType=INTEGER}
</update>
</mapper>