ReportDataCacheMapper.xml
2.88 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
<?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.reportDataCache.mapper.ReportDataCacheMapper">
<resultMap type="ReportDataCache" id="ReportDataCacheResult">
<result property="id" column="id" />
<result property="reportId" column="report_id" />
<result property="json" column="json" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectReportDataCacheVo">
select id, report_id, json, create_time from report_data_cache
</sql>
<select id="selectReportDataCacheList" parameterType="ReportDataCache" resultMap="ReportDataCacheResult">
<include refid="selectReportDataCacheVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="reportId != null and reportId != '' "> and report_id = #{reportId}</if>
<if test="json != null and json != '' "> and json = #{json}</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
</where>
</select>
<select id="selectReportDataCacheById" parameterType="Long" resultMap="ReportDataCacheResult">
<include refid="selectReportDataCacheVo"/>
where id = #{id}
</select>
<insert id="insertReportDataCache" parameterType="ReportDataCache" useGeneratedKeys="true" keyProperty="id">
insert into report_data_cache
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="reportId != null and reportId != '' ">report_id,</if>
<if test="json != null and json != '' ">json,</if>
<if test="createTime != null ">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="reportId != null and reportId != '' ">#{reportId},</if>
<if test="json != null and json != '' ">#{json},</if>
<if test="createTime != null ">#{createTime},</if>
</trim>
</insert>
<update id="updateReportDataCache" parameterType="ReportDataCache">
update report_data_cache
<trim prefix="SET" suffixOverrides=",">
<if test="reportId != null and reportId != '' ">report_id = #{reportId},</if>
<if test="json != null and json != '' ">json = #{json},</if>
<if test="createTime != null ">create_time = #{createTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteReportDataCacheById" parameterType="Long">
delete from report_data_cache where id = #{id}
</delete>
<delete id="deleteReportDataCacheByIds" parameterType="String">
delete from report_data_cache where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>