StatisticsFinancePageselectMapper.xml
7.32 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?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.lhcredit.project.business.statisticsFinancePageselect.mapper.StatisticsFinancePageselectMapper">
<resultMap type="StatisticsFinancePageselect" id="StatisticsFinancePageselectResult">
<result property="id" column="id" />
<result property="ename" column="ename" />
<result property="orgId" column="org_id" />
<result property="userId" column="user_id" />
<result property="userName" column="user_name" />
<result property="dataType" column="data_type" />
<result property="creditTime" column="credit_time" />
<result property="resultRemark" column="result_remark" />
<result property="countStatus" column="count_status" />
<result property="reconciliation" column="reconciliation" />
</resultMap>
<sql id="selectStatisticsFinancePageselectVo">
select id, ename, org_id, user_id, user_name, data_type, credit_time, result_remark, count_status,reconciliation from statistics_finance_pageselect
</sql>
<select id="selectStatisticsFinancePageselectList" parameterType="StatisticsFinancePageselect" resultMap="StatisticsFinancePageselectResult">
<include refid="selectStatisticsFinancePageselectVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="ename != null and ename != '' "> and ename like CONCAT('%',#{ename},'%')</if>
<if test="orgId != null "> and org_id = #{orgId}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="userName != null and userName != '' "> and user_id in
(select id from front_user where userName like CONCAT('%',#{userName},'%'))</if>
<if test="dataType != null and dataType != '' "> and data_type = #{dataType}</if>
<if test="creditTime != null "> and credit_time = #{creditTime}</if>
<if test="resultRemark != null and resultRemark != '' "> and result_remark = #{resultRemark}</if>
<if test="countStatus != null "> and count_status = #{countStatus}</if>
<if test="reconciliation != null "> and reconciliation = #{reconciliation}</if>
<if test="null!=params and params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format(credit_time,'%Y-%m-%d %H:%i:%s') >= date_format(#{params.beginTime},'%Y-%m-%d %H:%i:%s')
</if>
<if test="null!=params and params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format(credit_time,'%Y-%m-%d %H:%i:%s') <= date_format(#{params.endTime},'%Y-%m-%d %H:%i:%s')
</if>
</where>
</select>
<select id="selectStatisticsFinancePageselectById" parameterType="Integer" resultMap="StatisticsFinancePageselectResult">
<include refid="selectStatisticsFinancePageselectVo"/>
where id = #{id}
</select>
<select id="getList"
resultType="com.lhcredit.project.business.statisticsFinancePageselect.domain.StatisticsFinancePageselect">
select a.id, a.ename, a.org_id as orgId, a.user_id as userId, a.user_name as userName,
a.data_type as dataType, a.credit_time as creditTime,a.reconciliation as reconciliation, a.result_remark as resultRemark, a.count_status as countStatus
,b.dept_name as deptName
from statistics_finance_pageselect a left join front_dept b on a.`org_id`=b.`id`
<where>
<if test="deptName != null and ''!=deptName ">a.org_id in (SELECT id FROM `front_dept` WHERE dept_name LIKE concat('%',#{deptName},'%'))</if>
<if test="ename != null and ''!=ename ">and a.ename LIKE concat('%',#{ename},'%')</if>
<if test="userName != null and ''!=userName ">and a.user_id in (SELECT id FROM front_user WHERE userName LIKE concat('%',#{userName},'%'))</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(credit_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and date_format(credit_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
</if>
</where>
</select>
<insert id="insertStatisticsFinancePageselect" parameterType="StatisticsFinancePageselect" useGeneratedKeys="true" keyProperty="id">
insert into statistics_finance_pageselect
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="ename != null and ename != '' ">ename,</if>
<if test="orgId != null ">org_id,</if>
<if test="userId != null ">user_id,</if>
<if test="userName != null and userName != '' ">user_name,</if>
<if test="dataType != null and dataType != '' ">data_type,</if>
<if test="creditTime != null ">credit_time,</if>
<if test="resultRemark != null and resultRemark != '' ">result_remark,</if>
<if test="countStatus != null ">count_status,</if>
<if test="reconciliation != null ">reconciliation,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="ename != null and ename != '' ">#{ename},</if>
<if test="orgId != null ">#{orgId},</if>
<if test="userId != null ">#{userId},</if>
<if test="userName != null and userName != '' ">#{userName},</if>
<if test="dataType != null and dataType != '' ">#{dataType},</if>
<if test="creditTime != null ">#{creditTime},</if>
<if test="resultRemark != null and resultRemark != '' ">#{resultRemark},</if>
<if test="countStatus != null ">#{countStatus},</if>
<if test="reconciliation != null ">#{reconciliation},</if>
</trim>
</insert>
<update id="updateStatisticsFinancePageselect" parameterType="StatisticsFinancePageselect">
update statistics_finance_pageselect
<trim prefix="SET" suffixOverrides=",">
<if test="ename != null and ename != '' ">ename = #{ename},</if>
<if test="orgId != null ">org_id = #{orgId},</if>
<if test="userId != null ">user_id = #{userId},</if>
<if test="userName != null and userName != '' ">user_name = #{userName},</if>
<if test="dataType != null and dataType != '' ">data_type = #{dataType},</if>
<if test="creditTime != null ">credit_time = #{creditTime},</if>
<if test="resultRemark != null and resultRemark != '' ">result_remark = #{resultRemark},</if>
<if test="countStatus != null ">count_status = #{countStatus},</if>
<if test="reconciliation != null ">reconciliation = #{reconciliation},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteStatisticsFinancePageselectById" parameterType="Integer">
delete from statistics_finance_pageselect where id = #{id}
</delete>
<delete id="deleteStatisticsFinancePageselectByIds" parameterType="String">
delete from statistics_finance_pageselect where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>