ApiDataServiceInfoMapper.xml
4 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
<?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.apiDataServiceInfo.mapper.ApiDataServiceInfoMapper">
<resultMap type="ApiDataServiceInfo" id="ApiDataServiceInfoResult">
<result property="id" column="id" />
<result property="dataId" column="data_id" />
<result property="title" column="title" />
<result property="content" column="content" />
<result property="content1" column="content1" />
<result property="content2" column="content2" />
</resultMap>
<sql id="selectApiDataServiceInfoVo">
select id, data_id, title, content , content1 , content2 from api_data_service_info
</sql>
<select id="selectApiDataServiceInfoList" parameterType="ApiDataServiceInfo" resultMap="ApiDataServiceInfoResult">
<include refid="selectApiDataServiceInfoVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="dataId != null "> and data_id = #{dataId}</if>
<if test="title != null and title != '' "> and title = #{title}</if>
<if test="content != null and content != '' "> and content = #{content}</if>
<if test="content1 != null and content1 != '' "> and content1 = #{content1}</if>
<if test="content2 != null and content2 != '' "> and content2 = #{content2}</if>
</where>
</select>
<select id="selectApiDataServiceInfoById" parameterType="Integer" resultMap="ApiDataServiceInfoResult">
<include refid="selectApiDataServiceInfoVo"/>
where id = #{id}
</select>
<select id="selectApiDataServiceInfoListAll"
parameterType="ApiDataServiceInfo" resultMap="ApiDataServiceInfoResult">
select * from api_data_service_info
</select>
<insert id="insertApiDataServiceInfo" parameterType="ApiDataServiceInfo">
insert into api_data_service_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null ">id,</if>
<if test="dataId != null ">data_id,</if>
<if test="title != null and title != '' ">title,</if>
<if test="content != null and content != '' ">content,</if>
<if test="content1 != null and content1 != '' ">content1,</if>
<if test="content2 != null and content2 != '' ">content2,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null ">#{id},</if>
<if test="dataId != null ">#{dataId},</if>
<if test="title != null and title != '' ">#{title},</if>
<if test="content != null and content != '' ">#{content},</if>
<if test="content1 != null and content1 != '' ">#{content1},</if>
<if test="content2 != null and content2 != '' ">#{content2},</if>
</trim>
</insert>
<update id="updateApiDataServiceInfo" parameterType="ApiDataServiceInfo">
update api_data_service_info
<trim prefix="SET" suffixOverrides=",">
<if test="dataId != null ">data_id = #{dataId},</if>
<if test="title != null and title != '' ">title = #{title},</if>
<if test="content != null and content != '' ">content = #{content},</if>
<if test="content1 != null and content1 != '' ">content = #{content1},</if>
<if test="content2 != null and content2 != '' ">content = #{content2},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteApiDataServiceInfoById" parameterType="Integer">
delete from api_data_service_info where id = #{id}
</delete>
<delete id="deleteApiDataServiceInfoByIds" parameterType="String">
delete from api_data_service_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>