MerchantDOMapper.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.cdu.lys.graduation.repository.dao.MerchantDOMapper" >
  4. <resultMap id="BaseResultMap" type="com.cdu.lys.graduation.repository.entity.MerchantDO" >
  5. <constructor >
  6. <idArg column="id" jdbcType="INTEGER" javaType="java.lang.Integer" />
  7. <arg column="store_name" jdbcType="VARCHAR" javaType="java.lang.String" />
  8. <arg column="header_url" jdbcType="VARCHAR" javaType="java.lang.String" />
  9. <arg column="description" jdbcType="VARCHAR" javaType="java.lang.String" />
  10. <arg column="business_time" jdbcType="VARCHAR" javaType="java.lang.String" />
  11. <arg column="province" jdbcType="VARCHAR" javaType="java.lang.String" />
  12. <arg column="city" jdbcType="VARCHAR" javaType="java.lang.String" />
  13. <arg column="district" jdbcType="VARCHAR" javaType="java.lang.String" />
  14. <arg column="address" jdbcType="VARCHAR" javaType="java.lang.String" />
  15. <arg column="phone" jdbcType="VARCHAR" javaType="java.lang.String" />
  16. <arg column="announcement" jdbcType="VARCHAR" javaType="java.lang.String" />
  17. <arg column="score" jdbcType="DOUBLE" javaType="java.lang.Double" />
  18. <arg column="is_auto_reply" jdbcType="VARCHAR" javaType="java.lang.String" />
  19. <arg column="auto_reply_content" jdbcType="VARCHAR" javaType="java.lang.String" />
  20. <arg column="create_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
  21. <arg column="update_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
  22. <arg column="is_delete" jdbcType="CHAR" javaType="java.lang.String" />
  23. </constructor>
  24. </resultMap>
  25. <sql id="Example_Where_Clause" >
  26. <where >
  27. <foreach collection="oredCriteria" item="criteria" separator="or" >
  28. <if test="criteria.valid" >
  29. <trim prefix="(" suffix=")" prefixOverrides="and" >
  30. <foreach collection="criteria.criteria" item="criterion" >
  31. <choose >
  32. <when test="criterion.noValue" >
  33. and ${criterion.condition}
  34. </when>
  35. <when test="criterion.singleValue" >
  36. and ${criterion.condition} #{criterion.value}
  37. </when>
  38. <when test="criterion.betweenValue" >
  39. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  40. </when>
  41. <when test="criterion.listValue" >
  42. and ${criterion.condition}
  43. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  44. #{listItem}
  45. </foreach>
  46. </when>
  47. </choose>
  48. </foreach>
  49. </trim>
  50. </if>
  51. </foreach>
  52. </where>
  53. </sql>
  54. <sql id="Update_By_Example_Where_Clause" >
  55. <where >
  56. <foreach collection="example.oredCriteria" item="criteria" separator="or" >
  57. <if test="criteria.valid" >
  58. <trim prefix="(" suffix=")" prefixOverrides="and" >
  59. <foreach collection="criteria.criteria" item="criterion" >
  60. <choose >
  61. <when test="criterion.noValue" >
  62. and ${criterion.condition}
  63. </when>
  64. <when test="criterion.singleValue" >
  65. and ${criterion.condition} #{criterion.value}
  66. </when>
  67. <when test="criterion.betweenValue" >
  68. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  69. </when>
  70. <when test="criterion.listValue" >
  71. and ${criterion.condition}
  72. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  73. #{listItem}
  74. </foreach>
  75. </when>
  76. </choose>
  77. </foreach>
  78. </trim>
  79. </if>
  80. </foreach>
  81. </where>
  82. </sql>
  83. <sql id="Base_Column_List" >
  84. id, store_name, header_url, description, business_time, province, city, district,
  85. address, phone, announcement, score, is_auto_reply, auto_reply_content, create_time,
  86. update_time, is_delete
  87. </sql>
  88. <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.cdu.lys.graduation.repository.entity.MerchantDOExample" >
  89. select
  90. <if test="distinct" >
  91. distinct
  92. </if>
  93. 'true' as QUERYID,
  94. <include refid="Base_Column_List" />
  95. from tb_merchant
  96. <if test="_parameter != null" >
  97. <include refid="Example_Where_Clause" />
  98. </if>
  99. <if test="orderByClause != null" >
  100. order by ${orderByClause}
  101. </if>
  102. </select>
  103. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  104. select
  105. <include refid="Base_Column_List" />
  106. from tb_merchant
  107. where id = #{id,jdbcType=INTEGER}
  108. </select>
  109. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  110. delete from tb_merchant
  111. where id = #{id,jdbcType=INTEGER}
  112. </delete>
  113. <delete id="deleteByExample" parameterType="com.cdu.lys.graduation.repository.entity.MerchantDOExample" >
  114. delete from tb_merchant
  115. <if test="_parameter != null" >
  116. <include refid="Example_Where_Clause" />
  117. </if>
  118. </delete>
  119. <insert id="insert" parameterType="com.cdu.lys.graduation.repository.entity.MerchantDO" >
  120. <selectKey resultType="java.lang.Integer" keyProperty="id" order="AFTER" >
  121. SELECT LAST_INSERT_ID()
  122. </selectKey>
  123. insert into tb_merchant (store_name, header_url, description,
  124. business_time, province, city,
  125. district, address, phone,
  126. announcement, score, is_auto_reply,
  127. auto_reply_content, create_time, update_time,
  128. is_delete)
  129. values (#{storeName,jdbcType=VARCHAR}, #{headerUrl,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR},
  130. #{businessTime,jdbcType=VARCHAR}, #{province,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR},
  131. #{district,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR},
  132. #{announcement,jdbcType=VARCHAR}, #{score,jdbcType=DOUBLE}, #{isAutoReply,jdbcType=VARCHAR},
  133. #{autoReplyContent,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
  134. #{isDelete,jdbcType=CHAR})
  135. </insert>
  136. <insert id="insertSelective" parameterType="com.cdu.lys.graduation.repository.entity.MerchantDO" >
  137. <selectKey resultType="java.lang.Integer" keyProperty="id" order="AFTER" >
  138. SELECT LAST_INSERT_ID()
  139. </selectKey>
  140. insert into tb_merchant
  141. <trim prefix="(" suffix=")" suffixOverrides="," >
  142. <if test="storeName != null" >
  143. store_name,
  144. </if>
  145. <if test="headerUrl != null" >
  146. header_url,
  147. </if>
  148. <if test="description != null" >
  149. description,
  150. </if>
  151. <if test="businessTime != null" >
  152. business_time,
  153. </if>
  154. <if test="province != null" >
  155. province,
  156. </if>
  157. <if test="city != null" >
  158. city,
  159. </if>
  160. <if test="district != null" >
  161. district,
  162. </if>
  163. <if test="address != null" >
  164. address,
  165. </if>
  166. <if test="phone != null" >
  167. phone,
  168. </if>
  169. <if test="announcement != null" >
  170. announcement,
  171. </if>
  172. <if test="score != null" >
  173. score,
  174. </if>
  175. <if test="isAutoReply != null" >
  176. is_auto_reply,
  177. </if>
  178. <if test="autoReplyContent != null" >
  179. auto_reply_content,
  180. </if>
  181. <if test="createTime != null" >
  182. create_time,
  183. </if>
  184. <if test="updateTime != null" >
  185. update_time,
  186. </if>
  187. <if test="isDelete != null" >
  188. is_delete,
  189. </if>
  190. </trim>
  191. <trim prefix="values (" suffix=")" suffixOverrides="," >
  192. <if test="storeName != null" >
  193. #{storeName,jdbcType=VARCHAR},
  194. </if>
  195. <if test="headerUrl != null" >
  196. #{headerUrl,jdbcType=VARCHAR},
  197. </if>
  198. <if test="description != null" >
  199. #{description,jdbcType=VARCHAR},
  200. </if>
  201. <if test="businessTime != null" >
  202. #{businessTime,jdbcType=VARCHAR},
  203. </if>
  204. <if test="province != null" >
  205. #{province,jdbcType=VARCHAR},
  206. </if>
  207. <if test="city != null" >
  208. #{city,jdbcType=VARCHAR},
  209. </if>
  210. <if test="district != null" >
  211. #{district,jdbcType=VARCHAR},
  212. </if>
  213. <if test="address != null" >
  214. #{address,jdbcType=VARCHAR},
  215. </if>
  216. <if test="phone != null" >
  217. #{phone,jdbcType=VARCHAR},
  218. </if>
  219. <if test="announcement != null" >
  220. #{announcement,jdbcType=VARCHAR},
  221. </if>
  222. <if test="score != null" >
  223. #{score,jdbcType=DOUBLE},
  224. </if>
  225. <if test="isAutoReply != null" >
  226. #{isAutoReply,jdbcType=VARCHAR},
  227. </if>
  228. <if test="autoReplyContent != null" >
  229. #{autoReplyContent,jdbcType=VARCHAR},
  230. </if>
  231. <if test="createTime != null" >
  232. #{createTime,jdbcType=TIMESTAMP},
  233. </if>
  234. <if test="updateTime != null" >
  235. #{updateTime,jdbcType=TIMESTAMP},
  236. </if>
  237. <if test="isDelete != null" >
  238. #{isDelete,jdbcType=CHAR},
  239. </if>
  240. </trim>
  241. </insert>
  242. <select id="countByExample" parameterType="com.cdu.lys.graduation.repository.entity.MerchantDOExample" resultType="java.lang.Integer" >
  243. select count(*) from tb_merchant
  244. <if test="_parameter != null" >
  245. <include refid="Example_Where_Clause" />
  246. </if>
  247. </select>
  248. <update id="updateByExampleSelective" parameterType="map" >
  249. update tb_merchant
  250. <set >
  251. <if test="record.id != null" >
  252. id = #{record.id,jdbcType=INTEGER},
  253. </if>
  254. <if test="record.storeName != null" >
  255. store_name = #{record.storeName,jdbcType=VARCHAR},
  256. </if>
  257. <if test="record.headerUrl != null" >
  258. header_url = #{record.headerUrl,jdbcType=VARCHAR},
  259. </if>
  260. <if test="record.description != null" >
  261. description = #{record.description,jdbcType=VARCHAR},
  262. </if>
  263. <if test="record.businessTime != null" >
  264. business_time = #{record.businessTime,jdbcType=VARCHAR},
  265. </if>
  266. <if test="record.province != null" >
  267. province = #{record.province,jdbcType=VARCHAR},
  268. </if>
  269. <if test="record.city != null" >
  270. city = #{record.city,jdbcType=VARCHAR},
  271. </if>
  272. <if test="record.district != null" >
  273. district = #{record.district,jdbcType=VARCHAR},
  274. </if>
  275. <if test="record.address != null" >
  276. address = #{record.address,jdbcType=VARCHAR},
  277. </if>
  278. <if test="record.phone != null" >
  279. phone = #{record.phone,jdbcType=VARCHAR},
  280. </if>
  281. <if test="record.announcement != null" >
  282. announcement = #{record.announcement,jdbcType=VARCHAR},
  283. </if>
  284. <if test="record.score != null" >
  285. score = #{record.score,jdbcType=DOUBLE},
  286. </if>
  287. <if test="record.isAutoReply != null" >
  288. is_auto_reply = #{record.isAutoReply,jdbcType=VARCHAR},
  289. </if>
  290. <if test="record.autoReplyContent != null" >
  291. auto_reply_content = #{record.autoReplyContent,jdbcType=VARCHAR},
  292. </if>
  293. <if test="record.createTime != null" >
  294. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  295. </if>
  296. <if test="record.updateTime != null" >
  297. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  298. </if>
  299. <if test="record.isDelete != null" >
  300. is_delete = #{record.isDelete,jdbcType=CHAR},
  301. </if>
  302. </set>
  303. <if test="_parameter != null" >
  304. <include refid="Update_By_Example_Where_Clause" />
  305. </if>
  306. </update>
  307. <update id="updateByExample" parameterType="map" >
  308. update tb_merchant
  309. set id = #{record.id,jdbcType=INTEGER},
  310. store_name = #{record.storeName,jdbcType=VARCHAR},
  311. header_url = #{record.headerUrl,jdbcType=VARCHAR},
  312. description = #{record.description,jdbcType=VARCHAR},
  313. business_time = #{record.businessTime,jdbcType=VARCHAR},
  314. province = #{record.province,jdbcType=VARCHAR},
  315. city = #{record.city,jdbcType=VARCHAR},
  316. district = #{record.district,jdbcType=VARCHAR},
  317. address = #{record.address,jdbcType=VARCHAR},
  318. phone = #{record.phone,jdbcType=VARCHAR},
  319. announcement = #{record.announcement,jdbcType=VARCHAR},
  320. score = #{record.score,jdbcType=DOUBLE},
  321. is_auto_reply = #{record.isAutoReply,jdbcType=VARCHAR},
  322. auto_reply_content = #{record.autoReplyContent,jdbcType=VARCHAR},
  323. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  324. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  325. is_delete = #{record.isDelete,jdbcType=CHAR}
  326. <if test="_parameter != null" >
  327. <include refid="Update_By_Example_Where_Clause" />
  328. </if>
  329. </update>
  330. <update id="updateByPrimaryKeySelective" parameterType="com.cdu.lys.graduation.repository.entity.MerchantDO" >
  331. update tb_merchant
  332. <set >
  333. <if test="storeName != null" >
  334. store_name = #{storeName,jdbcType=VARCHAR},
  335. </if>
  336. <if test="headerUrl != null" >
  337. header_url = #{headerUrl,jdbcType=VARCHAR},
  338. </if>
  339. <if test="description != null" >
  340. description = #{description,jdbcType=VARCHAR},
  341. </if>
  342. <if test="businessTime != null" >
  343. business_time = #{businessTime,jdbcType=VARCHAR},
  344. </if>
  345. <if test="province != null" >
  346. province = #{province,jdbcType=VARCHAR},
  347. </if>
  348. <if test="city != null" >
  349. city = #{city,jdbcType=VARCHAR},
  350. </if>
  351. <if test="district != null" >
  352. district = #{district,jdbcType=VARCHAR},
  353. </if>
  354. <if test="address != null" >
  355. address = #{address,jdbcType=VARCHAR},
  356. </if>
  357. <if test="phone != null" >
  358. phone = #{phone,jdbcType=VARCHAR},
  359. </if>
  360. <if test="announcement != null" >
  361. announcement = #{announcement,jdbcType=VARCHAR},
  362. </if>
  363. <if test="score != null" >
  364. score = #{score,jdbcType=DOUBLE},
  365. </if>
  366. <if test="isAutoReply != null" >
  367. is_auto_reply = #{isAutoReply,jdbcType=VARCHAR},
  368. </if>
  369. <if test="autoReplyContent != null" >
  370. auto_reply_content = #{autoReplyContent,jdbcType=VARCHAR},
  371. </if>
  372. <if test="createTime != null" >
  373. create_time = #{createTime,jdbcType=TIMESTAMP},
  374. </if>
  375. <if test="updateTime != null" >
  376. update_time = #{updateTime,jdbcType=TIMESTAMP},
  377. </if>
  378. <if test="isDelete != null" >
  379. is_delete = #{isDelete,jdbcType=CHAR},
  380. </if>
  381. </set>
  382. where id = #{id,jdbcType=INTEGER}
  383. </update>
  384. <update id="updateByPrimaryKey" parameterType="com.cdu.lys.graduation.repository.entity.MerchantDO" >
  385. update tb_merchant
  386. set store_name = #{storeName,jdbcType=VARCHAR},
  387. header_url = #{headerUrl,jdbcType=VARCHAR},
  388. description = #{description,jdbcType=VARCHAR},
  389. business_time = #{businessTime,jdbcType=VARCHAR},
  390. province = #{province,jdbcType=VARCHAR},
  391. city = #{city,jdbcType=VARCHAR},
  392. district = #{district,jdbcType=VARCHAR},
  393. address = #{address,jdbcType=VARCHAR},
  394. phone = #{phone,jdbcType=VARCHAR},
  395. announcement = #{announcement,jdbcType=VARCHAR},
  396. score = #{score,jdbcType=DOUBLE},
  397. is_auto_reply = #{isAutoReply,jdbcType=VARCHAR},
  398. auto_reply_content = #{autoReplyContent,jdbcType=VARCHAR},
  399. create_time = #{createTime,jdbcType=TIMESTAMP},
  400. update_time = #{updateTime,jdbcType=TIMESTAMP},
  401. is_delete = #{isDelete,jdbcType=CHAR}
  402. where id = #{id,jdbcType=INTEGER}
  403. </update>
  404. </mapper>