InfoMarketInformationMapper.xml
10.3 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<?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.chinagas.modules.insight.mapper.InfoMarketInformationMapper">
<resultMap type="com.chinagas.modules.insight.domian.InfoMarketInformation" id="InfoMarketInformationResult">
<result property="infoId" column="info_id"/>
<result property="title" column="title"/>
<result property="organizeId" column="organize_id"/>
<result property="organizeName" column="organize_name"/>
<result property="address" column="address"/>
<result property="plateName" column="plate_name"/>
<result property="keyword" column="keyword"/>
<result property="publishTime" column="publish_time"/>
<result property="submitTime" column="submit_time"/>
<result property="details" column="details"/>
<result property="publishStatus" column="publish_status"/>
<result property="sysCtime" column="sys_ctime"/>
<result property="sysUtime" column="sys_utime"/>
<result property="createBy" column="create_by"/>
<result property="updateBy" column="update_by"/>
<result property="deleteFlag" column="delete_flag"/>
<result property="pictureUrl" column="picture_url"/>
</resultMap>
<sql id="selectInfoMarketInformationVo">
select info_id,
title,
organize_id,
organize_name,
picture_url,
address,
plate_name,
keyword,
publish_time,
submit_time,
details,
publish_status,
sys_ctime,
sys_utime,
create_by,
update_by,
delete_flag
from info_market_information
</sql>
<select id="selectInfoMarketInformationList" parameterType="com.chinagas.modules.insight.vo.InfoMarketInformationVO"
resultMap="InfoMarketInformationResult">
<include refid="selectInfoMarketInformationVo"/>
<where>
<if test="title != null and title != ''">and title like concat('%', #{title}, '%')</if>
<if test="organizeId != null and organizeId != ''">and organize_id REGEXP #{organizeId}</if>
<if test="pictureUrl != null and pictureUrl != ''">and picture_url = #{pictureUrl}</if>
<if test="organizeName != null and organizeName != ''">and organize_name REGEXP #{organizeName}</if>
<if test="address != null and address != ''">and address = #{address}</if>
<if test="plateNameList != null ">and plate_name in
<foreach item="plate_name" collection="plateNameList" open="(" separator="," close=")">
#{plate_name}
</foreach>
</if>
<if test="keywordList != null ">
<foreach item="keyword" collection="keywordList" open="and (" close=")" separator="or">
find_in_set(#{keyword}, keyword)
</foreach>
</if>
<if test="publishTime != null ">and publish_time = #{publishTime}</if>
<if test="publishTimeBegin != null and publishTimeEnd != null">
and publish_time between #{publishTimeBegin} and #{publishTimeEnd}
</if>
<if test="submitTime != null ">and submit_time = #{submitTime}</if>
<if test="details != null and details != ''">and details = #{details}</if>
<if test="publishStatusList != null ">and publish_status in
<foreach item="publish_status" collection="publishStatusList" open="(" separator="," close=")">
#{publish_status}
</foreach>
</if>
<if test="sysCtime != null ">and sys_ctime = #{sysCtime}</if>
<if test="sysUtime != null ">and sys_utime = #{sysUtime}</if>
and delete_flag = 0 order by sys_ctime DESC
</where>
</select>
<select id="selectInfoMarketInformationByInfoId" parameterType="Long" resultMap="InfoMarketInformationResult">
<include refid="selectInfoMarketInformationVo"/>
where info_id = #{infoId}
</select>
<insert id="insertInfoMarketInformation" parameterType="com.chinagas.modules.insight.domian.InfoMarketInformation">
insert into info_market_information
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="infoId != null">info_id,</if>
<if test="title != null and title != ''">title,</if>
<if test="organizeId != null and organizeId != ''">organize_id,</if>
<if test="organizeName != null and organizeName != ''">organize_name,</if>
<if test="pictureUrl != null and pictureUrl != ''">picture_url,</if>
<if test="address != null and address != ''">address,</if>
<if test="plateName != null">plate_name,</if>
<if test="keyword != null">keyword,</if>
<if test="publishTime != null">publish_time,</if>
<if test="submitTime != null">submit_time,</if>
<if test="details != null and details != ''">details,</if>
<if test="publishStatus != null">publish_status,</if>
<if test="sysCtime != null">sys_ctime,</if>
<if test="sysUtime != null">sys_utime,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="deleteFlag != null">delete_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="infoId != null">#{infoId},</if>
<if test="title != null and title != ''">#{title},</if>
<if test="organizeId != null and organizeId != ''">#{organizeId},</if>
<if test="organizeName != null and organizeName !=''">#{organizeName},</if>
<if test="pictureUrl != null and pictureUrl !=''">#{pictureUrl},</if>
<if test="address != null and address != ''">#{address},</if>
<if test="plateName != null">#{plateName},</if>
<if test="keyword != null">#{keyword},</if>
<if test="publishTime != null">#{publishTime},</if>
<if test="submitTime != null">#{submitTime},</if>
<if test="details != null and details != ''">#{details},</if>
<if test="publishStatus != null">#{publishStatus},</if>
<if test="sysCtime != null">#{sysCtime},</if>
<if test="sysUtime != null">#{sysUtime},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="deleteFlag != null">#{deleteFlag},</if>
</trim>
</insert>
<update id="updateInfoMarketInformation" parameterType="com.chinagas.modules.insight.domian.InfoMarketInformation">
update info_market_information
<trim prefix="SET" suffixOverrides=",">
<if test="title != null and title != ''">title = #{title},</if>
<if test="organizeId != null and organizeId != ''">organize_id = #{organizeId},</if>
<if test="organizeName != null and organizeName != ''">organize_name = #{organizeName},</if>
<if test="pictureUrl != null and pictureUrl != ''">picture_url = #{pictureUrl},</if>
<if test="address != null and address != ''">address = #{address},</if>
<if test="plateName != null">plate_name = #{plateName},</if>
<if test="keyword != null">keyword = #{keyword},</if>
<if test="publishTime != null">publish_time = #{publishTime},</if>
<if test="submitTime != null">submit_time = #{submitTime},</if>
<if test="details != null and details != ''">details = #{details},</if>
<if test="publishStatus != null">publish_status = #{publishStatus},</if>
<if test="sysCtime != null">sys_ctime = #{sysCtime},</if>
<if test="sysUtime != null">sys_utime = #{sysUtime},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="deleteFlag != null">delete_flag = #{deleteFlag},</if>
</trim>
where info_id = #{infoId}
</update>
<delete id="deleteInfoMarketInformationByInfoId" parameterType="Long">
delete
from info_market_information
where info_id = #{infoId}
</delete>
<delete id="deleteInfoMarketInformationByInfoIds" parameterType="String">
update info_market_information set delete_flag = 1
where info_id in
<foreach item="infoId" collection="array" open="(" separator="," close=")">
#{infoId}
</foreach>
</delete>
<insert id="insertOrUpdate" parameterType="com.chinagas.modules.insight.domian.InfoMarketInformation">
insert into info_market_information(title,
organize_id,
organize_name,
picture_url,
address,
plate_name,
keyword,
publish_time,
submit_time,
details,
create_by) value
( #{title},
#{organizeId},
#{organizeName},
#{pictureUrl},
#{address},
#{plateName},
#{keyword},
#{publishTime},
#{submitTime},
#{details},
#{createBy}
)
ON DUPLICATE KEY
UPDATE
TITLE = #{title},
ORGANIZE_ID = #{organizeId},
ORGANIZE_NAME = #{organizeName},
PICTURE_URL = #{pictureUrl},
ADDRESS = #{address},
PLATE_NAME = #{plateName},
KEYWORD = #{keyword},
PUBLISH_TIME = #{publishTime},
SUBMIT_TIME = #{submitTime},
DETAILS = #{details},
CREATE_BY = #{createBy}
</insert>
</mapper>