user-bank-mapper.xml
1.51 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">
<!-- @author tongxiaochuan-->
<mapper namespace="com.cjs.cms.dao.user.fund.UserBankDao">
<sql id="user_bank_field">
id, user_id, user_name, id_no, bank_province, bank_city, bank_no,
bank_name, bank_card_no, mobile, state, create_at, create_by
</sql>
<sql id="searchCondition">
where 1 = 1
<if test="userId != null and userId != ''">
and instr(user_id, #{userId}) > 0
</if>
<if test="userName != null and userName != ''">
and instr(user_name, #{userName}) > 0
</if>
<if test="bankCardNo != null and bankCardNo != ''">
and instr(bank_card_no, #{bankCardNo}) > 0
</if>
<if test="mobile != null and mobile != ''">
and instr(mobile, #{mobile}) > 0
</if>
<if test="idNo != null and idNo != ''">
and instr(id_no, #{idNo}) > 0
</if>
</sql>
<select id="search" parameterType="map" resultType="UserBankInfo">
select <include refid="user_bank_field" />
from cjs_cms.user_bank
<include refid="searchCondition" />
order by id desc
<include refid="common.pageLimit" />
</select>
<select id="searchTotal" parameterType="map" resultType="int">
select count(1)
from cjs_cms.user_bank
<include refid="searchCondition" />
</select>
<select id="queryByBankNo" parameterType="string" resultType="UserBankInfo">
select <include refid="user_bank_field" />
from cjs_cms.user_bank
where bank_no = #{bankNo}
</select>
</mapper>