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
<?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.yifu.cloud.plus.v1.business.mapper.settle.TBusSettleMapper">
<resultMap id="tBusSettleMap" type="com.yifu.cloud.plus.v1.business.entity.settle.TBusSettle">
<id property="id" column="id"/>
<result property="accountDeptName" column="account_dept_name"/>
<result property="settleMonth" column="settle_month"/>
<result property="createUserId" column="create_user_id"/>
<result property="createUserName" column="create_user_name"/>
<result property="createTime" column="create_time"/>
<result property="deleteFlag" column="delete_flag"/>
</resultMap>
<sql id="Base_Column_List">
a.id,
a.account_dept_name,
a.settle_month,
a.create_user_id,
a.create_user_name,
a.create_time,
a.delete_flag
</sql>
<sql id="tBusSettle_where">
<if test="tBusSettle != null">
<if test="tBusSettle.id != null and tBusSettle.id.trim() != ''">
AND a.id = #{tBusSettle.id}
</if>
<if test="tBusSettle.accountDeptName != null and tBusSettle.accountDeptName.trim() != ''">
AND a.account_dept_name like concat('%',#{tBusSettle.accountDeptName},'%')
</if>
<if test="tBusSettle.settleMonth != null and tBusSettle.settleMonth.trim() != ''">
AND a.settle_month = #{tBusSettle.settleMonth}
</if>
<if test="tBusSettle.createUserId != null and tBusSettle.createUserId.trim() != ''">
AND a.create_user_id = #{tBusSettle.createUserId}
</if>
<if test="tBusSettle.createUserName != null and tBusSettle.createUserName.trim() != ''">
AND a.create_user_name = #{tBusSettle.createUserName}
</if>
<if test="tBusSettle.createTime != null">
AND a.create_time = #{tBusSettle.createTime}
</if>
<if test="tBusSettle.deleteFlag != null">
AND a.delete_flag = #{tBusSettle.deleteFlag}
</if>
</if>
</sql>
<!--tBusSettle简单分页查询-->
<select id="getTBusSettlePage" resultMap="tBusSettleMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_bus_settle a
<where>
a.delete_flag = 0
<include refid="tBusSettle_where"/>
</where>
ORDER BY a.create_time desc
</select>
<!--tBusSettle简单查询list-->
<select id="getTBusSettleList" resultMap="tBusSettleMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_bus_settle a
<where>
a.delete_flag = 0
<include refid="tBusSettle_where"/>
</where>
ORDER BY a.create_time desc
</select>
</mapper>