JtBusinessProjectMapper.xml 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921
  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. <result column="keyword" jdbcType="VARCHAR" property="keyword" />
  34. <result column="summary" jdbcType="VARCHAR" property="summary" />
  35. </resultMap>
  36. <sql id="Example_Where_Clause">
  37. <!--
  38. WARNING - @mbg.generated
  39. This element is automatically generated by MyBatis Generator, do not modify.
  40. This element was generated on Wed Aug 01 10:34:40 CST 2018.
  41. -->
  42. <where>
  43. <foreach collection="oredCriteria" item="criteria" separator="or">
  44. <if test="criteria.valid">
  45. <trim prefix="(" prefixOverrides="and" suffix=")">
  46. <foreach collection="criteria.criteria" item="criterion">
  47. <choose>
  48. <when test="criterion.noValue">
  49. and ${criterion.condition}
  50. </when>
  51. <when test="criterion.singleValue">
  52. and ${criterion.condition} #{criterion.value}
  53. </when>
  54. <when test="criterion.betweenValue">
  55. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  56. </when>
  57. <when test="criterion.listValue">
  58. and ${criterion.condition}
  59. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  60. #{listItem}
  61. </foreach>
  62. </when>
  63. </choose>
  64. </foreach>
  65. </trim>
  66. </if>
  67. </foreach>
  68. </where>
  69. </sql>
  70. <sql id="Update_By_Example_Where_Clause">
  71. <!--
  72. WARNING - @mbg.generated
  73. This element is automatically generated by MyBatis Generator, do not modify.
  74. This element was generated on Wed Aug 01 10:34:40 CST 2018.
  75. -->
  76. <where>
  77. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  78. <if test="criteria.valid">
  79. <trim prefix="(" prefixOverrides="and" suffix=")">
  80. <foreach collection="criteria.criteria" item="criterion">
  81. <choose>
  82. <when test="criterion.noValue">
  83. and ${criterion.condition}
  84. </when>
  85. <when test="criterion.singleValue">
  86. and ${criterion.condition} #{criterion.value}
  87. </when>
  88. <when test="criterion.betweenValue">
  89. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  90. </when>
  91. <when test="criterion.listValue">
  92. and ${criterion.condition}
  93. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  94. #{listItem}
  95. </foreach>
  96. </when>
  97. </choose>
  98. </foreach>
  99. </trim>
  100. </if>
  101. </foreach>
  102. </where>
  103. </sql>
  104. <sql id="Base_Column_List">
  105. <!--
  106. WARNING - @mbg.generated
  107. This element is automatically generated by MyBatis Generator, do not modify.
  108. This element was generated on Wed Aug 01 10:34:40 CST 2018.
  109. -->
  110. id, name, category_id, number, price, activity_price, member_price, offset, activity_flag,
  111. introduce, province, city, create_time, min_img_url, max_img_url, value, apply_conditions,
  112. owner_id, is_hot, audit_status, audit_info, release_date, advertisement,keyword,summary
  113. </sql>
  114. <select id="selectByExample" parameterType="com.goafanti.common.model.JtBusinessProjectExample" resultMap="BaseResultMap">
  115. <!--
  116. WARNING - @mbg.generated
  117. This element is automatically generated by MyBatis Generator, do not modify.
  118. This element was generated on Wed Aug 01 10:34:40 CST 2018.
  119. -->
  120. select
  121. <if test="distinct">
  122. distinct
  123. </if>
  124. <include refid="Base_Column_List" />
  125. from jt_business_project
  126. <if test="_parameter != null">
  127. <include refid="Example_Where_Clause" />
  128. </if>
  129. <if test="orderByClause != null">
  130. order by ${orderByClause}
  131. </if>
  132. </select>
  133. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  134. <!--
  135. WARNING - @mbg.generated
  136. This element is automatically generated by MyBatis Generator, do not modify.
  137. This element was generated on Wed Aug 01 10:34:40 CST 2018.
  138. -->
  139. select
  140. <include refid="Base_Column_List" />
  141. from jt_business_project
  142. where id = #{id,jdbcType=VARCHAR}
  143. </select>
  144. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  145. <!--
  146. WARNING - @mbg.generated
  147. This element is automatically generated by MyBatis Generator, do not modify.
  148. This element was generated on Wed Aug 01 10:34:40 CST 2018.
  149. -->
  150. delete from jt_business_project
  151. where id = #{id,jdbcType=VARCHAR}
  152. </delete>
  153. <delete id="deleteByExample" parameterType="com.goafanti.common.model.JtBusinessProjectExample">
  154. <!--
  155. WARNING - @mbg.generated
  156. This element is automatically generated by MyBatis Generator, do not modify.
  157. This element was generated on Wed Aug 01 10:34:40 CST 2018.
  158. -->
  159. delete from jt_business_project
  160. <if test="_parameter != null">
  161. <include refid="Example_Where_Clause" />
  162. </if>
  163. </delete>
  164. <insert id="insert" parameterType="com.goafanti.common.model.JtBusinessProject">
  165. <!--
  166. WARNING - @mbg.generated
  167. This element is automatically generated by MyBatis Generator, do not modify.
  168. This element was generated on Wed Aug 01 10:34:40 CST 2018.
  169. -->
  170. insert into jt_business_project (id, name, category_id,
  171. number, price, activity_price,
  172. member_price, offset, activity_flag,
  173. introduce, province, city,
  174. create_time, min_img_url, max_img_url,
  175. value, apply_conditions, owner_id,
  176. is_hot, audit_status, audit_info,
  177. release_date, advertisement,keyword,summary)
  178. values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{categoryId,jdbcType=VARCHAR},
  179. #{number,jdbcType=VARCHAR}, #{price,jdbcType=DECIMAL}, #{activityPrice,jdbcType=DECIMAL},
  180. #{memberPrice,jdbcType=DECIMAL}, #{offset,jdbcType=REAL}, #{activityFlag,jdbcType=INTEGER},
  181. #{introduce,jdbcType=VARCHAR}, #{province,jdbcType=INTEGER}, #{city,jdbcType=INTEGER},
  182. #{createTime,jdbcType=TIMESTAMP}, #{minImgUrl,jdbcType=VARCHAR}, #{maxImgUrl,jdbcType=VARCHAR},
  183. #{value,jdbcType=VARCHAR}, #{applyConditions,jdbcType=VARCHAR}, #{ownerId,jdbcType=VARCHAR},
  184. #{isHot,jdbcType=INTEGER}, #{auditStatus,jdbcType=INTEGER}, #{auditInfo,jdbcType=VARCHAR},
  185. #{releaseDate,jdbcType=TIMESTAMP}, #{advertisement,jdbcType=VARCHAR},#{keyword,jdbcType=VARCHAR},#{summary,jdbcType=VARCHAR})
  186. </insert>
  187. <insert id="insertSelective" parameterType="com.goafanti.common.model.JtBusinessProject">
  188. <!--
  189. WARNING - @mbg.generated
  190. This element is automatically generated by MyBatis Generator, do not modify.
  191. This element was generated on Wed Aug 01 10:34:40 CST 2018.
  192. -->
  193. insert into jt_business_project
  194. <trim prefix="(" suffix=")" suffixOverrides=",">
  195. <if test="id != null">
  196. id,
  197. </if>
  198. <if test="name != null">
  199. name,
  200. </if>
  201. <if test="categoryId != null">
  202. category_id,
  203. </if>
  204. <if test="number != null">
  205. number,
  206. </if>
  207. <if test="price != null">
  208. price,
  209. </if>
  210. <if test="activityPrice != null">
  211. activity_price,
  212. </if>
  213. <if test="memberPrice != null">
  214. member_price,
  215. </if>
  216. <if test="offset != null">
  217. offset,
  218. </if>
  219. <if test="activityFlag != null">
  220. activity_flag,
  221. </if>
  222. <if test="introduce != null">
  223. introduce,
  224. </if>
  225. <if test="province != null">
  226. province,
  227. </if>
  228. <if test="city != null">
  229. city,
  230. </if>
  231. <if test="createTime != null">
  232. create_time,
  233. </if>
  234. <if test="minImgUrl != null">
  235. min_img_url,
  236. </if>
  237. <if test="maxImgUrl != null">
  238. max_img_url,
  239. </if>
  240. <if test="value != null">
  241. value,
  242. </if>
  243. <if test="applyConditions != null">
  244. apply_conditions,
  245. </if>
  246. <if test="ownerId != null">
  247. owner_id,
  248. </if>
  249. <if test="isHot != null">
  250. is_hot,
  251. </if>
  252. <if test="auditStatus != null">
  253. audit_status,
  254. </if>
  255. <if test="auditInfo != null">
  256. audit_info,
  257. </if>
  258. <if test="releaseDate != null">
  259. release_date,
  260. </if>
  261. <if test="advertisement != null">
  262. advertisement,
  263. </if>
  264. <if test="keyword != null">
  265. keyword,
  266. </if>
  267. <if test="summary != null">
  268. summary,
  269. </if>
  270. </trim>
  271. <trim prefix="values (" suffix=")" suffixOverrides=",">
  272. <if test="id != null">
  273. #{id,jdbcType=VARCHAR},
  274. </if>
  275. <if test="name != null">
  276. #{name,jdbcType=VARCHAR},
  277. </if>
  278. <if test="categoryId != null">
  279. #{categoryId,jdbcType=VARCHAR},
  280. </if>
  281. <if test="number != null">
  282. #{number,jdbcType=VARCHAR},
  283. </if>
  284. <if test="price != null">
  285. #{price,jdbcType=DECIMAL},
  286. </if>
  287. <if test="activityPrice != null">
  288. #{activityPrice,jdbcType=DECIMAL},
  289. </if>
  290. <if test="memberPrice != null">
  291. #{memberPrice,jdbcType=DECIMAL},
  292. </if>
  293. <if test="offset != null">
  294. #{offset,jdbcType=REAL},
  295. </if>
  296. <if test="activityFlag != null">
  297. #{activityFlag,jdbcType=INTEGER},
  298. </if>
  299. <if test="introduce != null">
  300. #{introduce,jdbcType=VARCHAR},
  301. </if>
  302. <if test="province != null">
  303. #{province,jdbcType=INTEGER},
  304. </if>
  305. <if test="city != null">
  306. #{city,jdbcType=INTEGER},
  307. </if>
  308. <if test="createTime != null">
  309. #{createTime,jdbcType=TIMESTAMP},
  310. </if>
  311. <if test="minImgUrl != null">
  312. #{minImgUrl,jdbcType=VARCHAR},
  313. </if>
  314. <if test="maxImgUrl != null">
  315. #{maxImgUrl,jdbcType=VARCHAR},
  316. </if>
  317. <if test="value != null">
  318. #{value,jdbcType=VARCHAR},
  319. </if>
  320. <if test="applyConditions != null">
  321. #{applyConditions,jdbcType=VARCHAR},
  322. </if>
  323. <if test="ownerId != null">
  324. #{ownerId,jdbcType=VARCHAR},
  325. </if>
  326. <if test="isHot != null">
  327. #{isHot,jdbcType=INTEGER},
  328. </if>
  329. <if test="auditStatus != null">
  330. #{auditStatus,jdbcType=INTEGER},
  331. </if>
  332. <if test="auditInfo != null">
  333. #{auditInfo,jdbcType=VARCHAR},
  334. </if>
  335. <if test="releaseDate != null">
  336. #{releaseDate,jdbcType=TIMESTAMP},
  337. </if>
  338. <if test="advertisement != null">
  339. #{advertisement,jdbcType=VARCHAR},
  340. </if>
  341. <if test="keyword != null">
  342. #{keyword,jdbcType=VARCHAR},
  343. </if>
  344. <if test="summary != null">
  345. #{summary,jdbcType=VARCHAR}
  346. </if>
  347. </trim>
  348. </insert>
  349. <select id="countByExample" parameterType="com.goafanti.common.model.JtBusinessProjectExample" resultType="java.lang.Long">
  350. <!--
  351. WARNING - @mbg.generated
  352. This element is automatically generated by MyBatis Generator, do not modify.
  353. This element was generated on Wed Aug 01 10:34:40 CST 2018.
  354. -->
  355. select count(*) from jt_business_project
  356. <if test="_parameter != null">
  357. <include refid="Example_Where_Clause" />
  358. </if>
  359. </select>
  360. <update id="updateByExampleSelective" parameterType="map">
  361. <!--
  362. WARNING - @mbg.generated
  363. This element is automatically generated by MyBatis Generator, do not modify.
  364. This element was generated on Wed Aug 01 10:34:40 CST 2018.
  365. -->
  366. update jt_business_project
  367. <set>
  368. <if test="record.id != null">
  369. id = #{record.id,jdbcType=VARCHAR},
  370. </if>
  371. <if test="record.name != null">
  372. name = #{record.name,jdbcType=VARCHAR},
  373. </if>
  374. <if test="record.categoryId != null">
  375. category_id = #{record.categoryId,jdbcType=VARCHAR},
  376. </if>
  377. <if test="record.number != null">
  378. number = #{record.number,jdbcType=VARCHAR},
  379. </if>
  380. <if test="record.price != null">
  381. price = #{record.price,jdbcType=DECIMAL},
  382. </if>
  383. <if test="record.activityPrice != null">
  384. activity_price = #{record.activityPrice,jdbcType=DECIMAL},
  385. </if>
  386. <if test="record.memberPrice != null">
  387. member_price = #{record.memberPrice,jdbcType=DECIMAL},
  388. </if>
  389. <if test="record.offset != null">
  390. offset = #{record.offset,jdbcType=REAL},
  391. </if>
  392. <if test="record.activityFlag != null">
  393. activity_flag = #{record.activityFlag,jdbcType=INTEGER},
  394. </if>
  395. <if test="record.introduce != null">
  396. introduce = #{record.introduce,jdbcType=VARCHAR},
  397. </if>
  398. <if test="record.province != null">
  399. province = #{record.province,jdbcType=INTEGER},
  400. </if>
  401. <if test="record.city != null">
  402. city = #{record.city,jdbcType=INTEGER},
  403. </if>
  404. <if test="record.createTime != null">
  405. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  406. </if>
  407. <if test="record.minImgUrl != null">
  408. min_img_url = #{record.minImgUrl,jdbcType=VARCHAR},
  409. </if>
  410. <if test="record.maxImgUrl != null">
  411. max_img_url = #{record.maxImgUrl,jdbcType=VARCHAR},
  412. </if>
  413. <if test="record.value != null">
  414. value = #{record.value,jdbcType=VARCHAR},
  415. </if>
  416. <if test="record.applyConditions != null">
  417. apply_conditions = #{record.applyConditions,jdbcType=VARCHAR},
  418. </if>
  419. <if test="record.ownerId != null">
  420. owner_id = #{record.ownerId,jdbcType=VARCHAR},
  421. </if>
  422. <if test="record.isHot != null">
  423. is_hot = #{record.isHot,jdbcType=INTEGER},
  424. </if>
  425. <if test="record.auditStatus != null">
  426. audit_status = #{record.auditStatus,jdbcType=INTEGER},
  427. </if>
  428. <if test="record.auditInfo != null">
  429. audit_info = #{record.auditInfo,jdbcType=VARCHAR},
  430. </if>
  431. <if test="record.releaseDate != null">
  432. release_date = #{record.releaseDate,jdbcType=TIMESTAMP},
  433. </if>
  434. <if test="record.advertisement != null">
  435. advertisement = #{record.advertisement,jdbcType=VARCHAR},
  436. </if>
  437. <if test="keyword !=null">
  438. keyword =#{keyword,jdbcType=VARCHAR},
  439. </if>
  440. <if test="summary != null">
  441. summary =#{summary,jdbcType=VARCHAR},
  442. </if>
  443. </set>
  444. <if test="_parameter != null">
  445. <include refid="Update_By_Example_Where_Clause" />
  446. </if>
  447. </update>
  448. <update id="updateByExample" parameterType="map">
  449. <!--
  450. WARNING - @mbg.generated
  451. This element is automatically generated by MyBatis Generator, do not modify.
  452. This element was generated on Wed Aug 01 10:34:40 CST 2018.
  453. -->
  454. update jt_business_project
  455. set id = #{record.id,jdbcType=VARCHAR},
  456. name = #{record.name,jdbcType=VARCHAR},
  457. category_id = #{record.categoryId,jdbcType=VARCHAR},
  458. number = #{record.number,jdbcType=VARCHAR},
  459. price = #{record.price,jdbcType=DECIMAL},
  460. activity_price = #{record.activityPrice,jdbcType=DECIMAL},
  461. member_price = #{record.memberPrice,jdbcType=DECIMAL},
  462. offset = #{record.offset,jdbcType=REAL},
  463. activity_flag = #{record.activityFlag,jdbcType=INTEGER},
  464. introduce = #{record.introduce,jdbcType=VARCHAR},
  465. province = #{record.province,jdbcType=INTEGER},
  466. city = #{record.city,jdbcType=INTEGER},
  467. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  468. min_img_url = #{record.minImgUrl,jdbcType=VARCHAR},
  469. max_img_url = #{record.maxImgUrl,jdbcType=VARCHAR},
  470. value = #{record.value,jdbcType=VARCHAR},
  471. apply_conditions = #{record.applyConditions,jdbcType=VARCHAR},
  472. owner_id = #{record.ownerId,jdbcType=VARCHAR},
  473. is_hot = #{record.isHot,jdbcType=INTEGER},
  474. audit_status = #{record.auditStatus,jdbcType=INTEGER},
  475. audit_info = #{record.auditInfo,jdbcType=VARCHAR},
  476. release_date = #{record.releaseDate,jdbcType=TIMESTAMP},
  477. advertisement = #{record.advertisement,jdbcType=VARCHAR},
  478. keyword = #{keyword,jdbcType=VARCHAR},#{summary,jdbcType=VARCHAR}
  479. <if test="_parameter != null">
  480. <include refid="Update_By_Example_Where_Clause" />
  481. </if>
  482. </update>
  483. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.JtBusinessProject">
  484. <!--
  485. WARNING - @mbg.generated
  486. This element is automatically generated by MyBatis Generator, do not modify.
  487. This element was generated on Wed Aug 01 10:34:40 CST 2018.
  488. -->
  489. update jt_business_project
  490. <set>
  491. <if test="name != null">
  492. name = #{name,jdbcType=VARCHAR},
  493. </if>
  494. <if test="categoryId != null">
  495. category_id = #{categoryId,jdbcType=VARCHAR},
  496. </if>
  497. <if test="number != null">
  498. number = #{number,jdbcType=VARCHAR},
  499. </if>
  500. <if test="price != null">
  501. price = #{price,jdbcType=DECIMAL},
  502. </if>
  503. <if test="activityPrice != null">
  504. activity_price = #{activityPrice,jdbcType=DECIMAL},
  505. </if>
  506. <if test="memberPrice != null">
  507. member_price = #{memberPrice,jdbcType=DECIMAL},
  508. </if>
  509. <if test="offset != null">
  510. offset = #{offset,jdbcType=REAL},
  511. </if>
  512. <if test="activityFlag != null">
  513. activity_flag = #{activityFlag,jdbcType=INTEGER},
  514. </if>
  515. <if test="introduce != null">
  516. introduce = #{introduce,jdbcType=VARCHAR},
  517. </if>
  518. <if test="province != null">
  519. province = #{province,jdbcType=INTEGER},
  520. </if>
  521. <if test="city != null">
  522. city = #{city,jdbcType=INTEGER},
  523. </if>
  524. <if test="createTime != null">
  525. create_time = #{createTime,jdbcType=TIMESTAMP},
  526. </if>
  527. <if test="minImgUrl != null">
  528. min_img_url = #{minImgUrl,jdbcType=VARCHAR},
  529. </if>
  530. <if test="maxImgUrl != null">
  531. max_img_url = #{maxImgUrl,jdbcType=VARCHAR},
  532. </if>
  533. <if test="value != null">
  534. value = #{value,jdbcType=VARCHAR},
  535. </if>
  536. <if test="applyConditions != null">
  537. apply_conditions = #{applyConditions,jdbcType=VARCHAR},
  538. </if>
  539. <if test="ownerId != null">
  540. owner_id = #{ownerId,jdbcType=VARCHAR},
  541. </if>
  542. <if test="isHot != null">
  543. is_hot = #{isHot,jdbcType=INTEGER},
  544. </if>
  545. <if test="auditStatus != null">
  546. audit_status = #{auditStatus,jdbcType=INTEGER},
  547. </if>
  548. <if test="auditInfo != null">
  549. audit_info = #{auditInfo,jdbcType=VARCHAR},
  550. </if>
  551. <if test="releaseDate != null">
  552. release_date = #{releaseDate,jdbcType=TIMESTAMP},
  553. </if>
  554. <if test="advertisement != null">
  555. advertisement = #{advertisement,jdbcType=VARCHAR},
  556. </if>
  557. <if test="keyword != null">
  558. keyword = #{keyword,jdbcType=VARCHAR},
  559. </if>
  560. <if test="summary != null">
  561. summary = #{summary,jdbcType=VARCHAR},
  562. </if>
  563. </set>
  564. where id = #{id,jdbcType=VARCHAR}
  565. </update>
  566. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.JtBusinessProject">
  567. <!--
  568. WARNING - @mbg.generated
  569. This element is automatically generated by MyBatis Generator, do not modify.
  570. This element was generated on Wed Aug 01 10:34:40 CST 2018.
  571. -->
  572. update jt_business_project
  573. set name = #{name,jdbcType=VARCHAR},
  574. category_id = #{categoryId,jdbcType=VARCHAR},
  575. number = #{number,jdbcType=VARCHAR},
  576. price = #{price,jdbcType=DECIMAL},
  577. activity_price = #{activityPrice,jdbcType=DECIMAL},
  578. member_price = #{memberPrice,jdbcType=DECIMAL},
  579. offset = #{offset,jdbcType=REAL},
  580. activity_flag = #{activityFlag,jdbcType=INTEGER},
  581. introduce = #{introduce,jdbcType=VARCHAR},
  582. province = #{province,jdbcType=INTEGER},
  583. city = #{city,jdbcType=INTEGER},
  584. create_time = #{createTime,jdbcType=TIMESTAMP},
  585. min_img_url = #{minImgUrl,jdbcType=VARCHAR},
  586. max_img_url = #{maxImgUrl,jdbcType=VARCHAR},
  587. value = #{value,jdbcType=VARCHAR},
  588. apply_conditions = #{applyConditions,jdbcType=VARCHAR},
  589. owner_id = #{ownerId,jdbcType=VARCHAR},
  590. is_hot = #{isHot,jdbcType=INTEGER},
  591. audit_status = #{auditStatus,jdbcType=INTEGER},
  592. audit_info = #{auditInfo,jdbcType=VARCHAR},
  593. release_date = #{releaseDate,jdbcType=TIMESTAMP},
  594. advertisement = #{advertisement,jdbcType=VARCHAR},
  595. keyword = #{keyword,jdbcType=VARCHAR},
  596. summary =#{summary,jdbcType=VARCHAR}
  597. where id = #{id,jdbcType=VARCHAR}
  598. </update>
  599. <select id="selectByPrimaryKeyWithModule" resultType="com.goafanti.business.bo.JtBusinessProjectResult">
  600. select
  601. 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,
  602. jtbp.activity_flag as activityFlag,ifnull(p.count,0) as interestCount,if(isnull(x.project_id),0,1) as interested,jtbp.keyword,jtbp.summary,
  603. 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,
  604. 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
  605. ,u.`type` as type,u.mobile as ownerMobile, u.nickname as ownerName
  606. from jt_business_project jtbp left join `user` u on jtbp.owner_id=u.id
  607. left join jt_business_category jtbc on jtbc.id = jtbp.category_id
  608. left join (select project_id,count(*) as count from project_interest group by project_id) p on jtbp.id=p.project_id
  609. left join (select project_id from project_interest <if test="uid != null"> where uid= #{uid,jdbcType=VARCHAR} </if>group by project_id) x on jtbp.id=x.project_id
  610. where jtbp.id = #{id,jdbcType=VARCHAR}
  611. </select>
  612. <select id="getBusinessProjectByCategoryId" resultType="com.goafanti.common.model.JtBusinessProject">
  613. select
  614. id,
  615. name,
  616. introduce,
  617. min_img_url as minImgUrl
  618. from
  619. jt_business_project
  620. where audit_status=2
  621. <if test="id!=null">
  622. and category_id= #{id,jdbcType=VARCHAR}
  623. </if>
  624. <if test="isHot != null">
  625. and is_hot = #{isHot,jdbcType=INTEGER}
  626. </if>
  627. order by release_date desc
  628. limit #{size,jdbcType=INTEGER}
  629. </select>
  630. <select id="findJtBusinessProjectByPage" resultType="com.goafanti.business.bo.JtBusinessProjectResult">
  631. select
  632. jtbp.id,
  633. jtbp.name,
  634. jtbp.category_id as categoryId,
  635. jtbp.number,
  636. jtbp.price,
  637. jtbp.activity_price as activityPrice,
  638. jtbp.member_price as memberPrice,
  639. jtbp.offset,
  640. jtbp.activity_flag as activityFlag,
  641. jtbp.introduce,
  642. jtbp.province, jtbp.city,
  643. jtbp.create_time as createTime,
  644. jtbp.min_img_url as minImgUrl,
  645. jtbp.max_img_url as maxImgUrl,
  646. jtbp.value,
  647. jtbp.apply_conditions as applyConditions,
  648. jtbp.is_hot as isHot,
  649. jtbp.audit_status as auditStatus,
  650. jtbp.release_Date as releaseDate,
  651. jtbp.advertisement,
  652. jtbp.summary,
  653. ifnull(dct.dealCount,0) as dealCount,
  654. ifnull(x.count,0) as interestCount,
  655. u.nickname as companyName,u.id as companyId,
  656. jtbc1.module,
  657. u.`type` as type
  658. from jt_business_project jtbp
  659. left join user u on u.id=jtbp.owner_id
  660. left join (select project_id as id,count(*) as count from project_interest group by project_id)x on jtbp.id=x.id
  661. left join (select sum(commodity_quantity) as dealCount ,commodity_id from jt_order_detail group by commodity_id) dct on jtbp.id=dct.commodity_id
  662. left join jt_business_category jtbc1 on jtbc1.id = jtbp.category_id
  663. <if test="topId!=null">
  664. left join jt_business_category jtbc on jtbc.super_id =#{topId,jdbcType=VARCHAR}
  665. </if>
  666. <if test="tag != null">
  667. left join jt_business_project_tag x on x.project_id=jtbp.id
  668. left join jt_tag y on x.tag_id=y.id
  669. </if>
  670. where 1=1
  671. <if test="tag != null">
  672. and y.id= #{tag,jdbcType=VARCHAR}
  673. </if>
  674. <if test="module == 0">
  675. and jtbc1.module &gt; 1
  676. </if>
  677. <if test="isHot != null">
  678. and jtbp.is_hot = #{isHot,jdbcType=INTEGER}
  679. </if>
  680. <!-- <if test="module == 1">
  681. and jtbc1.module =1
  682. </if> -->
  683. <if test="module !=null and module !=0">
  684. and jtbc1.module=#{module,jdbcType=INTEGER}
  685. </if>
  686. <if test="secondId!=null">
  687. and jtbp.category_id=#{secondId,jdbcType=VARCHAR}
  688. </if>
  689. <if test="name!=null">
  690. and jtbp.name like concat("%",#{name,jdbcType=VARCHAR},"%")
  691. </if>
  692. <if test="topId!=null">
  693. and jtbc.id=jtbp.category_id
  694. </if>
  695. <if test="ownerId!=null">
  696. and jtbp.owner_id=#{ownerId,jdbcType=VARCHAR}
  697. </if>
  698. <if test="auditStatus!=null">
  699. and jtbp.audit_status=#{auditStatus,jdbcType=INTEGER}
  700. </if>
  701. <if test="orderType!=null and orderType==0">
  702. order by release_date
  703. </if>
  704. <if test="orderType!=null and orderType==1">
  705. order by jtbp.price
  706. </if>
  707. <if test="orderType!=null and orderType==2">
  708. order by dct.dealCount
  709. </if>
  710. <if test="orderSort!=null and orderSort==0">
  711. desc
  712. </if>
  713. <if test="page_sql!=null">
  714. ${page_sql}
  715. </if>
  716. </select>
  717. <select id="findJtBusinessCountByPage" resultType="java.lang.Integer">
  718. select
  719. count(0)
  720. from jt_business_project jtbp
  721. <if test="topId!=null">
  722. left join jt_business_category jtbc on jtbc.super_id =#{topId,jdbcType=VARCHAR}
  723. </if>
  724. <if test="module!=null">
  725. left join jt_business_category jtbc1 on jtbc1.id = jtbp.category_id
  726. </if>
  727. <if test="tag != null">
  728. left join jt_business_project_tag x on x.project_id=jtbp.id
  729. left join jt_tag y on x.tag_id=y.id
  730. </if>
  731. where 1=1
  732. <if test="tag != null">
  733. and y.id= #{tag,jdbcType=VARCHAR}
  734. </if>
  735. <if test="module == 0">
  736. and jtbc1.module &gt; 1
  737. </if>
  738. <if test="isHot != null">
  739. and jtbp.is_hot = #{isHot,jdbcType=INTEGER}
  740. </if>
  741. <!-- <if test="module == 1">
  742. and jtbc1.module =1
  743. </if> -->
  744. <if test="module !=null and module !=0">
  745. and jtbc1.module=#{module,jdbcType=INTEGER}
  746. </if>
  747. <if test="secondId!=null">
  748. and jtbp.category_id=#{secondId,jdbcType=VARCHAR}
  749. </if>
  750. <if test="name!=null">
  751. and jtbp.name like concat("%",#{name,jdbcType=VARCHAR},"%")
  752. </if>
  753. <if test="topId!=null">
  754. and jtbc.id=jtbp.category_id
  755. </if>
  756. <if test="ownerId!=null">
  757. and jtbp.owner_id=#{ownerId,jdbcType=VARCHAR}
  758. </if>
  759. <if test="auditStatus!=null">
  760. and jtbp.audit_status=#{auditStatus,jdbcType=INTEGER}
  761. </if>
  762. </select>
  763. <select id="findProjectOrderByNumber" resultType="com.goafanti.common.model.JtBusinessProject">
  764. select
  765. <include refid="Base_Column_List" />
  766. from jt_business_project jtbp
  767. where audit_status=2
  768. order by create_time desc
  769. </select>
  770. <select id="findInterestedProjcet" resultType="com.goafanti.common.model.JtBusinessProject">
  771. select
  772. jtbp.id,
  773. jtbp.name,
  774. jtbp.category_id as categoryId,
  775. jtbp.number,
  776. jtbp.price,
  777. jtbp.activity_price as activityPrice,
  778. jtbp.member_price as memberPrice,
  779. jtbp.offset,
  780. jtbp.activity_flag as activityFlag,
  781. jtbp.introduce,
  782. jtbp.province, jtbp.city,
  783. jtbp.create_time as createTime,
  784. jtbp.min_img_url as minImgUrl,
  785. jtbp.max_img_url as maxImgUrl,
  786. jtbp.value,
  787. jtbp.apply_conditions as applyConditions,
  788. jtbp.is_hot as isHot,
  789. jtbp.audit_status as auditStatus,
  790. jtbp.release_Date as releaseDate,
  791. jtbp.advertisement
  792. from
  793. jt_business_project jtbp
  794. left join project_interest pi on jtbp.id=pi.project_id
  795. where pi.uid=#{uid,jdbcType=VARCHAR}
  796. <if test="page_sql!=null">
  797. ${page_sql}
  798. </if>
  799. </select>
  800. <select id="findInterestedProjcetCount" resultType="java.lang.Integer">
  801. select
  802. count(0)
  803. from
  804. jt_business_project jtbp
  805. left join project_interest pi on jtbp.id=pi.project_id
  806. where pi.uid=#{uid,jdbcType=VARCHAR}
  807. </select>
  808. <select id="myCollectionProjectList" resultType="com.goafanti.common.bo.MyCollection">
  809. select
  810. jtbp.id,
  811. jtbp.name,
  812. jtbp.advertisement as introduction,
  813. jtbp.price as textA,
  814. u.nickname as ownerName,
  815. jtbp.min_img_url as ImgUrl,
  816. ifnull(p.count,'0') as interestCount
  817. from
  818. jt_business_project jtbp
  819. left join project_interest pi on jtbp.id=pi.project_id
  820. left join `user` u on jtbp.owner_id =u.id
  821. left join (select project_id,count(*) as count from project_interest group by project_id) p
  822. on p.project_id=jtbp.id
  823. where pi.uid=#{uid,jdbcType=VARCHAR}
  824. order by pi.create_time desc
  825. <if test="page_sql!=null">
  826. ${page_sql}
  827. </if>
  828. </select>
  829. <select id="myCollectionProjectCount" resultType="java.lang.Integer">
  830. select
  831. count(0)
  832. from
  833. jt_business_project jtbp
  834. left join project_interest pi on jtbp.id=pi.project_id
  835. where pi.uid=#{uid,jdbcType=VARCHAR}
  836. </select>
  837. <select id="recommendedApplicationList" resultType="com.goafanti.common.bo.MyCollection">
  838. select a.id,a.name,a.advertisement as introduction,a.price as textA,
  839. c.nickname as ownerName,ifnull(d.count,0) as interestCount,a.min_img_url as ImgUrl
  840. from jt_business_project a
  841. left join jt_business_category b on a.category_id=b.id
  842. left join user c on a.owner_id=c.id
  843. left join (select project_id as id,count(*) as count from project_interest group by project_id) d
  844. on a.id=d.id
  845. where a.is_hot=1 and a.audit_status=2
  846. <if test="type==1">
  847. and b.module != 1
  848. </if>
  849. <if test="type==2">
  850. and b.module = 5
  851. </if>
  852. order by a.release_date desc
  853. <if test="page_sql!=null">
  854. ${page_sql}
  855. </if>
  856. </select>
  857. <select id="recommendedApplicationCount" resultType="java.lang.Integer">
  858. select count(*)
  859. from jt_business_project a
  860. left join jt_business_category b on a.category_id=b.id
  861. where a.is_hot=1 and a.audit_status=2
  862. <if test="type==1">
  863. and b.module != 1
  864. </if>
  865. <if test="type==2">
  866. and b.module = 5
  867. </if>
  868. </select>
  869. <!-- 查看科技服务项目 -->
  870. <select id="getKJListByIds" resultType="com.goafanti.common.model.JtBusinessProject">
  871. select
  872. p.id,
  873. p.name,
  874. p.introduce,
  875. p.min_img_url as minImgUrl,
  876. p.price,
  877. p.advertisement
  878. from jt_business_project p
  879. left join jt_business_category c on p.category_id = c.id
  880. where c.module = #{module}
  881. and p.audit_status = 2
  882. <if test="isHot">
  883. and is_hot = #{isHot}
  884. </if>
  885. order by release_date desc
  886. limit #{size}
  887. </select>
  888. <!-- 根据二级分类名称查 -->
  889. <select id="getModuleByName" resultType="com.goafanti.common.model.JtBusinessProject">
  890. select b.id,
  891. b.name,
  892. b.introduce,
  893. b.min_img_url as minImgUrl
  894. from (select x.id from jt_business_category x inner join jt_business_category y on x.super_id = y.id where y.name=#{name})a
  895. left join jt_business_project b on a.id = b.category_id
  896. where
  897. b.audit_status = 2
  898. <if test="isHot">
  899. and is_hot = #{isHot}
  900. </if>
  901. order by b.release_date desc
  902. limit #{size}
  903. </select>
  904. <!-- 根据项目标签名称查出拥有该标签的项目 -->
  905. <select id="getProjectByTag" resultMap="BaseResultMap">
  906. select p.* from jt_tag t
  907. inner join jt_business_project_tag pt on t.id = pt.tag_id
  908. inner join jt_business_project p on pt.project_id = p.id
  909. where p.audit_status = 2 and t.name = #{name}
  910. order by p.release_date desc
  911. limit #{size}
  912. </select>
  913. </mapper>