LhZdListMapper.xml
6.14 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
<?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.lhZdList.mapper.LhZdListMapper">
<resultMap type="LhZdList" id="LhZdListResult">
<result property="id" column="id" />
<result property="ename" column="ename" />
<result property="creditCode" column="creditCode" />
<result property="busId" column="busId" />
<result property="userId" column="userId" />
<result property="creditTime" column="creditTime" />
<result property="status" column="status" />
<result property="reportId" column="reportId" />
<result property="source" column="source" />
<result property="excelUrl" column="excelUrl" />
<result property="regCoode" column="regCoode" />
<result property="updateTime" column="updateTime" />
</resultMap>
<sql id="selectLhZdListVo">
select id, ename, creditCode, busId, userId, updateTime,creditTime, status, reportId, source, excelUrl, regCoode from lh_zd_list
</sql>
<select id="selectLhZdListList" parameterType="LhZdList" resultMap="LhZdListResult">
<include refid="selectLhZdListVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="ename != null and ename != '' "> and ename like concat('%',#{ename},'%')</if>
<if test="creditCode != null and creditCode != '' "> and creditCode = #{creditCode}</if>
<if test="busId != null and busId != '' "> and busId = #{busId}</if>
<if test="userId != null "> and userId = #{userId}</if>
<if test="creditTime != null "> and creditTime = #{creditTime}</if>
<if test="status != null "> and status = #{status}</if>
<if test="reportId != null and reportId != '' "> and reportId = #{reportId}</if>
<if test="source != null and source != '' "> and source = #{source}</if>
<if test="excelUrl != null and excelUrl != '' "> and excelUrl = #{excelUrl}</if>
<if test="regCoode != null and regCoode != '' "> and regCoode = #{regCoode}</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format(creditTime,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format(creditTime,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
</if>
</where>
order by creditTime desc
</select>
<select id="selectLhZdListById" parameterType="Integer" resultMap="LhZdListResult">
<include refid="selectLhZdListVo"/>
where id = #{id}
</select>
<select id="selectLhZdByBusId" resultMap="LhZdListResult">
<include refid="selectLhZdListVo"/>
where busId = #{id}
</select>
<insert id="insertLhZdList" parameterType="LhZdList" useGeneratedKeys="true" keyProperty="id">
insert into lh_zd_list
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="ename != null and ename != '' ">ename,</if>
<if test="creditCode != null and creditCode != '' ">creditCode,</if>
<if test="busId != null and busId != '' ">busId,</if>
<if test="userId != null ">userId,</if>
<if test="creditTime != null ">creditTime,</if>
<if test="status != null ">status,</if>
<if test="reportId != null and reportId != '' ">reportId,</if>
<if test="source != null and source != '' ">source,</if>
<if test="excelUrl != null and excelUrl != '' ">excelUrl,</if>
<if test="regCoode != null and regCoode != '' ">regCoode,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="ename != null and ename != '' ">#{ename},</if>
<if test="creditCode != null and creditCode != '' ">#{creditCode},</if>
<if test="busId != null and busId != '' ">#{busId},</if>
<if test="userId != null ">#{userId},</if>
<if test="creditTime != null ">#{creditTime},</if>
<if test="status != null ">#{status},</if>
<if test="reportId != null and reportId != '' ">#{reportId},</if>
<if test="source != null and source != '' ">#{source},</if>
<if test="excelUrl != null and excelUrl != '' ">#{excelUrl},</if>
<if test="regCoode != null and regCoode != '' ">#{regCoode},</if>
</trim>
</insert>
<update id="updateLhZdList" parameterType="LhZdList">
update lh_zd_list
<trim prefix="SET" suffixOverrides=",">
<if test="ename != null and ename != '' ">ename = #{ename},</if>
<if test="creditCode != null and creditCode != '' ">creditCode = #{creditCode},</if>
<if test="busId != null and busId != '' ">busId = #{busId},</if>
<if test="userId != null ">userId = #{userId},</if>
<if test="creditTime != null ">creditTime = #{creditTime},</if>
<if test="updateTime != null ">updateTime = #{updateTime},</if>
<if test="status != null ">status = #{status},</if>
<if test="reportId != null and reportId != '' ">reportId = #{reportId},</if>
<if test="source != null and source != '' ">source = #{source},</if>
<if test="excelUrl != null and excelUrl != '' ">excelUrl = #{excelUrl},</if>
<if test="regCoode != null and regCoode != '' ">regCoode = #{regCoode},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteLhZdListById" parameterType="Integer">
delete from lh_zd_list where id = #{id}
</delete>
<delete id="deleteLhZdListByIds" parameterType="String">
delete from lh_zd_list where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>