user-entrust-mapper.xml
2 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">
<!-- 托管管理 @author 仝玉甫 -->
<mapper namespace="com.cjs.cms.dao.user.UserEntrustDao">
<sql id="user_entrust_field">
id, fund_account, otc_account, password, apply_no, otc_code, otc_name,
apply_count, picking_type, addressx, mobile, accept_name, trustee_unit, issue_price,
apply_date, status, result, DATE_FORMAT(create_at, '%Y-%m-%d %H:%i:%s') create_at,
DATE_FORMAT(update_at, '%Y-%m-%d %H:%i:%s') update_at, update_by
</sql>
<sql id="searchCondition">
where 1 = 1
<if test="fund_account != null and fund_account != ''"> and fund_account like concat('%', #{fund_account}, '%') </if>
<if test="otc_code != null and otc_code != ''"> and otc_code like concat('%', #{otc_code}, '%') </if>
<if test="picking_type != null and picking_type != ''"> and picking_type = #{picking_type} </if>
<if test="status != null and status != ''"> and status = #{status} </if>
<if test="startDate != null and startDate != ''"> <![CDATA[ and create_at >= #{startDate}]]> </if>
<if test="endDate != null and endDate != ''"> <![CDATA[ and create_at <= DATE_ADD(#{endDate}, INTERVAL 1 day)]]> </if>
</sql>
<select id="search" parameterType="map" resultType="map">
select <include refid="user_entrust_field" />
from user_entrust
<include refid="searchCondition" />
order by id desc
<include refid="common.pageLimit" />
</select>
<select id="searchTotal" parameterType="map" resultType="int">
select count(*)
from user_entrust
<include refid="searchCondition" />
</select>
<select id="queryById" parameterType="int" resultType="map">
select <include refid="user_entrust_field" />
from user_entrust
where id = #{value}
</select>
<update id="update" parameterType="map">
update user_entrust set
status = #{status}, result = #{result}, update_at = now(), update_by = #{update_by},
apply_no = #{apply_no}
where id = #{id}
</update>
</mapper>