ReportDataSourceMapper.xml
6.91 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
<?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.reportDataSource.mapper.ReportDataSourceMapper">
<resultMap type="ReportDataSource" id="ReportDataSourceResult">
<result property="id" column="id" />
<result property="dsName" column="ds_name" />
<result property="dsCode" column="ds_code" />
<result property="dsUrl" column="ds_url" />
<result property="dsUrlParams" column="ds_url_params" />
<result property="remark" column="remark" />
<result property="delFlag" column="del_flag" />
<result property="dataType" column="data_type" />
<result property="demoCompany" column="demo_company" />
<result property="demoData" column="demo_data" />
<result property="fieldType" column="field_type" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectReportDataSourceVo">
select id, ds_name, ds_code, ds_url, ds_url_params, remark, del_flag, data_type, demo_company, demo_data, field_type, create_time, update_time from report_data_source
</sql>
<select id="selectReportDataSourceList" parameterType="ReportDataSource" resultMap="ReportDataSourceResult">
<include refid="selectReportDataSourceVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="dsName != null and dsName != '' "> and ds_name like concat("%", #{dsName},"%")</if>
<if test="dsCode != null and dsCode != '' "> and ds_code = #{dsCode}</if>
<if test="dsUrl != null and dsUrl != '' "> and ds_url = #{dsUrl}</if>
<if test="dsUrlParams != null and dsUrlParams != '' "> and ds_url_params = #{dsUrlParams}</if>
<if test="remark != null and remark != '' "> and remark = #{remark}</if>
<if test="delFlag != null and delFlag != '' "> and del_flag = #{delFlag}</if>
<if test="dataType != null and dataType != '' "> and data_type = #{dataType}</if>
<if test="demoCompany != null and demoCompany != '' "> and demo_company = #{demoCompany}</if>
<if test="demoData != null and demoData != '' "> and demo_data = #{demoData}</if>
<if test="fieldType != null and fieldType != '' "> and field_type = #{fieldType}</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
</where>
</select>
<select id="selectReportDataSourceById" parameterType="Integer" resultMap="ReportDataSourceResult">
<include refid="selectReportDataSourceVo"/>
where id = #{id}
</select>
<select id="selectByIds"
resultMap="ReportDataSourceResult">
<include refid="selectReportDataSourceVo"/>
where id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<insert id="insertReportDataSource" parameterType="ReportDataSource" useGeneratedKeys="true" keyProperty="id">
insert into report_data_source
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="dsName != null and dsName != '' ">ds_name,</if>
<if test="dsCode != null and dsCode != '' ">ds_code,</if>
<if test="dsUrl != null and dsUrl != '' ">ds_url,</if>
<if test="dsUrlParams != null and dsUrlParams != '' ">ds_url_params,</if>
<if test="remark != null and remark != '' ">remark,</if>
<if test="delFlag != null and delFlag != '' ">del_flag,</if>
<if test="dataType != null and dataType != '' ">data_type,</if>
<if test="demoCompany != null and demoCompany != '' ">demo_company,</if>
<if test="demoData != null and demoData != '' ">demo_data,</if>
<if test="fieldType != null and fieldType != '' ">field_type,</if>
<if test="createTime != null ">create_time,</if>
<if test="updateTime != null ">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="dsName != null and dsName != '' ">#{dsName},</if>
<if test="dsCode != null and dsCode != '' ">#{dsCode},</if>
<if test="dsUrl != null and dsUrl != '' ">#{dsUrl},</if>
<if test="dsUrlParams != null and dsUrlParams != '' ">#{dsUrlParams},</if>
<if test="remark != null and remark != '' ">#{remark},</if>
<if test="delFlag != null and delFlag != '' ">#{delFlag},</if>
<if test="dataType != null and dataType != '' ">#{dataType},</if>
<if test="demoCompany != null and demoCompany != '' ">#{demoCompany},</if>
<if test="demoData != null and demoData != '' ">#{demoData},</if>
<if test="fieldType != null and fieldType != '' ">#{fieldType},</if>
<if test="createTime != null ">#{createTime},</if>
<if test="updateTime != null ">#{updateTime},</if>
</trim>
</insert>
<update id="updateReportDataSource" parameterType="ReportDataSource">
update report_data_source
<trim prefix="SET" suffixOverrides=",">
<if test="dsName != null and dsName != '' ">ds_name = #{dsName},</if>
<if test="dsCode != null and dsCode != '' ">ds_code = #{dsCode},</if>
<if test="dsUrl != null and dsUrl != '' ">ds_url = #{dsUrl},</if>
<if test="dsUrlParams != null and dsUrlParams != '' ">ds_url_params = #{dsUrlParams},</if>
<if test="remark != null and remark != '' ">remark = #{remark},</if>
<if test="delFlag != null and delFlag != '' ">del_flag = #{delFlag},</if>
<if test="dataType != null and dataType != '' ">data_type = #{dataType},</if>
<if test="demoCompany != null and demoCompany != '' ">demo_company = #{demoCompany},</if>
<if test="demoData != null and demoData != '' ">demo_data = #{demoData},</if>
<if test="fieldType != null and fieldType != '' ">field_type = #{fieldType},</if>
<if test="createTime != null ">create_time = #{createTime},</if>
<if test="updateTime != null ">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteReportDataSourceById" parameterType="Integer">
delete from report_data_source where id = #{id}
</delete>
<delete id="deleteReportDataSourceByIds" parameterType="String">
delete from report_data_source where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>