JtBusinessProjectMapper.xml 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743
  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 Aug 01 10:34:40 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. <result column="owner_id" jdbcType="VARCHAR" property="ownerId" />
  28. <result column="is_hot" jdbcType="INTEGER" property="isHot" />
  29. <result column="audit_status" jdbcType="INTEGER" property="auditStatus" />
  30. <result column="audit_info" jdbcType="VARCHAR" property="auditInfo" />
  31. <result column="release_date" jdbcType="TIMESTAMP" property="releaseDate" />
  32. <result column="advertisement" jdbcType="VARCHAR" property="advertisement" />
  33. </resultMap>
  34. <sql id="Example_Where_Clause">
  35. <!--
  36. WARNING - @mbg.generated
  37. This element is automatically generated by MyBatis Generator, do not modify.
  38. This element was generated on Wed Aug 01 10:34:40 CST 2018.
  39. -->
  40. <where>
  41. <foreach collection="oredCriteria" item="criteria" separator="or">
  42. <if test="criteria.valid">
  43. <trim prefix="(" prefixOverrides="and" suffix=")">
  44. <foreach collection="criteria.criteria" item="criterion">
  45. <choose>
  46. <when test="criterion.noValue">
  47. and ${criterion.condition}
  48. </when>
  49. <when test="criterion.singleValue">
  50. and ${criterion.condition} #{criterion.value}
  51. </when>
  52. <when test="criterion.betweenValue">
  53. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  54. </when>
  55. <when test="criterion.listValue">
  56. and ${criterion.condition}
  57. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  58. #{listItem}
  59. </foreach>
  60. </when>
  61. </choose>
  62. </foreach>
  63. </trim>
  64. </if>
  65. </foreach>
  66. </where>
  67. </sql>
  68. <sql id="Update_By_Example_Where_Clause">
  69. <!--
  70. WARNING - @mbg.generated
  71. This element is automatically generated by MyBatis Generator, do not modify.
  72. This element was generated on Wed Aug 01 10:34:40 CST 2018.
  73. -->
  74. <where>
  75. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  76. <if test="criteria.valid">
  77. <trim prefix="(" prefixOverrides="and" suffix=")">
  78. <foreach collection="criteria.criteria" item="criterion">
  79. <choose>
  80. <when test="criterion.noValue">
  81. and ${criterion.condition}
  82. </when>
  83. <when test="criterion.singleValue">
  84. and ${criterion.condition} #{criterion.value}
  85. </when>
  86. <when test="criterion.betweenValue">
  87. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  88. </when>
  89. <when test="criterion.listValue">
  90. and ${criterion.condition}
  91. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  92. #{listItem}
  93. </foreach>
  94. </when>
  95. </choose>
  96. </foreach>
  97. </trim>
  98. </if>
  99. </foreach>
  100. </where>
  101. </sql>
  102. <sql id="Base_Column_List">
  103. <!--
  104. WARNING - @mbg.generated
  105. This element is automatically generated by MyBatis Generator, do not modify.
  106. This element was generated on Wed Aug 01 10:34:40 CST 2018.
  107. -->
  108. id, name, category_id, number, price, activity_price, member_price, offset, activity_flag,
  109. introduce, province, city, create_time, min_img_url, max_img_url, value, apply_conditions,
  110. owner_id, is_hot, audit_status, audit_info, release_date, advertisement
  111. </sql>
  112. <select id="selectByExample" parameterType="com.goafanti.common.model.JtBusinessProjectExample" resultMap="BaseResultMap">
  113. <!--
  114. WARNING - @mbg.generated
  115. This element is automatically generated by MyBatis Generator, do not modify.
  116. This element was generated on Wed Aug 01 10:34:40 CST 2018.
  117. -->
  118. select
  119. <if test="distinct">
  120. distinct
  121. </if>
  122. <include refid="Base_Column_List" />
  123. from jt_business_project
  124. <if test="_parameter != null">
  125. <include refid="Example_Where_Clause" />
  126. </if>
  127. <if test="orderByClause != null">
  128. order by ${orderByClause}
  129. </if>
  130. </select>
  131. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  132. <!--
  133. WARNING - @mbg.generated
  134. This element is automatically generated by MyBatis Generator, do not modify.
  135. This element was generated on Wed Aug 01 10:34:40 CST 2018.
  136. -->
  137. select
  138. <include refid="Base_Column_List" />
  139. from jt_business_project
  140. where id = #{id,jdbcType=VARCHAR}
  141. </select>
  142. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  143. <!--
  144. WARNING - @mbg.generated
  145. This element is automatically generated by MyBatis Generator, do not modify.
  146. This element was generated on Wed Aug 01 10:34:40 CST 2018.
  147. -->
  148. delete from jt_business_project
  149. where id = #{id,jdbcType=VARCHAR}
  150. </delete>
  151. <delete id="deleteByExample" parameterType="com.goafanti.common.model.JtBusinessProjectExample">
  152. <!--
  153. WARNING - @mbg.generated
  154. This element is automatically generated by MyBatis Generator, do not modify.
  155. This element was generated on Wed Aug 01 10:34:40 CST 2018.
  156. -->
  157. delete from jt_business_project
  158. <if test="_parameter != null">
  159. <include refid="Example_Where_Clause" />
  160. </if>
  161. </delete>
  162. <insert id="insert" parameterType="com.goafanti.common.model.JtBusinessProject">
  163. <!--
  164. WARNING - @mbg.generated
  165. This element is automatically generated by MyBatis Generator, do not modify.
  166. This element was generated on Wed Aug 01 10:34:40 CST 2018.
  167. -->
  168. insert into jt_business_project (id, name, category_id,
  169. number, price, activity_price,
  170. member_price, offset, activity_flag,
  171. introduce, province, city,
  172. create_time, min_img_url, max_img_url,
  173. value, apply_conditions, owner_id,
  174. is_hot, audit_status, audit_info,
  175. release_date, advertisement)
  176. values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{categoryId,jdbcType=VARCHAR},
  177. #{number,jdbcType=VARCHAR}, #{price,jdbcType=DECIMAL}, #{activityPrice,jdbcType=DECIMAL},
  178. #{memberPrice,jdbcType=DECIMAL}, #{offset,jdbcType=REAL}, #{activityFlag,jdbcType=INTEGER},
  179. #{introduce,jdbcType=VARCHAR}, #{province,jdbcType=INTEGER}, #{city,jdbcType=INTEGER},
  180. #{createTime,jdbcType=TIMESTAMP}, #{minImgUrl,jdbcType=VARCHAR}, #{maxImgUrl,jdbcType=VARCHAR},
  181. #{value,jdbcType=VARCHAR}, #{applyConditions,jdbcType=VARCHAR}, #{ownerId,jdbcType=VARCHAR},
  182. #{isHot,jdbcType=INTEGER}, #{auditStatus,jdbcType=INTEGER}, #{auditInfo,jdbcType=VARCHAR},
  183. #{releaseDate,jdbcType=TIMESTAMP}, #{advertisement,jdbcType=VARCHAR})
  184. </insert>
  185. <insert id="insertSelective" parameterType="com.goafanti.common.model.JtBusinessProject">
  186. <!--
  187. WARNING - @mbg.generated
  188. This element is automatically generated by MyBatis Generator, do not modify.
  189. This element was generated on Wed Aug 01 10:34:40 CST 2018.
  190. -->
  191. insert into jt_business_project
  192. <trim prefix="(" suffix=")" suffixOverrides=",">
  193. <if test="id != null">
  194. id,
  195. </if>
  196. <if test="name != null">
  197. name,
  198. </if>
  199. <if test="categoryId != null">
  200. category_id,
  201. </if>
  202. <if test="number != null">
  203. number,
  204. </if>
  205. <if test="price != null">
  206. price,
  207. </if>
  208. <if test="activityPrice != null">
  209. activity_price,
  210. </if>
  211. <if test="memberPrice != null">
  212. member_price,
  213. </if>
  214. <if test="offset != null">
  215. offset,
  216. </if>
  217. <if test="activityFlag != null">
  218. activity_flag,
  219. </if>
  220. <if test="introduce != null">
  221. introduce,
  222. </if>
  223. <if test="province != null">
  224. province,
  225. </if>
  226. <if test="city != null">
  227. city,
  228. </if>
  229. <if test="createTime != null">
  230. create_time,
  231. </if>
  232. <if test="minImgUrl != null">
  233. min_img_url,
  234. </if>
  235. <if test="maxImgUrl != null">
  236. max_img_url,
  237. </if>
  238. <if test="value != null">
  239. value,
  240. </if>
  241. <if test="applyConditions != null">
  242. apply_conditions,
  243. </if>
  244. <if test="ownerId != null">
  245. owner_id,
  246. </if>
  247. <if test="isHot != null">
  248. is_hot,
  249. </if>
  250. <if test="auditStatus != null">
  251. audit_status,
  252. </if>
  253. <if test="auditInfo != null">
  254. audit_info,
  255. </if>
  256. <if test="releaseDate != null">
  257. release_date,
  258. </if>
  259. <if test="advertisement != null">
  260. advertisement,
  261. </if>
  262. </trim>
  263. <trim prefix="values (" suffix=")" suffixOverrides=",">
  264. <if test="id != null">
  265. #{id,jdbcType=VARCHAR},
  266. </if>
  267. <if test="name != null">
  268. #{name,jdbcType=VARCHAR},
  269. </if>
  270. <if test="categoryId != null">
  271. #{categoryId,jdbcType=VARCHAR},
  272. </if>
  273. <if test="number != null">
  274. #{number,jdbcType=VARCHAR},
  275. </if>
  276. <if test="price != null">
  277. #{price,jdbcType=DECIMAL},
  278. </if>
  279. <if test="activityPrice != null">
  280. #{activityPrice,jdbcType=DECIMAL},
  281. </if>
  282. <if test="memberPrice != null">
  283. #{memberPrice,jdbcType=DECIMAL},
  284. </if>
  285. <if test="offset != null">
  286. #{offset,jdbcType=REAL},
  287. </if>
  288. <if test="activityFlag != null">
  289. #{activityFlag,jdbcType=INTEGER},
  290. </if>
  291. <if test="introduce != null">
  292. #{introduce,jdbcType=VARCHAR},
  293. </if>
  294. <if test="province != null">
  295. #{province,jdbcType=INTEGER},
  296. </if>
  297. <if test="city != null">
  298. #{city,jdbcType=INTEGER},
  299. </if>
  300. <if test="createTime != null">
  301. #{createTime,jdbcType=TIMESTAMP},
  302. </if>
  303. <if test="minImgUrl != null">
  304. #{minImgUrl,jdbcType=VARCHAR},
  305. </if>
  306. <if test="maxImgUrl != null">
  307. #{maxImgUrl,jdbcType=VARCHAR},
  308. </if>
  309. <if test="value != null">
  310. #{value,jdbcType=VARCHAR},
  311. </if>
  312. <if test="applyConditions != null">
  313. #{applyConditions,jdbcType=VARCHAR},
  314. </if>
  315. <if test="ownerId != null">
  316. #{ownerId,jdbcType=VARCHAR},
  317. </if>
  318. <if test="isHot != null">
  319. #{isHot,jdbcType=INTEGER},
  320. </if>
  321. <if test="auditStatus != null">
  322. #{auditStatus,jdbcType=INTEGER},
  323. </if>
  324. <if test="auditInfo != null">
  325. #{auditInfo,jdbcType=VARCHAR},
  326. </if>
  327. <if test="releaseDate != null">
  328. #{releaseDate,jdbcType=TIMESTAMP},
  329. </if>
  330. <if test="advertisement != null">
  331. #{advertisement,jdbcType=VARCHAR},
  332. </if>
  333. </trim>
  334. </insert>
  335. <select id="countByExample" parameterType="com.goafanti.common.model.JtBusinessProjectExample" resultType="java.lang.Long">
  336. <!--
  337. WARNING - @mbg.generated
  338. This element is automatically generated by MyBatis Generator, do not modify.
  339. This element was generated on Wed Aug 01 10:34:40 CST 2018.
  340. -->
  341. select count(*) from jt_business_project
  342. <if test="_parameter != null">
  343. <include refid="Example_Where_Clause" />
  344. </if>
  345. </select>
  346. <update id="updateByExampleSelective" parameterType="map">
  347. <!--
  348. WARNING - @mbg.generated
  349. This element is automatically generated by MyBatis Generator, do not modify.
  350. This element was generated on Wed Aug 01 10:34:40 CST 2018.
  351. -->
  352. update jt_business_project
  353. <set>
  354. <if test="record.id != null">
  355. id = #{record.id,jdbcType=VARCHAR},
  356. </if>
  357. <if test="record.name != null">
  358. name = #{record.name,jdbcType=VARCHAR},
  359. </if>
  360. <if test="record.categoryId != null">
  361. category_id = #{record.categoryId,jdbcType=VARCHAR},
  362. </if>
  363. <if test="record.number != null">
  364. number = #{record.number,jdbcType=VARCHAR},
  365. </if>
  366. <if test="record.price != null">
  367. price = #{record.price,jdbcType=DECIMAL},
  368. </if>
  369. <if test="record.activityPrice != null">
  370. activity_price = #{record.activityPrice,jdbcType=DECIMAL},
  371. </if>
  372. <if test="record.memberPrice != null">
  373. member_price = #{record.memberPrice,jdbcType=DECIMAL},
  374. </if>
  375. <if test="record.offset != null">
  376. offset = #{record.offset,jdbcType=REAL},
  377. </if>
  378. <if test="record.activityFlag != null">
  379. activity_flag = #{record.activityFlag,jdbcType=INTEGER},
  380. </if>
  381. <if test="record.introduce != null">
  382. introduce = #{record.introduce,jdbcType=VARCHAR},
  383. </if>
  384. <if test="record.province != null">
  385. province = #{record.province,jdbcType=INTEGER},
  386. </if>
  387. <if test="record.city != null">
  388. city = #{record.city,jdbcType=INTEGER},
  389. </if>
  390. <if test="record.createTime != null">
  391. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  392. </if>
  393. <if test="record.minImgUrl != null">
  394. min_img_url = #{record.minImgUrl,jdbcType=VARCHAR},
  395. </if>
  396. <if test="record.maxImgUrl != null">
  397. max_img_url = #{record.maxImgUrl,jdbcType=VARCHAR},
  398. </if>
  399. <if test="record.value != null">
  400. value = #{record.value,jdbcType=VARCHAR},
  401. </if>
  402. <if test="record.applyConditions != null">
  403. apply_conditions = #{record.applyConditions,jdbcType=VARCHAR},
  404. </if>
  405. <if test="record.ownerId != null">
  406. owner_id = #{record.ownerId,jdbcType=VARCHAR},
  407. </if>
  408. <if test="record.isHot != null">
  409. is_hot = #{record.isHot,jdbcType=INTEGER},
  410. </if>
  411. <if test="record.auditStatus != null">
  412. audit_status = #{record.auditStatus,jdbcType=INTEGER},
  413. </if>
  414. <if test="record.auditInfo != null">
  415. audit_info = #{record.auditInfo,jdbcType=VARCHAR},
  416. </if>
  417. <if test="record.releaseDate != null">
  418. release_date = #{record.releaseDate,jdbcType=TIMESTAMP},
  419. </if>
  420. <if test="record.advertisement != null">
  421. advertisement = #{record.advertisement,jdbcType=VARCHAR},
  422. </if>
  423. </set>
  424. <if test="_parameter != null">
  425. <include refid="Update_By_Example_Where_Clause" />
  426. </if>
  427. </update>
  428. <update id="updateByExample" parameterType="map">
  429. <!--
  430. WARNING - @mbg.generated
  431. This element is automatically generated by MyBatis Generator, do not modify.
  432. This element was generated on Wed Aug 01 10:34:40 CST 2018.
  433. -->
  434. update jt_business_project
  435. set id = #{record.id,jdbcType=VARCHAR},
  436. name = #{record.name,jdbcType=VARCHAR},
  437. category_id = #{record.categoryId,jdbcType=VARCHAR},
  438. number = #{record.number,jdbcType=VARCHAR},
  439. price = #{record.price,jdbcType=DECIMAL},
  440. activity_price = #{record.activityPrice,jdbcType=DECIMAL},
  441. member_price = #{record.memberPrice,jdbcType=DECIMAL},
  442. offset = #{record.offset,jdbcType=REAL},
  443. activity_flag = #{record.activityFlag,jdbcType=INTEGER},
  444. introduce = #{record.introduce,jdbcType=VARCHAR},
  445. province = #{record.province,jdbcType=INTEGER},
  446. city = #{record.city,jdbcType=INTEGER},
  447. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  448. min_img_url = #{record.minImgUrl,jdbcType=VARCHAR},
  449. max_img_url = #{record.maxImgUrl,jdbcType=VARCHAR},
  450. value = #{record.value,jdbcType=VARCHAR},
  451. apply_conditions = #{record.applyConditions,jdbcType=VARCHAR},
  452. owner_id = #{record.ownerId,jdbcType=VARCHAR},
  453. is_hot = #{record.isHot,jdbcType=INTEGER},
  454. audit_status = #{record.auditStatus,jdbcType=INTEGER},
  455. audit_info = #{record.auditInfo,jdbcType=VARCHAR},
  456. release_date = #{record.releaseDate,jdbcType=TIMESTAMP},
  457. advertisement = #{record.advertisement,jdbcType=VARCHAR}
  458. <if test="_parameter != null">
  459. <include refid="Update_By_Example_Where_Clause" />
  460. </if>
  461. </update>
  462. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.JtBusinessProject">
  463. <!--
  464. WARNING - @mbg.generated
  465. This element is automatically generated by MyBatis Generator, do not modify.
  466. This element was generated on Wed Aug 01 10:34:40 CST 2018.
  467. -->
  468. update jt_business_project
  469. <set>
  470. <if test="name != null">
  471. name = #{name,jdbcType=VARCHAR},
  472. </if>
  473. <if test="categoryId != null">
  474. category_id = #{categoryId,jdbcType=VARCHAR},
  475. </if>
  476. <if test="number != null">
  477. number = #{number,jdbcType=VARCHAR},
  478. </if>
  479. <if test="price != null">
  480. price = #{price,jdbcType=DECIMAL},
  481. </if>
  482. <if test="activityPrice != null">
  483. activity_price = #{activityPrice,jdbcType=DECIMAL},
  484. </if>
  485. <if test="memberPrice != null">
  486. member_price = #{memberPrice,jdbcType=DECIMAL},
  487. </if>
  488. <if test="offset != null">
  489. offset = #{offset,jdbcType=REAL},
  490. </if>
  491. <if test="activityFlag != null">
  492. activity_flag = #{activityFlag,jdbcType=INTEGER},
  493. </if>
  494. <if test="introduce != null">
  495. introduce = #{introduce,jdbcType=VARCHAR},
  496. </if>
  497. <if test="province != null">
  498. province = #{province,jdbcType=INTEGER},
  499. </if>
  500. <if test="city != null">
  501. city = #{city,jdbcType=INTEGER},
  502. </if>
  503. <if test="createTime != null">
  504. create_time = #{createTime,jdbcType=TIMESTAMP},
  505. </if>
  506. <if test="minImgUrl != null">
  507. min_img_url = #{minImgUrl,jdbcType=VARCHAR},
  508. </if>
  509. <if test="maxImgUrl != null">
  510. max_img_url = #{maxImgUrl,jdbcType=VARCHAR},
  511. </if>
  512. <if test="value != null">
  513. value = #{value,jdbcType=VARCHAR},
  514. </if>
  515. <if test="applyConditions != null">
  516. apply_conditions = #{applyConditions,jdbcType=VARCHAR},
  517. </if>
  518. <if test="ownerId != null">
  519. owner_id = #{ownerId,jdbcType=VARCHAR},
  520. </if>
  521. <if test="isHot != null">
  522. is_hot = #{isHot,jdbcType=INTEGER},
  523. </if>
  524. <if test="auditStatus != null">
  525. audit_status = #{auditStatus,jdbcType=INTEGER},
  526. </if>
  527. <if test="auditInfo != null">
  528. audit_info = #{auditInfo,jdbcType=VARCHAR},
  529. </if>
  530. <if test="releaseDate != null">
  531. release_date = #{releaseDate,jdbcType=TIMESTAMP},
  532. </if>
  533. <if test="advertisement != null">
  534. advertisement = #{advertisement,jdbcType=VARCHAR},
  535. </if>
  536. </set>
  537. where id = #{id,jdbcType=VARCHAR}
  538. </update>
  539. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.JtBusinessProject">
  540. <!--
  541. WARNING - @mbg.generated
  542. This element is automatically generated by MyBatis Generator, do not modify.
  543. This element was generated on Wed Aug 01 10:34:40 CST 2018.
  544. -->
  545. update jt_business_project
  546. set name = #{name,jdbcType=VARCHAR},
  547. category_id = #{categoryId,jdbcType=VARCHAR},
  548. number = #{number,jdbcType=VARCHAR},
  549. price = #{price,jdbcType=DECIMAL},
  550. activity_price = #{activityPrice,jdbcType=DECIMAL},
  551. member_price = #{memberPrice,jdbcType=DECIMAL},
  552. offset = #{offset,jdbcType=REAL},
  553. activity_flag = #{activityFlag,jdbcType=INTEGER},
  554. introduce = #{introduce,jdbcType=VARCHAR},
  555. province = #{province,jdbcType=INTEGER},
  556. city = #{city,jdbcType=INTEGER},
  557. create_time = #{createTime,jdbcType=TIMESTAMP},
  558. min_img_url = #{minImgUrl,jdbcType=VARCHAR},
  559. max_img_url = #{maxImgUrl,jdbcType=VARCHAR},
  560. value = #{value,jdbcType=VARCHAR},
  561. apply_conditions = #{applyConditions,jdbcType=VARCHAR},
  562. owner_id = #{ownerId,jdbcType=VARCHAR},
  563. is_hot = #{isHot,jdbcType=INTEGER},
  564. audit_status = #{auditStatus,jdbcType=INTEGER},
  565. audit_info = #{auditInfo,jdbcType=VARCHAR},
  566. release_date = #{releaseDate,jdbcType=TIMESTAMP},
  567. advertisement = #{advertisement,jdbcType=VARCHAR}
  568. where id = #{id,jdbcType=VARCHAR}
  569. </update>
  570. <select id="selectByPrimaryKeyWithModule" resultType="com.goafanti.business.bo.JtBusinessProjectResult">
  571. select
  572. jtbp.id, jtbp.name, jtbp.category_id as categoryId, jtbp.number, jtbp.price, jtbp.activity_price as activityPrice, jtbp.member_price as memberPrice, jtbp.offset,
  573. jtbp.activity_flag as activityFlag,
  574. jtbp.introduce, jtbp.province, jtbp.city, jtbp.create_time as createTime, jtbp.min_img_url as minImgUrl, jtbp.max_img_url as maxImgUrl, jtbp.value, jtbp.apply_conditions as applyConditions,
  575. jtbp.owner_id as ownerId, jtbp.is_hot as isHot, jtbp.audit_status as auditStatus, jtbp.audit_info as auditInfo, jtbp.release_date as releaseDate,jtbc.module as module,jtbp.advertisement
  576. from jt_business_project jtbp
  577. left join jt_business_category jtbc on jtbc.id = jtbp.category_id
  578. where jtbp.id = #{id,jdbcType=VARCHAR}
  579. </select>
  580. <select id="getBusinessProjectByCategoryId" resultType="com.goafanti.common.model.JtBusinessProject">
  581. select
  582. id,
  583. name,
  584. introduce,
  585. min_img_url as minImgUrl
  586. from
  587. jt_business_project
  588. where audit_status=2
  589. <if test="id!=null">
  590. and category_id= #{id,jdbcType=VARCHAR}
  591. </if>
  592. <if test="isHot != null">
  593. and is_hot = #{isHot,jdbcType=INTEGER}
  594. </if>
  595. order by release_date
  596. limit #{size,jdbcType=INTEGER}
  597. </select>
  598. <select id="findJtBusinessProjectByPage" resultType="com.goafanti.business.bo.JtBusinessProjectResult">
  599. select
  600. jtbp.id,
  601. jtbp.name,
  602. jtbp.category_id as categoryId,
  603. jtbp.number,
  604. jtbp.price,
  605. jtbp.activity_price as activityPrice,
  606. jtbp.member_price as memberPrice,
  607. jtbp.offset,
  608. jtbp.activity_flag as activityFlag,
  609. jtbp.introduce,
  610. jtbp.province, jtbp.city,
  611. jtbp.create_time as createTime,
  612. jtbp.min_img_url as minImgUrl,
  613. jtbp.max_img_url as maxImgUrl,
  614. jtbp.value,
  615. jtbp.apply_conditions as applyConditions,
  616. jtbp.is_hot as isHot,
  617. jtbp.audit_status as auditStatus,
  618. jtbp.release_Date as releaseDate,
  619. jtbp.advertisement,
  620. dct.dealCount as dealCount,
  621. u.identify_name as companyName,u.id as companyId
  622. from jt_business_project jtbp
  623. left join user u on u.id=jtbp.owner_id
  624. <if test="topId!=null">
  625. left join jt_business_category jtbc on jtbc.super_id =#{topId,jdbcType=VARCHAR}
  626. </if>
  627. <if test="module!=null">
  628. left join jt_business_category jtbc1 on jtbc1.id = jtbp.category_id
  629. </if>
  630. left join (select count(0) as dealCount ,commodity_id from jt_order_detail group by commodity_id) dct on jtbp.id=dct.commodity_id
  631. where 1=1
  632. <if test="module !=null">
  633. and jtbc1.module=#{module,jdbcType=INTEGER}
  634. </if>
  635. <if test="secondId!=null">
  636. and jtbp.category_id=#{secondId,jdbcType=VARCHAR}
  637. </if>
  638. <if test="name!=null">
  639. and jtbp.name like concat("%",#{name,jdbcType=VARCHAR},"%")
  640. </if>
  641. <if test="topId!=null">
  642. and jtbc.id=jtbp.category_id
  643. </if>
  644. <if test="ownerId!=null">
  645. and jtbp.owner_id=#{ownerId,jdbcType=VARCHAR}
  646. </if>
  647. <if test="auditStatus!=null">
  648. and jtbp.audit_status=#{auditStatus,jdbcType=INTEGER}
  649. </if>
  650. <if test="orderType!=null and orderType==0">
  651. order by release_date
  652. </if>
  653. <if test="orderType!=null and orderType==1">
  654. order by jtbp.price
  655. </if>
  656. <if test="orderType!=null and orderType==2">
  657. order by dct.dealCount
  658. </if>
  659. <if test="orderSort!=null and orderSort==0">
  660. desc</if>
  661. <if test="page_sql!=null">
  662. ${page_sql}
  663. </if>
  664. </select>
  665. <select id="findJtBusinessCountByPage" resultType="java.lang.Integer">
  666. select
  667. count(0)
  668. from jt_business_project jtbp
  669. <if test="topId!=null">
  670. left join jt_business_category jtbc on jtbc.super_id =#{topId,jdbcType=VARCHAR}
  671. </if>
  672. <if test="module!=null">
  673. left join jt_business_category jtbc1 on jtbc1.id = jtbp.category_id
  674. </if>
  675. where 1=1
  676. <if test="module !=null">
  677. and jtbc1.module=#{module,jdbcType=INTEGER}
  678. </if>
  679. <if test="secondId!=null">
  680. and jtbp.category_id=#{secondId,jdbcType=VARCHAR}
  681. </if>
  682. <if test="name!=null">
  683. and jtbp.name like concat("%",#{name,jdbcType=VARCHAR},"%")
  684. </if>
  685. <if test="topId!=null">
  686. and jtbc.id=jtbp.category_id
  687. </if>
  688. <if test="ownerId!=null">
  689. and jtbp.owner_id=#{ownerId,jdbcType=VARCHAR}
  690. </if>
  691. <if test="auditStatus!=null">
  692. and jtbp.audit_status=#{auditStatus,jdbcType=INTEGER}
  693. </if>
  694. </select>
  695. <select id="findProjectOrderByNumber" resultType="com.goafanti.common.model.JtBusinessProject">
  696. select
  697. <include refid="Base_Column_List" />
  698. from jt_business_project jtbp
  699. where audit_status=2
  700. order by create_time desc
  701. </select>
  702. <select id="findInterestedProjcet" resultType="com.goafanti.common.model.JtBusinessProject">
  703. select
  704. jtbp.id,
  705. jtbp.name,
  706. jtbp.category_id as categoryId,
  707. jtbp.number,
  708. jtbp.price,
  709. jtbp.activity_price as activityPrice,
  710. jtbp.member_price as memberPrice,
  711. jtbp.offset,
  712. jtbp.activity_flag as activityFlag,
  713. jtbp.introduce,
  714. jtbp.province, jtbp.city,
  715. jtbp.create_time as createTime,
  716. jtbp.min_img_url as minImgUrl,
  717. jtbp.max_img_url as maxImgUrl,
  718. jtbp.value,
  719. jtbp.apply_conditions as applyConditions,
  720. jtbp.is_hot as isHot,
  721. jtbp.audit_status as auditStatus,
  722. jtbp.release_Date as releaseDate,
  723. jtbp.advertisement
  724. from
  725. jt_business_project jtbp
  726. left join project_interest pi on jtbp.id=pi.project_id
  727. where pi.uid=#{uid,jdbcType=VARCHAR}
  728. <if test="page_sql!=null">
  729. ${page_sql}
  730. </if>
  731. </select>
  732. <select id="findInterestedProjcetCount" resultType="java.lang.Integer">
  733. select
  734. count(0)
  735. from
  736. jt_business_project jtbp
  737. left join project_interest pi on jtbp.id=pi.project_id
  738. where pi.uid=#{uid,jdbcType=VARCHAR}
  739. </select>
  740. </mapper>