BReportTableMapper.xml
4.99 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
<?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.bReportTable.mapper.BReportTableMapper">
<resultMap type="BReportTable" id="BReportTableResult">
<result property="id" column="id" />
<result property="reportName" column="report_name" />
<result property="notice" column="notice" />
<result property="title" column="title" />
<result property="imageUrl" column="image_url" />
<result property="sample" column="sample" />
<result property="isDel" column="is_del" />
<result property="bizType" column="biz_type" />
</resultMap>
<sql id="selectBReportTableVo">
select id, report_name, notice, title, image_url, sample, is_del, biz_type from b_report_table
</sql>
<select id="selectBReportTableList" parameterType="BReportTable" resultMap="BReportTableResult">
<include refid="selectBReportTableVo"/>
<where>
<if test="id != null and id != '' "> and id = #{id}</if>
<if test="reportName != null and reportName != '' "> and report_name = #{reportName}</if>
<if test="notice != null and notice != '' "> and notice = #{notice}</if>
<if test="title != null and title != '' "> and title = #{title}</if>
<if test="imageUrl != null and imageUrl != '' "> and image_url = #{imageUrl}</if>
<if test="sample != null and sample != '' "> and sample = #{sample}</if>
<if test="isDel != null "> and is_del = #{isDel}</if>
<if test="bizType != null "> and biz_type = #{bizType}</if>
</where>
</select>
<select id="selectTypes" resultType="String">
select biz_type from b_report_table
</select>
<select id="selectBReportTableById" parameterType="String" resultMap="BReportTableResult">
<include refid="selectBReportTableVo"/>
where id = #{id}
</select>
<select id="selectBReportTableByReportType" parameterType="String" resultMap="BReportTableResult">
<include refid="selectBReportTableVo"/>
where biz_type = #{reportType}
</select>
<insert id="insertBReportTable" parameterType="BReportTable">
insert into b_report_table
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null ">id,</if>
<if test="reportName != null and reportName != '' ">report_name,</if>
<if test="notice != null and notice != '' ">notice,</if>
<if test="title != null and title != '' ">title,</if>
<if test="imageUrl != null and imageUrl != '' ">image_url,</if>
<if test="sample != null and sample != '' ">sample,</if>
<if test="isDel != null ">is_del,</if>
<if test="bizType != null ">biz_type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null ">#{id},</if>
<if test="reportName != null and reportName != '' ">#{reportName},</if>
<if test="notice != null and notice != '' ">#{notice},</if>
<if test="title != null and title != '' ">#{title},</if>
<if test="imageUrl != null and imageUrl != '' ">#{imageUrl},</if>
<if test="sample != null and sample != '' ">#{sample},</if>
<if test="isDel != null ">#{isDel},</if>
<if test="bizType != null ">#{bizType},</if>
</trim>
</insert>
<update id="updateBReportTable" parameterType="BReportTable">
update b_report_table
<trim prefix="SET" suffixOverrides=",">
<if test="reportName != null and reportName != '' ">report_name = #{reportName},</if>
<if test="notice != null and notice != '' ">notice = #{notice},</if>
<if test="title != null and title != '' ">title = #{title},</if>
<if test="imageUrl != null and imageUrl != '' ">image_url = #{imageUrl},</if>
<if test="sample != null and sample != '' ">sample = #{sample},</if>
<if test="isDel != null ">is_del = #{isDel},</if>
<if test="bizType != null ">biz_type = #{bizType},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBReportTableById" parameterType="String">
delete from b_report_table where id = #{id}
</delete>
<delete id="deleteBReportTableByIds" parameterType="String">
delete from b_report_table where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="getReportTableList" resultMap="BReportTableResult">
<include refid="selectBReportTableVo"/>
<where>
<if test="bizTypeArr != null and bizTypeArr.length > 0">
and biz_type in
<foreach item="string" index="index" collection="bizTypeArr" open="(" separator="," close=")">
#{string}
</foreach>
</if>
</where>
</select>
</mapper>