JtBusinessProjectMapper.xml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487
  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.goafanti.common.dao.JtBusinessProjectMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.JtBusinessProject">
  5. <!--
  6. WARNING - @mbg.generated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Wed Jun 20 11:08:54 CST 2018.
  9. -->
  10. <id column="id" jdbcType="VARCHAR" property="id" />
  11. <result column="name" jdbcType="VARCHAR" property="name" />
  12. <result column="category_id" jdbcType="VARCHAR" property="categoryId" />
  13. <result column="number" jdbcType="VARCHAR" property="number" />
  14. <result column="price" jdbcType="DECIMAL" property="price" />
  15. <result column="activity_price" jdbcType="DECIMAL" property="activityPrice" />
  16. <result column="member_price" jdbcType="DECIMAL" property="memberPrice" />
  17. <result column="offset" jdbcType="REAL" property="offset" />
  18. <result column="activity_flag" jdbcType="INTEGER" property="activityFlag" />
  19. <result column="introduce" jdbcType="VARCHAR" property="introduce" />
  20. <result column="province" jdbcType="INTEGER" property="province" />
  21. <result column="city" jdbcType="INTEGER" property="city" />
  22. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  23. <result column="min_img_url" jdbcType="VARCHAR" property="minImgUrl" />
  24. <result column="max_img_url" jdbcType="VARCHAR" property="maxImgUrl" />
  25. <result column="value" jdbcType="VARCHAR" property="value" />
  26. <result column="apply_conditions" jdbcType="VARCHAR" property="applyConditions" />
  27. </resultMap>
  28. <sql id="Example_Where_Clause">
  29. <!--
  30. WARNING - @mbg.generated
  31. This element is automatically generated by MyBatis Generator, do not modify.
  32. This element was generated on Wed Jun 20 11:08:54 CST 2018.
  33. -->
  34. <where>
  35. <foreach collection="oredCriteria" item="criteria" separator="or">
  36. <if test="criteria.valid">
  37. <trim prefix="(" prefixOverrides="and" suffix=")">
  38. <foreach collection="criteria.criteria" item="criterion">
  39. <choose>
  40. <when test="criterion.noValue">
  41. and ${criterion.condition}
  42. </when>
  43. <when test="criterion.singleValue">
  44. and ${criterion.condition} #{criterion.value}
  45. </when>
  46. <when test="criterion.betweenValue">
  47. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  48. </when>
  49. <when test="criterion.listValue">
  50. and ${criterion.condition}
  51. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  52. #{listItem}
  53. </foreach>
  54. </when>
  55. </choose>
  56. </foreach>
  57. </trim>
  58. </if>
  59. </foreach>
  60. </where>
  61. </sql>
  62. <sql id="Update_By_Example_Where_Clause">
  63. <!--
  64. WARNING - @mbg.generated
  65. This element is automatically generated by MyBatis Generator, do not modify.
  66. This element was generated on Wed Jun 20 11:08:54 CST 2018.
  67. -->
  68. <where>
  69. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  70. <if test="criteria.valid">
  71. <trim prefix="(" prefixOverrides="and" suffix=")">
  72. <foreach collection="criteria.criteria" item="criterion">
  73. <choose>
  74. <when test="criterion.noValue">
  75. and ${criterion.condition}
  76. </when>
  77. <when test="criterion.singleValue">
  78. and ${criterion.condition} #{criterion.value}
  79. </when>
  80. <when test="criterion.betweenValue">
  81. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  82. </when>
  83. <when test="criterion.listValue">
  84. and ${criterion.condition}
  85. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  86. #{listItem}
  87. </foreach>
  88. </when>
  89. </choose>
  90. </foreach>
  91. </trim>
  92. </if>
  93. </foreach>
  94. </where>
  95. </sql>
  96. <sql id="Base_Column_List">
  97. <!--
  98. WARNING - @mbg.generated
  99. This element is automatically generated by MyBatis Generator, do not modify.
  100. This element was generated on Wed Jun 20 11:08:54 CST 2018.
  101. -->
  102. id, name, category_id, number, price, activity_price, member_price, offset, activity_flag,
  103. introduce, province, city, create_time, min_img_url, max_img_url, value, apply_conditions
  104. </sql>
  105. <select id="selectByExample" parameterType="com.goafanti.common.model.JtBusinessProjectExample" resultMap="BaseResultMap">
  106. <!--
  107. WARNING - @mbg.generated
  108. This element is automatically generated by MyBatis Generator, do not modify.
  109. This element was generated on Wed Jun 20 11:08:54 CST 2018.
  110. -->
  111. select
  112. <if test="distinct">
  113. distinct
  114. </if>
  115. <include refid="Base_Column_List" />
  116. from jt_business_project
  117. <if test="_parameter != null">
  118. <include refid="Example_Where_Clause" />
  119. </if>
  120. <if test="orderByClause != null">
  121. order by ${orderByClause}
  122. </if>
  123. </select>
  124. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  125. <!--
  126. WARNING - @mbg.generated
  127. This element is automatically generated by MyBatis Generator, do not modify.
  128. This element was generated on Wed Jun 20 11:08:54 CST 2018.
  129. -->
  130. select
  131. <include refid="Base_Column_List" />
  132. from jt_business_project
  133. where id = #{id,jdbcType=VARCHAR}
  134. </select>
  135. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  136. <!--
  137. WARNING - @mbg.generated
  138. This element is automatically generated by MyBatis Generator, do not modify.
  139. This element was generated on Wed Jun 20 11:08:54 CST 2018.
  140. -->
  141. delete from jt_business_project
  142. where id = #{id,jdbcType=VARCHAR}
  143. </delete>
  144. <delete id="deleteByExample" parameterType="com.goafanti.common.model.JtBusinessProjectExample">
  145. <!--
  146. WARNING - @mbg.generated
  147. This element is automatically generated by MyBatis Generator, do not modify.
  148. This element was generated on Wed Jun 20 11:08:54 CST 2018.
  149. -->
  150. delete from jt_business_project
  151. <if test="_parameter != null">
  152. <include refid="Example_Where_Clause" />
  153. </if>
  154. </delete>
  155. <insert id="insert" parameterType="com.goafanti.common.model.JtBusinessProject">
  156. <!--
  157. WARNING - @mbg.generated
  158. This element is automatically generated by MyBatis Generator, do not modify.
  159. This element was generated on Wed Jun 20 11:08:54 CST 2018.
  160. -->
  161. insert into jt_business_project (id, name, category_id,
  162. number, price, activity_price,
  163. member_price, offset, activity_flag,
  164. introduce, province, city,
  165. create_time, min_img_url, max_img_url,
  166. value, apply_conditions)
  167. values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{categoryId,jdbcType=VARCHAR},
  168. #{number,jdbcType=VARCHAR}, #{price,jdbcType=DECIMAL}, #{activityPrice,jdbcType=DECIMAL},
  169. #{memberPrice,jdbcType=DECIMAL}, #{offset,jdbcType=REAL}, #{activityFlag,jdbcType=INTEGER},
  170. #{introduce,jdbcType=VARCHAR}, #{province,jdbcType=INTEGER}, #{city,jdbcType=INTEGER},
  171. #{createTime,jdbcType=TIMESTAMP}, #{minImgUrl,jdbcType=VARCHAR}, #{maxImgUrl,jdbcType=VARCHAR},
  172. #{value,jdbcType=VARCHAR}, #{applyConditions,jdbcType=VARCHAR})
  173. </insert>
  174. <insert id="insertSelective" parameterType="com.goafanti.common.model.JtBusinessProject">
  175. <!--
  176. WARNING - @mbg.generated
  177. This element is automatically generated by MyBatis Generator, do not modify.
  178. This element was generated on Wed Jun 20 11:08:54 CST 2018.
  179. -->
  180. insert into jt_business_project
  181. <trim prefix="(" suffix=")" suffixOverrides=",">
  182. <if test="id != null">
  183. id,
  184. </if>
  185. <if test="name != null">
  186. name,
  187. </if>
  188. <if test="categoryId != null">
  189. category_id,
  190. </if>
  191. <if test="number != null">
  192. number,
  193. </if>
  194. <if test="price != null">
  195. price,
  196. </if>
  197. <if test="activityPrice != null">
  198. activity_price,
  199. </if>
  200. <if test="memberPrice != null">
  201. member_price,
  202. </if>
  203. <if test="offset != null">
  204. offset,
  205. </if>
  206. <if test="activityFlag != null">
  207. activity_flag,
  208. </if>
  209. <if test="introduce != null">
  210. introduce,
  211. </if>
  212. <if test="province != null">
  213. province,
  214. </if>
  215. <if test="city != null">
  216. city,
  217. </if>
  218. <if test="createTime != null">
  219. create_time,
  220. </if>
  221. <if test="minImgUrl != null">
  222. min_img_url,
  223. </if>
  224. <if test="maxImgUrl != null">
  225. max_img_url,
  226. </if>
  227. <if test="value != null">
  228. value,
  229. </if>
  230. <if test="applyConditions != null">
  231. apply_conditions,
  232. </if>
  233. </trim>
  234. <trim prefix="values (" suffix=")" suffixOverrides=",">
  235. <if test="id != null">
  236. #{id,jdbcType=VARCHAR},
  237. </if>
  238. <if test="name != null">
  239. #{name,jdbcType=VARCHAR},
  240. </if>
  241. <if test="categoryId != null">
  242. #{categoryId,jdbcType=VARCHAR},
  243. </if>
  244. <if test="number != null">
  245. #{number,jdbcType=VARCHAR},
  246. </if>
  247. <if test="price != null">
  248. #{price,jdbcType=DECIMAL},
  249. </if>
  250. <if test="activityPrice != null">
  251. #{activityPrice,jdbcType=DECIMAL},
  252. </if>
  253. <if test="memberPrice != null">
  254. #{memberPrice,jdbcType=DECIMAL},
  255. </if>
  256. <if test="offset != null">
  257. #{offset,jdbcType=REAL},
  258. </if>
  259. <if test="activityFlag != null">
  260. #{activityFlag,jdbcType=INTEGER},
  261. </if>
  262. <if test="introduce != null">
  263. #{introduce,jdbcType=VARCHAR},
  264. </if>
  265. <if test="province != null">
  266. #{province,jdbcType=INTEGER},
  267. </if>
  268. <if test="city != null">
  269. #{city,jdbcType=INTEGER},
  270. </if>
  271. <if test="createTime != null">
  272. #{createTime,jdbcType=TIMESTAMP},
  273. </if>
  274. <if test="minImgUrl != null">
  275. #{minImgUrl,jdbcType=VARCHAR},
  276. </if>
  277. <if test="maxImgUrl != null">
  278. #{maxImgUrl,jdbcType=VARCHAR},
  279. </if>
  280. <if test="value != null">
  281. #{value,jdbcType=VARCHAR},
  282. </if>
  283. <if test="applyConditions != null">
  284. #{applyConditions,jdbcType=VARCHAR},
  285. </if>
  286. </trim>
  287. </insert>
  288. <select id="countByExample" parameterType="com.goafanti.common.model.JtBusinessProjectExample" resultType="java.lang.Long">
  289. <!--
  290. WARNING - @mbg.generated
  291. This element is automatically generated by MyBatis Generator, do not modify.
  292. This element was generated on Wed Jun 20 11:08:54 CST 2018.
  293. -->
  294. select count(*) from jt_business_project
  295. <if test="_parameter != null">
  296. <include refid="Example_Where_Clause" />
  297. </if>
  298. </select>
  299. <update id="updateByExampleSelective" parameterType="map">
  300. <!--
  301. WARNING - @mbg.generated
  302. This element is automatically generated by MyBatis Generator, do not modify.
  303. This element was generated on Wed Jun 20 11:08:54 CST 2018.
  304. -->
  305. update jt_business_project
  306. <set>
  307. <if test="record.id != null">
  308. id = #{record.id,jdbcType=VARCHAR},
  309. </if>
  310. <if test="record.name != null">
  311. name = #{record.name,jdbcType=VARCHAR},
  312. </if>
  313. <if test="record.categoryId != null">
  314. category_id = #{record.categoryId,jdbcType=VARCHAR},
  315. </if>
  316. <if test="record.number != null">
  317. number = #{record.number,jdbcType=VARCHAR},
  318. </if>
  319. <if test="record.price != null">
  320. price = #{record.price,jdbcType=DECIMAL},
  321. </if>
  322. <if test="record.activityPrice != null">
  323. activity_price = #{record.activityPrice,jdbcType=DECIMAL},
  324. </if>
  325. <if test="record.memberPrice != null">
  326. member_price = #{record.memberPrice,jdbcType=DECIMAL},
  327. </if>
  328. <if test="record.offset != null">
  329. offset = #{record.offset,jdbcType=REAL},
  330. </if>
  331. <if test="record.activityFlag != null">
  332. activity_flag = #{record.activityFlag,jdbcType=INTEGER},
  333. </if>
  334. <if test="record.introduce != null">
  335. introduce = #{record.introduce,jdbcType=VARCHAR},
  336. </if>
  337. <if test="record.province != null">
  338. province = #{record.province,jdbcType=INTEGER},
  339. </if>
  340. <if test="record.city != null">
  341. city = #{record.city,jdbcType=INTEGER},
  342. </if>
  343. <if test="record.createTime != null">
  344. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  345. </if>
  346. <if test="record.minImgUrl != null">
  347. min_img_url = #{record.minImgUrl,jdbcType=VARCHAR},
  348. </if>
  349. <if test="record.maxImgUrl != null">
  350. max_img_url = #{record.maxImgUrl,jdbcType=VARCHAR},
  351. </if>
  352. <if test="record.value != null">
  353. value = #{record.value,jdbcType=VARCHAR},
  354. </if>
  355. <if test="record.applyConditions != null">
  356. apply_conditions = #{record.applyConditions,jdbcType=VARCHAR},
  357. </if>
  358. </set>
  359. <if test="_parameter != null">
  360. <include refid="Update_By_Example_Where_Clause" />
  361. </if>
  362. </update>
  363. <update id="updateByExample" parameterType="map">
  364. <!--
  365. WARNING - @mbg.generated
  366. This element is automatically generated by MyBatis Generator, do not modify.
  367. This element was generated on Wed Jun 20 11:08:54 CST 2018.
  368. -->
  369. update jt_business_project
  370. set id = #{record.id,jdbcType=VARCHAR},
  371. name = #{record.name,jdbcType=VARCHAR},
  372. category_id = #{record.categoryId,jdbcType=VARCHAR},
  373. number = #{record.number,jdbcType=VARCHAR},
  374. price = #{record.price,jdbcType=DECIMAL},
  375. activity_price = #{record.activityPrice,jdbcType=DECIMAL},
  376. member_price = #{record.memberPrice,jdbcType=DECIMAL},
  377. offset = #{record.offset,jdbcType=REAL},
  378. activity_flag = #{record.activityFlag,jdbcType=INTEGER},
  379. introduce = #{record.introduce,jdbcType=VARCHAR},
  380. province = #{record.province,jdbcType=INTEGER},
  381. city = #{record.city,jdbcType=INTEGER},
  382. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  383. min_img_url = #{record.minImgUrl,jdbcType=VARCHAR},
  384. max_img_url = #{record.maxImgUrl,jdbcType=VARCHAR},
  385. value = #{record.value,jdbcType=VARCHAR},
  386. apply_conditions = #{record.applyConditions,jdbcType=VARCHAR}
  387. <if test="_parameter != null">
  388. <include refid="Update_By_Example_Where_Clause" />
  389. </if>
  390. </update>
  391. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.JtBusinessProject">
  392. <!--
  393. WARNING - @mbg.generated
  394. This element is automatically generated by MyBatis Generator, do not modify.
  395. This element was generated on Wed Jun 20 11:08:54 CST 2018.
  396. -->
  397. update jt_business_project
  398. <set>
  399. <if test="name != null">
  400. name = #{name,jdbcType=VARCHAR},
  401. </if>
  402. <if test="categoryId != null">
  403. category_id = #{categoryId,jdbcType=VARCHAR},
  404. </if>
  405. <if test="number != null">
  406. number = #{number,jdbcType=VARCHAR},
  407. </if>
  408. <if test="price != null">
  409. price = #{price,jdbcType=DECIMAL},
  410. </if>
  411. <if test="activityPrice != null">
  412. activity_price = #{activityPrice,jdbcType=DECIMAL},
  413. </if>
  414. <if test="memberPrice != null">
  415. member_price = #{memberPrice,jdbcType=DECIMAL},
  416. </if>
  417. <if test="offset != null">
  418. offset = #{offset,jdbcType=REAL},
  419. </if>
  420. <if test="activityFlag != null">
  421. activity_flag = #{activityFlag,jdbcType=INTEGER},
  422. </if>
  423. <if test="introduce != null">
  424. introduce = #{introduce,jdbcType=VARCHAR},
  425. </if>
  426. <if test="province != null">
  427. province = #{province,jdbcType=INTEGER},
  428. </if>
  429. <if test="city != null">
  430. city = #{city,jdbcType=INTEGER},
  431. </if>
  432. <if test="createTime != null">
  433. create_time = #{createTime,jdbcType=TIMESTAMP},
  434. </if>
  435. <if test="minImgUrl != null">
  436. min_img_url = #{minImgUrl,jdbcType=VARCHAR},
  437. </if>
  438. <if test="maxImgUrl != null">
  439. max_img_url = #{maxImgUrl,jdbcType=VARCHAR},
  440. </if>
  441. <if test="value != null">
  442. value = #{value,jdbcType=VARCHAR},
  443. </if>
  444. <if test="applyConditions != null">
  445. apply_conditions = #{applyConditions,jdbcType=VARCHAR},
  446. </if>
  447. </set>
  448. where id = #{id,jdbcType=VARCHAR}
  449. </update>
  450. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.JtBusinessProject">
  451. <!--
  452. WARNING - @mbg.generated
  453. This element is automatically generated by MyBatis Generator, do not modify.
  454. This element was generated on Wed Jun 20 11:08:54 CST 2018.
  455. -->
  456. update jt_business_project
  457. set name = #{name,jdbcType=VARCHAR},
  458. category_id = #{categoryId,jdbcType=VARCHAR},
  459. number = #{number,jdbcType=VARCHAR},
  460. price = #{price,jdbcType=DECIMAL},
  461. activity_price = #{activityPrice,jdbcType=DECIMAL},
  462. member_price = #{memberPrice,jdbcType=DECIMAL},
  463. offset = #{offset,jdbcType=REAL},
  464. activity_flag = #{activityFlag,jdbcType=INTEGER},
  465. introduce = #{introduce,jdbcType=VARCHAR},
  466. province = #{province,jdbcType=INTEGER},
  467. city = #{city,jdbcType=INTEGER},
  468. create_time = #{createTime,jdbcType=TIMESTAMP},
  469. min_img_url = #{minImgUrl,jdbcType=VARCHAR},
  470. max_img_url = #{maxImgUrl,jdbcType=VARCHAR},
  471. value = #{value,jdbcType=VARCHAR},
  472. apply_conditions = #{applyConditions,jdbcType=VARCHAR}
  473. where id = #{id,jdbcType=VARCHAR}
  474. </update>
  475. <select id="getBusinessProjectByCategoryId" resultType="com.goafanti.common.model.JtBusinessProject">
  476. select
  477. id,
  478. name,
  479. introduce
  480. from
  481. jt_business_project
  482. where
  483. category_id=#{0}
  484. limit #{1}
  485. </select>
  486. </mapper>