ReportTemplateMapper.xml
3.25 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
<?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.credit.cy.business.mapper.ReportTemplateMapper">
<resultMap type="com.credit.cy.business.domain.ReportTemplate" id="ReportTemplateResult">
<result property="id" column="id" />
<result property="reportType" column="report_type" />
<result property="fileKey" column="file_key" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectReportTemplateVo">
select id, report_type, file_key, create_time, update_time from report_template
</sql>
<select id="selectReportTemplateList" parameterType="com.credit.cy.business.domain.ReportTemplate" resultMap="ReportTemplateResult">
<include refid="selectReportTemplateVo"/>
<where>
<if test="reportType != null and reportType != ''"> and report_type = #{reportType}</if>
<if test="fileKey != null and fileKey != ''"> and file_key = #{fileKey}</if>
</where>
</select>
<select id="selectReportTemplateById" parameterType="Long" resultMap="ReportTemplateResult">
<include refid="selectReportTemplateVo"/>
where id = #{id}
</select>
<insert id="insertReportTemplate" parameterType="com.credit.cy.business.domain.ReportTemplate">
insert into report_template
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="reportType != null and reportType != ''">report_type,</if>
<if test="fileKey != null and fileKey != ''">file_key,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="reportType != null and reportType != ''">#{reportType},</if>
<if test="fileKey != null and fileKey != ''">#{fileKey},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateReportTemplate" parameterType="com.credit.cy.business.domain.ReportTemplate">
update report_template
<trim prefix="SET" suffixOverrides=",">
<if test="reportType != null and reportType != ''">report_type = #{reportType},</if>
<if test="fileKey != null and fileKey != ''">file_key = #{fileKey},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteReportTemplateById" parameterType="Long">
delete from report_template where id = #{id}
</delete>
<delete id="deleteReportTemplateByIds" parameterType="String">
delete from report_template where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>