AchievementMapper.xml 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347
  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.AchievementMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.Achievement">
  5. <id column="id" jdbcType="VARCHAR" property="id" />
  6. <result column="serial_number" jdbcType="INTEGER" property="serialNumber" />
  7. <result column="data_category" jdbcType="INTEGER" property="dataCategory" />
  8. <result column="name" jdbcType="VARCHAR" property="name" />
  9. <result column="keyword" jdbcType="VARCHAR" property="keyword" />
  10. <result column="category" jdbcType="INTEGER" property="category" />
  11. <result column="summary" jdbcType="VARCHAR" property="summary" />
  12. <result column="introduction" jdbcType="LONGVARCHAR" property="introduction" />
  13. <result column="technical_picture_url" jdbcType="VARCHAR" property="technicalPictureUrl" />
  14. <result column="field_a" jdbcType="INTEGER" property="fieldA" />
  15. <result column="field_b" jdbcType="INTEGER" property="fieldB" />
  16. <result column="field_c" jdbcType="INTEGER" property="fieldC" />
  17. <result column="maturity" jdbcType="INTEGER" property="maturity" />
  18. <result column="maturity_picture_url" jdbcType="LONGVARCHAR" property="maturityPictureUrl" />
  19. <result column="maturity_text_file_url" jdbcType="VARCHAR" property="maturityTextFileUrl" />
  20. <result column="maturity_video_url" jdbcType="VARCHAR" property="maturityVideoUrl" />
  21. <result column="innovation" jdbcType="INTEGER" property="innovation" />
  22. <result column="owner_id" jdbcType="VARCHAR" property="ownerId" />
  23. <result column="owner_name" jdbcType="VARCHAR" property="ownerName" />
  24. <result column="owner_type" jdbcType="INTEGER" property="ownerType" />
  25. <result column="owner_id_number" jdbcType="VARCHAR" property="ownerIdNumber" />
  26. <result column="owner_mobile" jdbcType="VARCHAR" property="ownerMobile" />
  27. <result column="owner_email" jdbcType="VARCHAR" property="ownerEmail" />
  28. <result column="owner_postal_address" jdbcType="VARCHAR" property="ownerPostalAddress" />
  29. <result column="cooperation_mode" jdbcType="INTEGER" property="cooperationMode" />
  30. <result column="transfer_mode" jdbcType="INTEGER" property="transferMode" />
  31. <result column="bargaining_mode" jdbcType="INTEGER" property="bargainingMode" />
  32. <result column="transfer_price" jdbcType="DECIMAL" property="transferPrice" />
  33. <result column="technical_scene" jdbcType="VARCHAR" property="technicalScene" />
  34. <result column="breakthrough" jdbcType="VARCHAR" property="breakthrough" />
  35. <result column="patent_case" jdbcType="VARCHAR" property="patentCase" />
  36. <result column="awards" jdbcType="VARCHAR" property="awards" />
  37. <result column="team_des" jdbcType="VARCHAR" property="teamDes" />
  38. <result column="parameter" jdbcType="VARCHAR" property="parameter" />
  39. <result column="tech_plan_url" jdbcType="VARCHAR" property="techPlanUrl" />
  40. <result column="business_plan_url" jdbcType="VARCHAR" property="businessPlanUrl" />
  41. <result column="org_id" jdbcType="VARCHAR" property="orgId" />
  42. <result column="org_name" jdbcType="VARCHAR" property="orgName" />
  43. <result column="org_address" jdbcType="VARCHAR" property="orgAddress" />
  44. <result column="org_email" jdbcType="VARCHAR" property="orgEmail" />
  45. <result column="org_contacts" jdbcType="VARCHAR" property="orgContacts" />
  46. <result column="org_contacts_mobile" jdbcType="VARCHAR" property="orgContactsMobile" />
  47. <result column="manager_id" jdbcType="VARCHAR" property="managerId" />
  48. <result column="salesman_id" jdbcType="VARCHAR" property="salesmanId" />
  49. <result column="status" jdbcType="INTEGER" property="status" />
  50. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  51. <result column="release_status" jdbcType="INTEGER" property="releaseStatus" />
  52. <result column="release_date" jdbcType="TIMESTAMP" property="releaseDate" />
  53. <result column="deleted_sign" jdbcType="INTEGER" property="deletedSign" />
  54. <result column="audit_status" jdbcType="INTEGER" property="auditStatus" />
  55. <result column="tech_broker_id" jdbcType="VARCHAR" property="techBrokerId" />
  56. <result column="country_name_zh" jdbcType="VARCHAR" property="countryNameZh" />
  57. <result column="international_flag" jdbcType="INTEGER" property="internationalFlag" />
  58. <result column="jmrh_flag" jdbcType="INTEGER" property="jmrhFlag" />
  59. <result column="boutique" jdbcType="INTEGER" property="boutique" />
  60. <result column="contacts" jdbcType="VARCHAR" property="contacts" />
  61. <result column="contact_mobile" jdbcType="VARCHAR" property="contactMobile" />
  62. </resultMap>
  63. <sql id="Base_Column_List">
  64. id, serial_number, data_category, name, keyword, category, summary, introduction,
  65. technical_picture_url, field_a, field_b, field_c, maturity, maturity_picture_url,
  66. maturity_text_file_url, maturity_video_url, innovation, owner_id, owner_name, owner_type, owner_id_number,
  67. owner_mobile, owner_email, owner_postal_address, cooperation_mode, transfer_mode,
  68. bargaining_mode, transfer_price, technical_scene, breakthrough, patent_case, awards,
  69. team_des, parameter, tech_plan_url, business_plan_url, org_id, org_name, org_address,
  70. org_email, org_contacts, org_contacts_mobile, contacts, manager_id, salesman_id,
  71. status, create_time, release_status, release_date, deleted_sign, audit_status, tech_broker_id,
  72. country_name_zh,international_flag,jmrh_flag,boutique
  73. </sql>
  74. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  75. select
  76. <include refid="Base_Column_List" />
  77. from achievement
  78. where id = #{id,jdbcType=VARCHAR}
  79. </select>
  80. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  81. delete from achievement
  82. where id = #{id,jdbcType=VARCHAR}
  83. </delete>
  84. <insert id="insert" parameterType="com.goafanti.common.model.Achievement">
  85. insert into achievement (id, serial_number, data_category,
  86. name, keyword, category,
  87. summary, introduction, technical_picture_url,
  88. field_a, field_b, field_c,
  89. maturity, innovation, owner_id, owner_postal_address, cooperation_mode,
  90. transfer_mode, bargaining_mode, transfer_price, patent_case,
  91. awards, team_des, parameter, status,
  92. create_time, release_status, release_date,
  93. deleted_sign, audit_status,international_flag,boutique,is_hot)
  94. values (#{id,jdbcType=VARCHAR}, #{serialNumber,jdbcType=INTEGER}, #{dataCategory,jdbcType=INTEGER},
  95. #{name,jdbcType=VARCHAR}, #{keyword,jdbcType=VARCHAR}, #{category,jdbcType=INTEGER},
  96. #{summary,jdbcType=VARCHAR}, #{introduction,jdbcType=LONGVARCHAR}, #{technicalPictureUrl,jdbcType=VARCHAR},
  97. #{fieldA,jdbcType=INTEGER}, #{fieldB,jdbcType=INTEGER}, #{fieldC,jdbcType=INTEGER},
  98. #{maturity,jdbcType=INTEGER}, #{innovation,jdbcType=INTEGER}, #{ownerId,jdbcType=VARCHAR}
  99. , #{ownerPostalAddress,jdbcType=VARCHAR}, #{cooperationMode,jdbcType=INTEGER},
  100. #{transferMode,jdbcType=INTEGER}, #{bargainingMode,jdbcType=INTEGER}, #{transferPrice,jdbcType=DECIMAL},
  101. #{patentCase,jdbcType=VARCHAR},
  102. #{awards,jdbcType=VARCHAR}, #{teamDes,jdbcType=VARCHAR}, #{parameter,jdbcType=VARCHAR},
  103. #{status,jdbcType=INTEGER},
  104. #{createTime,jdbcType=TIMESTAMP}, #{releaseStatus,jdbcType=INTEGER}, #{releaseDate,jdbcType=TIMESTAMP},
  105. #{deletedSign,jdbcType=INTEGER}, #{auditStatus,jdbcType=INTEGER},
  106. #{internationalFlag,jdbcType=INTEGER},#{boutique,jdbcType=INTEGER}),#{isHot,jdbcType=INTEGER}
  107. </insert>
  108. <insert id="insertSelective" parameterType="com.goafanti.common.model.Achievement">
  109. insert into achievement
  110. <trim prefix="(" suffix=")" suffixOverrides=",">
  111. <if test="id != null">
  112. id,
  113. </if>
  114. <if test="serialNumber != null">
  115. serial_number,
  116. </if>
  117. <if test="dataCategory != null">
  118. data_category,
  119. </if>
  120. <if test="name != null">
  121. name,
  122. </if>
  123. <if test="keyword != null">
  124. keyword,
  125. </if>
  126. <if test="category != null">
  127. category,
  128. </if>
  129. <if test="summary != null">
  130. summary,
  131. </if>
  132. <if test="introduction != null">
  133. introduction,
  134. </if>
  135. <if test="technicalPictureUrl != null">
  136. technical_picture_url,
  137. </if>
  138. <if test="fieldA != null">
  139. field_a,
  140. </if>
  141. <if test="fieldB != null">
  142. field_b,
  143. </if>
  144. <if test="fieldC != null">
  145. field_c,
  146. </if>
  147. <if test="maturity != null">
  148. maturity,
  149. </if>
  150. <if test="maturityPictureUrl != null">
  151. maturity_picture_url,
  152. </if>
  153. <if test="maturityTextFileUrl != null">
  154. maturity_text_file_url,
  155. </if>
  156. <if test="maturityVideoUrl != null">
  157. maturity_video_url,
  158. </if>
  159. <if test="innovation != null">
  160. innovation,
  161. </if>
  162. <if test="ownerId != null">
  163. owner_id,
  164. </if>
  165. <if test="ownerName != null">
  166. owner_name,
  167. </if>
  168. <if test="ownerType != null">
  169. owner_type,
  170. </if>
  171. <if test="ownerIdNumber != null">
  172. owner_id_number,
  173. </if>
  174. <if test="ownerMobile != null">
  175. owner_mobile,
  176. </if>
  177. <if test="ownerEmail != null">
  178. owner_email,
  179. </if>
  180. <if test="ownerPostalAddress != null">
  181. owner_postal_address,
  182. </if>
  183. <if test="cooperationMode != null">
  184. cooperation_mode,
  185. </if>
  186. <if test="transferMode != null">
  187. transfer_mode,
  188. </if>
  189. <if test="bargainingMode != null">
  190. bargaining_mode,
  191. </if>
  192. <if test="transferPrice != null">
  193. transfer_price,
  194. </if>
  195. <if test="technicalScene != null">
  196. technical_scene,
  197. </if>
  198. <if test="breakthrough != null">
  199. breakthrough,
  200. </if>
  201. <if test="patentCase != null">
  202. patent_case,
  203. </if>
  204. <if test="awards != null">
  205. awards,
  206. </if>
  207. <if test="teamDes != null">
  208. team_des,
  209. </if>
  210. <if test="parameter != null">
  211. parameter,
  212. </if>
  213. <if test="techPlanUrl != null">
  214. tech_plan_url,
  215. </if>
  216. <if test="businessPlanUrl != null">
  217. business_plan_url,
  218. </if>
  219. <if test="orgId != null">
  220. org_id,
  221. </if>
  222. <if test="orgName != null">
  223. org_name,
  224. </if>
  225. <if test="orgAddress != null">
  226. org_address,
  227. </if>
  228. <if test="orgEmail != null">
  229. org_email,
  230. </if>
  231. <if test="orgContacts != null">
  232. org_contacts,
  233. </if>
  234. <if test="orgContactsMobile != null">
  235. org_contacts_mobile,
  236. </if>
  237. <if test="contacts != null">
  238. contacts,
  239. </if>
  240. <if test="managerId != null">
  241. manager_id,
  242. </if>
  243. <if test="salesmanId != null">
  244. salesman_id,
  245. </if>
  246. <if test="status != null">
  247. status,
  248. </if>
  249. <if test="createTime != null">
  250. create_time,
  251. </if>
  252. <if test="releaseStatus != null">
  253. release_status,
  254. </if>
  255. <if test="releaseDate != null">
  256. release_date,
  257. </if>
  258. <if test="deletedSign != null">
  259. deleted_sign,
  260. </if>
  261. <if test="auditStatus != null">
  262. audit_status,
  263. </if>
  264. <if test="techBrokerId != null">
  265. tech_broker_id,
  266. </if>
  267. <if test="countryNameZh != null">
  268. country_name_zh,
  269. </if>
  270. <if test="internationalFlag != null">
  271. international_flag,
  272. </if>
  273. <if test="jmrhFlag != null">
  274. jmrh_flag,
  275. </if>
  276. <if test="boutique !=null">
  277. boutique,
  278. </if>
  279. </trim>
  280. <trim prefix="values (" suffix=")" suffixOverrides=",">
  281. <if test="id != null">
  282. #{id,jdbcType=VARCHAR},
  283. </if>
  284. <if test="serialNumber != null">
  285. #{serialNumber,jdbcType=INTEGER},
  286. </if>
  287. <if test="dataCategory != null">
  288. #{dataCategory,jdbcType=INTEGER},
  289. </if>
  290. <if test="name != null">
  291. #{name,jdbcType=VARCHAR},
  292. </if>
  293. <if test="keyword != null">
  294. #{keyword,jdbcType=VARCHAR},
  295. </if>
  296. <if test="category != null">
  297. #{category,jdbcType=INTEGER},
  298. </if>
  299. <if test="summary != null">
  300. #{summary,jdbcType=VARCHAR},
  301. </if>
  302. <if test="introduction != null">
  303. #{introduction,jdbcType=LONGVARCHAR},
  304. </if>
  305. <if test="technicalPictureUrl != null">
  306. #{technicalPictureUrl,jdbcType=VARCHAR},
  307. </if>
  308. <if test="fieldA != null">
  309. #{fieldA,jdbcType=INTEGER},
  310. </if>
  311. <if test="fieldB != null">
  312. #{fieldB,jdbcType=INTEGER},
  313. </if>
  314. <if test="fieldC != null">
  315. #{fieldC,jdbcType=INTEGER},
  316. </if>
  317. <if test="maturity != null">
  318. #{maturity,jdbcType=INTEGER},
  319. </if>
  320. <if test="maturityPictureUrl != null">
  321. #{maturityPictureUrl,jdbcType=LONGVARCHAR},
  322. </if>
  323. <if test="maturityTextFileUrl != null">
  324. #{maturityTextFileUrl,jdbcType=VARCHAR},
  325. </if>
  326. <if test="maturityVideoUrl != null">
  327. #{maturityVideoUrl,jdbcType=VARCHAR},
  328. </if>
  329. <if test="innovation != null">
  330. #{innovation,jdbcType=INTEGER},
  331. </if>
  332. <if test="ownerId != null">
  333. #{ownerId,jdbcType=VARCHAR},
  334. </if>
  335. <if test="ownerName != null">
  336. #{ownerName,jdbcType=VARCHAR},
  337. </if>
  338. <if test="ownerType != null">
  339. #{ownerType,jdbcType=INTEGER},
  340. </if>
  341. <if test="ownerIdNumber != null">
  342. #{ownerIdNumber,jdbcType=VARCHAR},
  343. </if>
  344. <if test="ownerMobile != null">
  345. #{ownerMobile,jdbcType=VARCHAR},
  346. </if>
  347. <if test="ownerEmail != null">
  348. #{ownerEmail,jdbcType=VARCHAR},
  349. </if>
  350. <if test="ownerPostalAddress != null">
  351. #{ownerPostalAddress,jdbcType=VARCHAR},
  352. </if>
  353. <if test="cooperationMode != null">
  354. #{cooperationMode,jdbcType=INTEGER},
  355. </if>
  356. <if test="transferMode != null">
  357. #{transferMode,jdbcType=INTEGER},
  358. </if>
  359. <if test="bargainingMode != null">
  360. #{bargainingMode,jdbcType=INTEGER},
  361. </if>
  362. <if test="transferPrice != null">
  363. #{transferPrice,jdbcType=DECIMAL},
  364. </if>
  365. <if test="technicalScene != null">
  366. #{technicalScene,jdbcType=VARCHAR},
  367. </if>
  368. <if test="breakthrough != null">
  369. #{breakthrough,jdbcType=VARCHAR},
  370. </if>
  371. <if test="patentCase != null">
  372. #{patentCase,jdbcType=VARCHAR},
  373. </if>
  374. <if test="awards != null">
  375. #{awards,jdbcType=VARCHAR},
  376. </if>
  377. <if test="teamDes != null">
  378. #{teamDes,jdbcType=VARCHAR},
  379. </if>
  380. <if test="parameter != null">
  381. #{parameter,jdbcType=VARCHAR},
  382. </if>
  383. <if test="techPlanUrl != null">
  384. #{techPlanUrl,jdbcType=VARCHAR},
  385. </if>
  386. <if test="businessPlanUrl != null">
  387. #{businessPlanUrl,jdbcType=VARCHAR},
  388. </if>
  389. <if test="orgId != null">
  390. #{orgId,jdbcType=VARCHAR},
  391. </if>
  392. <if test="orgName != null">
  393. #{orgName,jdbcType=VARCHAR},
  394. </if>
  395. <if test="orgAddress != null">
  396. #{orgAddress,jdbcType=VARCHAR},
  397. </if>
  398. <if test="orgEmail != null">
  399. #{orgEmail,jdbcType=VARCHAR},
  400. </if>
  401. <if test="orgContacts != null">
  402. #{orgContacts,jdbcType=VARCHAR},
  403. </if>
  404. <if test="orgContactsMobile != null">
  405. #{orgContactsMobile,jdbcType=VARCHAR},
  406. </if>
  407. <if test="contacts != null">
  408. #{contacts,jdbcType=INTEGER},
  409. </if>
  410. <if test="managerId != null">
  411. #{managerId,jdbcType=VARCHAR},
  412. </if>
  413. <if test="salesmanId != null">
  414. #{salesmanId,jdbcType=VARCHAR},
  415. </if>
  416. <if test="status != null">
  417. #{status,jdbcType=INTEGER},
  418. </if>
  419. <if test="createTime != null">
  420. #{createTime,jdbcType=TIMESTAMP},
  421. </if>
  422. <if test="releaseStatus != null">
  423. #{releaseStatus,jdbcType=INTEGER},
  424. </if>
  425. <if test="releaseDate != null">
  426. #{releaseDate,jdbcType=TIMESTAMP},
  427. </if>
  428. <if test="deletedSign != null">
  429. #{deletedSign,jdbcType=INTEGER},
  430. </if>
  431. <if test="auditStatus != null">
  432. #{auditStatus,jdbcType=INTEGER},
  433. </if>
  434. <if test="techBrokerId != null">
  435. #{techBrokerId,jdbcType=VARCHAR},
  436. </if>
  437. <if test="countryNameZh != null">
  438. #{countryNameZh,jdbcType=VARCHAR},
  439. </if>
  440. <if test="internationalFlag != null">
  441. #{internationalFlag,jdbcType=INTEGER},
  442. </if>
  443. <if test="jmrhFlag != null">
  444. #{jmrhFlag,jdbcType=INTEGER},
  445. </if>
  446. <if test="boutique != null">
  447. #{boutique,jdbcType=INTEGER}
  448. </if>
  449. </trim>
  450. </insert>
  451. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.Achievement">
  452. update achievement
  453. <set>
  454. <if test="serialNumber != null">
  455. serial_number = #{serialNumber,jdbcType=INTEGER},
  456. </if>
  457. <if test="dataCategory != null">
  458. data_category = #{dataCategory,jdbcType=INTEGER},
  459. </if>
  460. <if test="name != null">
  461. name = #{name,jdbcType=VARCHAR},
  462. </if>
  463. <if test="keyword != null">
  464. keyword = #{keyword,jdbcType=VARCHAR},
  465. </if>
  466. <if test="category != null">
  467. category = #{category,jdbcType=INTEGER},
  468. </if>
  469. <if test="summary != null">
  470. summary = #{summary,jdbcType=VARCHAR},
  471. </if>
  472. <if test="introduction != null">
  473. introduction = #{introduction,jdbcType=LONGVARCHAR},
  474. </if>
  475. <if test="technicalPictureUrl != null">
  476. technical_picture_url = #{technicalPictureUrl,jdbcType=VARCHAR},
  477. </if>
  478. <if test="fieldA != null">
  479. field_a = #{fieldA,jdbcType=INTEGER},
  480. </if>
  481. <if test="fieldB != null">
  482. field_b = #{fieldB,jdbcType=INTEGER},
  483. </if>
  484. <if test="fieldC != null">
  485. field_c = #{fieldC,jdbcType=INTEGER},
  486. </if>
  487. <if test="maturity != null">
  488. maturity = #{maturity,jdbcType=INTEGER},
  489. </if>
  490. <if test="innovation != null">
  491. innovation = #{innovation,jdbcType=INTEGER},
  492. </if>
  493. <if test="ownerId != null">
  494. owner_id = #{ownerId,jdbcType=VARCHAR},
  495. </if>
  496. <if test="ownerPostalAddress != null">
  497. owner_postal_address = #{ownerPostalAddress,jdbcType=VARCHAR},
  498. </if>
  499. <if test="cooperationMode != null">
  500. cooperation_mode = #{cooperationMode,jdbcType=INTEGER},
  501. </if>
  502. <if test="transferMode != null">
  503. transfer_mode = #{transferMode,jdbcType=INTEGER},
  504. </if>
  505. <if test="bargainingMode != null">
  506. bargaining_mode = #{bargainingMode,jdbcType=INTEGER},
  507. </if>
  508. <if test="transferPrice != null">
  509. transfer_price = #{transferPrice,jdbcType=DECIMAL},
  510. </if>
  511. <if test="patentCase != null">
  512. patent_case = #{patentCase,jdbcType=VARCHAR},
  513. </if>
  514. <if test="awards != null">
  515. awards = #{awards,jdbcType=VARCHAR},
  516. </if>
  517. <if test="teamDes != null">
  518. team_des = #{teamDes,jdbcType=VARCHAR},
  519. </if>
  520. <if test="parameter != null">
  521. parameter = #{parameter,jdbcType=VARCHAR},
  522. </if>
  523. <if test="status != null">
  524. status = #{status,jdbcType=INTEGER},
  525. </if>
  526. <if test="createTime != null">
  527. create_time = #{createTime,jdbcType=TIMESTAMP},
  528. </if>
  529. <if test="releaseStatus != null">
  530. release_status = #{releaseStatus,jdbcType=INTEGER},
  531. </if>
  532. <if test="releaseDate != null">
  533. release_date = #{releaseDate,jdbcType=TIMESTAMP},
  534. </if>
  535. <if test="deletedSign != null">
  536. deleted_sign = #{deletedSign,jdbcType=INTEGER},
  537. </if>
  538. <if test="auditStatus != null">
  539. audit_status = #{auditStatus,jdbcType=INTEGER},
  540. </if>
  541. <if test="countryNameZh != null">
  542. country_name_zh = #{countryNameZh,jdbcType=VARCHAR},
  543. </if>
  544. <if test="internationalFlag != null">
  545. international_flag = #{internationalFlag,jdbcType=INTEGER},
  546. </if>
  547. <if test="boutique != null">
  548. boutique = #{boutique,jdbcType=INTEGER},
  549. </if>
  550. <if test="isHot != null">
  551. is_hot = #{isHot,jdbcType=INTEGER},
  552. </if>
  553. </set>
  554. where id = #{id,jdbcType=VARCHAR}
  555. </update>
  556. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.Achievement">
  557. update achievement
  558. set serial_number = #{serialNumber,jdbcType=INTEGER},
  559. data_category = #{dataCategory,jdbcType=INTEGER},
  560. name = #{name,jdbcType=VARCHAR},
  561. keyword = #{keyword,jdbcType=VARCHAR},
  562. category = #{category,jdbcType=INTEGER},
  563. summary = #{summary,jdbcType=VARCHAR},
  564. introduction = #{introduction,jdbcType=LONGVARCHAR},
  565. technical_picture_url = #{technicalPictureUrl,jdbcType=VARCHAR},
  566. field_a = #{fieldA,jdbcType=INTEGER},
  567. field_b = #{fieldB,jdbcType=INTEGER},
  568. field_c = #{fieldC,jdbcType=INTEGER},
  569. maturity = #{maturity,jdbcType=INTEGER},
  570. maturity_picture_url = #{maturityPictureUrl,jdbcType=LONGVARCHAR},
  571. maturity_text_file_url = #{maturityTextFileUrl,jdbcType=VARCHAR},
  572. maturity_video_url = #{maturityVideoUrl,jdbcType=VARCHAR},
  573. innovation = #{innovation,jdbcType=INTEGER},
  574. owner_id = #{ownerId,jdbcType=VARCHAR},
  575. owner_name = #{ownerName,jdbcType=VARCHAR},
  576. owner_type = #{ownerType,jdbcType=INTEGER},
  577. owner_id_number = #{ownerIdNumber,jdbcType=VARCHAR},
  578. owner_mobile = #{ownerMobile,jdbcType=VARCHAR},
  579. owner_email = #{ownerEmail,jdbcType=VARCHAR},
  580. owner_postal_address = #{ownerPostalAddress,jdbcType=VARCHAR},
  581. cooperation_mode = #{cooperationMode,jdbcType=INTEGER},
  582. transfer_mode = #{transferMode,jdbcType=INTEGER},
  583. bargaining_mode = #{bargainingMode,jdbcType=INTEGER},
  584. transfer_price = #{transferPrice,jdbcType=DECIMAL},
  585. technical_scene = #{technicalScene,jdbcType=VARCHAR},
  586. breakthrough = #{breakthrough,jdbcType=VARCHAR},
  587. patent_case = #{patentCase,jdbcType=VARCHAR},
  588. awards = #{awards,jdbcType=VARCHAR},
  589. team_des = #{teamDes,jdbcType=VARCHAR},
  590. parameter = #{parameter,jdbcType=VARCHAR},
  591. tech_plan_url = #{techPlanUrl,jdbcType=VARCHAR},
  592. business_plan_url = #{businessPlanUrl,jdbcType=VARCHAR},
  593. org_id = #{orgId,jdbcType=VARCHAR},
  594. org_name = #{orgName,jdbcType=VARCHAR},
  595. org_address = #{orgAddress,jdbcType=VARCHAR},
  596. org_email = #{orgEmail,jdbcType=VARCHAR},
  597. org_contacts = #{orgContacts,jdbcType=VARCHAR},
  598. org_contacts_mobile = #{orgContactsMobile,jdbcType=VARCHAR},
  599. contacts = #{contacts,jdbcType=INTEGER},
  600. manager_id = #{managerId,jdbcType=VARCHAR},
  601. salesman_id = #{salesmanId,jdbcType=VARCHAR},
  602. status = #{status,jdbcType=INTEGER},
  603. create_time = #{createTime,jdbcType=TIMESTAMP},
  604. release_status = #{releaseStatus,jdbcType=INTEGER},
  605. release_date = #{releaseDate,jdbcType=TIMESTAMP},
  606. deleted_sign = #{deletedSign,jdbcType=INTEGER},
  607. audit_status = #{auditStatus,jdbcType=INTEGER},
  608. tech_broker_id = #{techBrokerId,jdbcType=VARCHAR},
  609. country_name_zh = #{countryNameZh,jdbcType=VARCHAR},
  610. international_flag = #{internationalFlag,jdbcType=INTEGER},
  611. jmrh_flag = #{jmrhFlag,jdbcType=INTEGER},
  612. boutique = #{boutique,jdbcType=INTEGER}
  613. where id = #{id,jdbcType=VARCHAR}
  614. </update>
  615. <update id="batchDeleteByPrimaryKey" parameterType="java.util.List">
  616. update achievement set deleted_sign = 1
  617. where id in
  618. <foreach item="item" collection="list" open="(" separator="," close=")">
  619. #{item}
  620. </foreach>
  621. </update>
  622. <select id="findAppAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
  623. select
  624. a.id, a.serial_number as serialNumber, a.data_category as dataCategory, a.boutique,
  625. a.name, a.keyword, a.category, a.introduction,owner_postal_address as ownerPostalAddress,
  626. a.owner_name as ownerName, a.owner_type as ownerType, a.owner_mobile as ownerMobile,a.field_a as fieldA,a.field_b ,a.field_c as fieldC,
  627. a.status, a.release_date as releaseDate, a.audit_status as auditStatus,f.name as field,f2.name as fieldB,ifnull(b.countInterest,0) as countInterest
  628. from achievement a
  629. left join (
  630. select count(0) as countInterest,achievement_id from achievement_interest group by achievement_id
  631. )b on a.id = b.achievement_id
  632. left join field_glossory f on a.field_a=f.id
  633. left join field_glossory f2 on a.field_b=f2.id
  634. where deleted_sign = 0
  635. and audit_status = 3
  636. <if test="ownerId != null">
  637. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  638. </if>
  639. <if test="serialNumber != null">
  640. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  641. </if>
  642. <if test="auditStatus != null">
  643. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  644. </if>
  645. <if test="name != null">
  646. and a.name = #{name,jdbcType=VARCHAR}
  647. </if>
  648. <if test="keyword != null">
  649. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  650. </if>
  651. <if test="dataCategory != null and dataCategory != ''">
  652. and a.data_category = #{dataCategory,jdbcType=INTEGER}
  653. </if>
  654. <if test="category != null">
  655. and a.category = #{category,jdbcType=INTEGER}
  656. </if>
  657. <if test="ownerType != null">
  658. and a.owner_type = #{ownerType,jdbcType=INTEGER}
  659. </if>
  660. <if test="fieldA != null">
  661. and a.field_a = #{fieldA,jdbcType=VARCHAR}
  662. </if>
  663. <if test="status != null">
  664. and a.status = #{status,jdbcType=INTEGER}
  665. </if>
  666. <if test="rStart != null">
  667. and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  668. </if>
  669. <if test="rEnd != null">
  670. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  671. </if>
  672. <if test="releaseStatus != null">
  673. and a.release_status = #{releaseStatus,jdbcType=INTEGER}
  674. </if>
  675. order by a.boutique desc
  676. <if test="page_sql!=null">
  677. ${page_sql}
  678. </if>
  679. </select>
  680. <select id="findAppAchievementCount" parameterType="String" resultType="java.lang.Integer">
  681. select
  682. count(1)
  683. from achievement a
  684. left join field_glossory f on a.field_a=f.id
  685. left join field_glossory f2 on a.field_b=f2.id
  686. where deleted_sign = 0
  687. and audit_status = 3
  688. <if test="ownerId != null">
  689. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  690. </if>
  691. <if test="serialNumber != null">
  692. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  693. </if>
  694. <if test="auditStatus != null">
  695. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  696. </if>
  697. <if test="name != null">
  698. and a.name = #{name,jdbcType=VARCHAR}
  699. </if>
  700. <if test="keyword != null">
  701. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  702. </if>
  703. <if test="dataCategory != null and dataCategory != ''">
  704. and a.data_category = #{dataCategory,jdbcType=INTEGER}
  705. </if>
  706. <if test="category != null">
  707. and a.category = #{category,jdbcType=INTEGER}
  708. </if>
  709. <if test="ownerType != null">
  710. and a.owner_type = #{ownerType,jdbcType=INTEGER}
  711. </if>
  712. <if test="fieldA != null">
  713. and a.field_a = #{fieldA,jdbcType=VARCHAR}
  714. </if>
  715. <if test="status != null">
  716. and a.status = #{status,jdbcType=INTEGER}
  717. </if>
  718. <if test="rStart != null">
  719. and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  720. </if>
  721. <if test="rEnd != null">
  722. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  723. </if>
  724. <if test="releaseStatus != null">
  725. and a.release_status = #{releaseStatus,jdbcType=INTEGER}
  726. </if>
  727. </select>
  728. <select id="selectUserOwnerDetail" parameterType="java.lang.String" resultType="com.goafanti.achievement.bo.AchievementUserOwnerDetailBo">
  729. select
  730. a.id, a.serial_number as serialNumber, a.data_category as dataCategory,
  731. a.name, a.keyword, a.category,
  732. a.summary, a.introduction, a.technical_picture_url as technicalPictureUrl,
  733. a.field_a as fieldA, a.field_b as fieldB, a.field_c as fieldC, f.name as field1, f2.name as field2,
  734. a.maturity, a.maturity_picture_url as maturityPictureUrl, a.maturity_text_file_url as maturityTextFileUrl,
  735. a.maturity_video_url as maturityVideoUrl, a.innovation, a.owner_id as ownerId,
  736. a.owner_name as ownerName, a.owner_type as ownerType, a.owner_id_number as ownerIdNumber,
  737. a.owner_mobile as ownerMobile, a.owner_email as ownerEmail, a.owner_postal_address as ownerPostalAddress,
  738. a.cooperation_mode as cooperationMode, a.transfer_mode as transferMode, a.bargaining_mode as bargainingMode,
  739. a.transfer_price as transferPrice, a.technical_scene as technicalScene, a.breakthrough,
  740. a.patent_case as patentCase, a.awards, a.team_des as teamDes,
  741. a.parameter, a.tech_plan_url as techPlanUrl, a.business_plan_url as businessPlanUrl,
  742. a.contacts, a.manager_id as managerId, a.salesman_id as salesmanId,
  743. a.create_time as createTime, a.release_status as releaseStatus,
  744. a.release_date as releaseDate, a.audit_status as auditStatus, a.tech_broker_id as techBrokerId,
  745. ui.username as iOwnerName, ui.province, ui.city, ui.area, u.email as iOwnerEmail,
  746. ui.id_number as iOwnerIdNumber, u.mobile as iOwnerMobile,j.easemob_name as easemobName,a.remark,
  747. ifnull(t.x,0) as orderIntentionCount ,ifnull(t2.x,0) as orderCount,ifnull(mm.effective,0) hot,a.boutique,a.contacts,a.contact_mobile as contactMobile,
  748. a.international_flag as internationalFlag
  749. from achievement a
  750. left join user_identity ui on a.owner_id = ui.uid
  751. left join field_glossory f on a.field_a=f.id
  752. left join field_glossory f2 on a.field_b=f2.id
  753. left join (select count(0) as x,tl.commodity_id from t_order tr
  754. left join t_order_detail tl on tl.order_no=tr.order_no
  755. where order_status != 4
  756. group by tl.commodity_id ) t on a.id=t.commodity_id
  757. left join (select count(0) as x,tl.commodity_id from t_order tr
  758. left join t_order_detail tl on tl.order_no=tr.order_no
  759. where tr.order_status != 4 and tr.order_status != 0
  760. group by tl.commodity_id) t2 on a.id=t2.commodity_id
  761. left join jpush_easemob_account j on a.owner_id=j.uid
  762. left join user u on u.id = a.owner_id
  763. left join marketing_management mm on a.id = mm.product_id
  764. where a.id =#{id,jdbcType=VARCHAR}
  765. </select>
  766. <select id="selectOrgOwnerDetail" parameterType="java.lang.String" resultType="com.goafanti.achievement.bo.AchievementOrgOwnerDetailBo">
  767. select
  768. a.id, a.serial_number as serialNumber, a.data_category as dataCategory,
  769. a.name, a.keyword, a.category,
  770. a.summary, a.introduction, a.technical_picture_url as technicalPictureUrl,
  771. a.field_a as fieldA, a.field_b as fieldB, a.field_c as fieldC,
  772. a.maturity, a.maturity_picture_url as maturityPictureUrl, a.maturity_text_file_url as maturityTextFileUrl,
  773. a.maturity_video_url as maturityVideoUrl, a.innovation, a.owner_id as ownerId,
  774. a.owner_name as ownerName, a.owner_type as ownerType, a.owner_id_number as ownerIdNumber,
  775. a.owner_mobile as ownerMobile, a.owner_email as ownerEmail, a.owner_postal_address as ownerPostalAddress,
  776. a.cooperation_mode as cooperationMode, a.transfer_mode as transferMode, a.bargaining_mode as bargainingMode,
  777. a.transfer_price as transferPrice, a.technical_scene as technicalScene, a.breakthrough,
  778. a.patent_case as patentCase, a.awards, a.team_des as teamDes,
  779. a.parameter, a.tech_plan_url as techPlanUrl, a.business_plan_url as businessPlanUrl,
  780. a.contacts, a.manager_id as managerId, a.salesman_id as salesmanId, a.international_flag as internationalFlag,
  781. a.create_time as createTime, a.release_status as releaseStatus,
  782. a.release_date as releaseDate, a.audit_status as auditStatus, a.tech_broker_id as techBrokerId,
  783. oi.unit_name as iOwnerName, oi.postal_address as iOwnerPostalAddress, u.email as iOwnerEmail,
  784. oi.org_code as iOwnerIdNumber, u.mobile as iOwnerMobile,a.boutique,ifnull(mm.effective,0) hot,mm.cover_img as coverImg,a.remark,a.contacts,a.contact_mobile as contactMobile
  785. from achievement a
  786. left join organization_identity oi on a.owner_id = oi.uid
  787. left join user u on u.id = a.owner_id
  788. left join marketing_management mm on a.id = mm.product_id
  789. where a.id = #{id,jdbcType=VARCHAR}
  790. </select>
  791. <insert id="insertBatch" parameterType="com.goafanti.common.model.Achievement">
  792. insert into achievement
  793. (id, deleted_sign, audit_status,
  794. create_time, release_status, data_category,
  795. name, keyword, category,
  796. owner_name, owner_type, owner_id_number,
  797. owner_mobile, owner_email, owner_postal_address,
  798. cooperation_mode, introduction, tech_broker_id,international_flag
  799. )
  800. values
  801. <foreach item="item" index="index" collection="list" separator=",">
  802. (
  803. #{item.id,jdbcType=VARCHAR}, #{item.deletedSign,jdbcType=INTEGER}, #{item.auditStatus,jdbcType=INTEGER},
  804. #{item.createTime,jdbcType=TIMESTAMP}, #{item.releaseStatus,jdbcType=INTEGER}, #{item.dataCategory,jdbcType=INTEGER},
  805. #{item.name,jdbcType=VARCHAR}, #{item.keyword,jdbcType=VARCHAR}, #{item.category,jdbcType=INTEGER},
  806. #{item.ownerName,jdbcType=VARCHAR}, #{item.ownerType,jdbcType=VARCHAR}, #{item.ownerIdNumber,jdbcType=VARCHAR},
  807. #{item.ownerMobile,jdbcType=VARCHAR}, #{item.ownerEmail,jdbcType=VARCHAR}, #{item.ownerPostalAddress,jdbcType=VARCHAR},
  808. #{item.cooperationMode,jdbcType=INTEGER}, #{item.introduction,jdbcType=LONGVARCHAR},#{item.techBrokerId,jdbcType=VARCHAR},
  809. #{item.internationalFlag,jdbcType=INTEGER}
  810. )
  811. </foreach>
  812. </insert>
  813. <select id="selectAchievementDetail" resultType="com.goafanti.portal.bo.AchievementDetailBo">
  814. select
  815. a.id,
  816. a.owner_name as ownerName,
  817. a.serial_number as serialNumber,
  818. a.keyword,
  819. a.name,
  820. a.data_category as dataCategory,
  821. a.category,
  822. ui.username,
  823. oi.unit_name as unitName,
  824. a.release_date as releaseDate,
  825. a.owner_type as ownerType,
  826. a.field_a as fieldA,
  827. a.field_b as fieldB,
  828. a.transfer_price as transferPrice,
  829. a.maturity,
  830. a.transfer_mode as transferMode,
  831. a.bargaining_mode as bargainingMode,
  832. a.summary,
  833. a.introduction,
  834. a.technical_picture_url as technicalPictureUrl,
  835. a.maturity_picture_url as maturityPictureUrl,
  836. a.maturity_text_file_url as maturityTextFileUrl,
  837. a.maturity_video_url as maturityVideoUrl,
  838. a.innovation,
  839. a.cooperation_mode as cooperationMode,
  840. a.bargaining_mode as bargainingMode,
  841. a.technical_scene as technicalScene,
  842. a.breakthrough,
  843. a.patent_case as patentCase,
  844. a.awards,
  845. a.team_des as teamDes,
  846. a.parameter,
  847. a.tech_plan_url as techPlanUrl,
  848. a.business_plan_url as businessPlanUrl,
  849. ai.id as achievementInterestId,
  850. ao.id as achievementOrderId,
  851. ao.status as orderStatus
  852. from achievement a
  853. left join user_identity ui on ui.uid = a.owner_id
  854. left join organization_identity oi on oi.uid = a.owner_id
  855. left join achievement_interest ai on ai.achievement_id = a.id and ai.uid = #{0}
  856. left join achievement_order ao on ao.achievement_id = a.id and ao.uid = #{0} and ao.status <![CDATA[ <> ]]> 6
  857. where a.id = #{1}
  858. </select>
  859. <select id="findPartnerAchievementListByPage" parameterType="java.lang.String" resultType="com.goafanti.achievement.bo.AchievementPartnerListBo">
  860. SELECT
  861. id,
  862. serial_number AS serialNumber,
  863. data_category AS dataCategory,
  864. NAME,
  865. keyword,
  866. category,
  867. owner_type as ownerType,
  868. release_date AS releaseDate,
  869. field_a as fieldA,
  870. maturity,
  871. introduction,
  872. technical_picture_url as technicalPictureUrl,
  873. bargaining_mode as bargainingMode,
  874. transfer_price as transferPrice
  875. FROM
  876. achievement
  877. WHERE
  878. audit_status = 3
  879. AND release_status = 1
  880. AND deleted_sign = 0
  881. AND owner_id = #{ownerId,jdbcType=VARCHAR}
  882. </select>
  883. <select id="findPartnerAchievementCount" parameterType="java.lang.String" resultType="java.lang.Integer">
  884. SELECT
  885. count(1)
  886. FROM
  887. achievement
  888. WHERE
  889. audit_status = 3
  890. AND release_status = 1
  891. AND deleted_sign = 0
  892. AND owner_id = #{ownerId,jdbcType=VARCHAR}
  893. </select>
  894. <select id="findUserPortalAchievementDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.AchievementPortalDetailBo">
  895. SELECT
  896. a.id,
  897. a.name,
  898. a.keyword,
  899. a.category,
  900. a.introduction,
  901. a.maturity,
  902. a.transfer_price AS transferPrice,
  903. a.patent_case AS patentCase,
  904. a.field_a as fieldA,
  905. fg.name AS fieldAS,
  906. fgg.name AS fieldBS,
  907. a.release_date AS releaseDate,
  908. dg.name as province,
  909. dgg.name as city,
  910. a.technical_picture_url AS technicalPictureUrl,
  911. a.transfer_mode as transferMode,
  912. interest.id as interestId,
  913. u.lvl as level,
  914. a.owner_name as ownerName,
  915. a.owner_mobile as ownerMobile,
  916. a.bargaining_mode as bargainingMode,
  917. ui.city as location
  918. FROM
  919. achievement a
  920. LEFT JOIN <![CDATA[ user ]]> u on u.id = a.owner_id
  921. LEFT JOIN user_identity ui on ui.uid = a.owner_id
  922. LEFT JOIN district_glossory dg on dg.id = ui.province
  923. LEFT JOIN district_glossory dgg on dgg.id = ui.city
  924. LEFT JOIN field_glossory fg on fg.id = a.field_a
  925. LEFT JOIN field_glossory fgg on fgg.id = a.field_b
  926. LEFT JOIN achievement_interest interest on interest.achievement_id = a.id and interest.uid = #{uid,jdbcType=VARCHAR}
  927. WHERE
  928. a.id = #{id,jdbcType=VARCHAR}
  929. </select>
  930. <select id="findOrgPortalAchievementDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.AchievementPortalDetailBo">
  931. SELECT
  932. a.id,
  933. a.name,
  934. a.keyword,
  935. a.category,
  936. a.introduction,
  937. a.maturity,
  938. a.transfer_price AS transferPrice,
  939. a.patent_case AS patentCase,
  940. a.field_a as fieldA,
  941. fg.name AS fieldAS,
  942. fgg.name AS fieldBS,
  943. a.release_date AS releaseDate,
  944. dg.name as province,
  945. dgg.name as city,
  946. a.technical_picture_url AS technicalPictureUrl,
  947. a.transfer_mode as transferMode,
  948. interest.id as interestId,
  949. u.lvl as level,
  950. a.owner_name as ownerName,
  951. a.bargaining_mode as bargainingMode
  952. FROM
  953. achievement a
  954. LEFT JOIN <![CDATA[ user ]]> u on u.id = a.owner_id
  955. LEFT JOIN organization_identity oi on oi.uid = a.owner_id
  956. LEFT JOIN district_glossory dg on dg.id = oi.licence_province
  957. LEFT JOIN district_glossory dgg on dgg.id = oi.licence_city
  958. LEFT JOIN field_glossory fg on fg.id = a.field_a
  959. LEFT JOIN field_glossory fgg on fgg.id = a.field_b
  960. LEFT JOIN achievement_interest interest on interest.achievement_id = a.id and interest.uid = #{uid,jdbcType=VARCHAR}
  961. WHERE
  962. a.id = #{id,jdbcType=VARCHAR}
  963. </select>
  964. <select id="listAchievement" resultType="com.goafanti.achievement.bo.AchievementListBo">
  965. select
  966. a.id, a.name, a.keyword,a.introduction,a.category,
  967. a.serial_number as serialNumber,
  968. a.data_category as dataCategory,
  969. a.owner_type as ownerType,
  970. a.owner_name as ownerName,
  971. a.field_a as fieldA,
  972. a.transfer_price as transferPrice,
  973. a.transfer_mode as transfermode,
  974. a.maturity,
  975. a.technical_picture_url as technicalpictureurl
  976. from achievement a
  977. where
  978. a.deleted_sign = 0
  979. and a.category = 0
  980. and a.release_status = 1
  981. and a.audit_status = 3
  982. order by a.release_date desc limit 0,12
  983. </select>
  984. <select id="countInterest" resultType="Integer">
  985. select count(0)
  986. from achievement_interest
  987. where achievement_id=#{achievementId,jdbcType=VARCHAR}
  988. </select>
  989. <select id="achievementInterest" resultType="com.goafanti.achievement.bo.AchievementInterestBo">
  990. select
  991. a.id,a.name,a.create_time as createTime
  992. from achievement_interest ai
  993. LEFT join achievement a on ai.achievement_id=a.id
  994. where uid=#{uid,jdbcType=VARCHAR}
  995. </select>
  996. <select id="findMyAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
  997. select
  998. a.id, a.boutique,a.name,a.category, a.audit_status as auditStatus,ifnull(t.x,0) as buyIntention,
  999. a.release_date as releaseDate,a.create_time as createTime,ifnull(i.y,0) as countInterest
  1000. from achievement a
  1001. left join (select count(0) as x, tl.commodity_id from t_order tr
  1002. left join t_order_detail tl on tr.order_no=tl.order_no
  1003. where tr.order_status != 4
  1004. group by tl.commodity_id ) t on a.id=t.commodity_id
  1005. left join (select count(0) as y,achievement_id from achievement_interest
  1006. group by achievement_id ) i on a.id=i.achievement_id
  1007. where a.deleted_sign = 0
  1008. <if test="ownerId != null">
  1009. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1010. </if>
  1011. order by a.create_time desc
  1012. <if test="page_sql!=null">
  1013. ${page_sql}
  1014. </if>
  1015. </select>
  1016. <select id="findMyAchievementCount" parameterType="String" resultType="java.lang.Integer">
  1017. select
  1018. count(1)
  1019. from achievement a
  1020. where a.deleted_sign = 0
  1021. <if test="ownerId != null">
  1022. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1023. </if>
  1024. </select>
  1025. <select id="getAppHomeAchievement" resultType="com.goafanti.app.bo.HomeAchievemend">
  1026. select ap.achievement_id as id ,a.name as name ,a.technical_picture_url as img,
  1027. ap.if_top,ap.top_number,ap.show_number
  1028. from achievement_publish ap
  1029. left join achievement a on ap.achievement_id=a.id
  1030. where ap.publish_client='1'
  1031. and ap.publish_page='W03'
  1032. order by ap.if_top,ap.top_number,ap.show_number asc
  1033. limit 0,4
  1034. </select>
  1035. <select id="getAppHomeRecommended" resultType="com.goafanti.achievement.bo.AchievementRecommended">
  1036. select ap.achievement_id as id,a.name,a.introduction,a.technical_picture_url as technicalpictureUrl,
  1037. a.field_a,a.field_b,f1.name as fieldA,f2.name as fieldB,a.boutique
  1038. from achievement_publish ap
  1039. left join achievement a on ap.achievement_id = a.id
  1040. left join field_glossory f1 on a.field_a=f1.id
  1041. left join field_glossory f2 on a.field_b=f2.id
  1042. where
  1043. ap.publish_client = '1'
  1044. and ap.publish_page = 'W01'
  1045. order by
  1046. ap.if_top,
  1047. ap.top_number,
  1048. ap.show_number asc limit 0,
  1049. 6
  1050. </select>
  1051. <select id="getRecentAchievements" resultType="com.goafanti.portal.bo.AchievementObject">
  1052. select
  1053. d.name,
  1054. d.id ,
  1055. data_category as dataCategory,
  1056. release_date as releaseDate,
  1057. category,
  1058. d.audit_status ,
  1059. fg.name as industryCategory1,
  1060. fgg.name as industryCategory2,
  1061. d.technical_picture_url as technicalPictureUrl
  1062. from
  1063. achievement d
  1064. left join aft.field_glossory fg on
  1065. fg.id = d.field_a
  1066. left join aft.field_glossory fgg on
  1067. fgg.id = d.field_b
  1068. left join branch_information branchInfo on
  1069. instr( branchInfo.domain_name, #{1} )>0
  1070. left join achievement_publish dp on
  1071. dp.achievement_id = d.id
  1072. and dp.publish_platform = branchInfo.id
  1073. where
  1074. audit_status = 2
  1075. and dp.achievement_id = d.id
  1076. and dp.publish_platform = branchInfo.id
  1077. and instr( dp.publish_page, #{2} )>0
  1078. and info_sources = 1
  1079. order by
  1080. release_date desc limit #{0}
  1081. </select>
  1082. <select id="getHotAchievements" resultType="com.goafanti.portal.bo.AchievementObject">
  1083. select
  1084. a.name as name ,
  1085. a.id as id,
  1086. a.technical_picture_url as technicalPictureUrl,
  1087. b.ct as interestCount,
  1088. a.category,
  1089. a.data_category as dataCategory
  1090. from achievement a
  1091. left join branch_information branchInfo
  1092. on INSTR(branchInfo.domain_name,#{1})>0
  1093. left join achievement_publish ap
  1094. on ap.achievement_id=a.id
  1095. left join
  1096. (select
  1097. count(0) as ct,
  1098. achievement_id as interest_aid
  1099. from achievement_interest
  1100. group by
  1101. achievement_id
  1102. ) b
  1103. on b.interest_aid=a.id
  1104. where a.audit_status=2
  1105. and ap.achievement_id=a.id
  1106. and branchInfo.id = ap.publish_platform
  1107. and instr(ap.publish_page,#{2})>0
  1108. and is_hot=1
  1109. and info_sources=1
  1110. order by ct desc limit #{0}
  1111. </select>
  1112. <select id="getPatentList" resultType="com.goafanti.portal.bo.AchievementObject">
  1113. select
  1114. a.id,
  1115. a.name,
  1116. a.technical_picture_url as technicalPictureUrl,
  1117. a.category,
  1118. data_category as dataCategory,
  1119. release_date as releaseDate
  1120. from
  1121. achievement a
  1122. left join branch_information bi on instr(bi.domain_name,#{1})>0
  1123. left join achievement_publish ap on ap.achievement_id=a.id
  1124. where audit_status=2
  1125. and bi.id =ap.publish_platform
  1126. and category=0
  1127. and instr(ap.publish_page,#{2})>0
  1128. and info_sources=1
  1129. order by release_date desc limit #{0}
  1130. </select>
  1131. <select id="getPracticalTechnologys" resultType="com.goafanti.portal.bo.AchievementObject">
  1132. select
  1133. a.id,
  1134. a.name,
  1135. a.technical_picture_url as technicalPictureUrl,
  1136. a.category,
  1137. release_date as releaseDate,
  1138. a.data_category as dataCategory,
  1139. transfer_mode as transferMode,
  1140. fg.name as fieldAS,
  1141. fgg.name as fieldBS
  1142. from
  1143. achievement a
  1144. left join branch_information bi on instr(bi.domain_name,#{1})>0
  1145. left join achievement_publish ap on ap.achievement_id=a.id
  1146. left join aft.field_glossory fg on
  1147. fg.id = a.field_a
  1148. left join aft.field_glossory fgg on
  1149. fgg.id = a.field_b
  1150. where audit_status=2
  1151. and bi.id =ap.publish_platform
  1152. and data_category=1
  1153. and instr(ap.publish_page,#{2})>0
  1154. and info_sources=1
  1155. order by release_date desc limit #{0}
  1156. </select>
  1157. <select id="getIntellectualProperty" resultType="com.goafanti.common.bo.PolicyEntity" >
  1158. select p.id,p.title,p.title_img as titleImg,p.summary,dg1.name as provinceS,dg2.name as cityS,edit_time as editTime from policy p
  1159. left join district_glossory dg1 on dg1.id=p.province
  1160. left join district_glossory dg2 on dg2.id=p.city
  1161. where audit_status = 2
  1162. order by edit_time
  1163. limit #{0}
  1164. </select>
  1165. <select id="getAchievementDetail" resultType="com.goafanti.portal.bo.AchievementObject" >
  1166. select
  1167. a.name as name,
  1168. a.transfer_mode as transferMode,
  1169. a.technical_picture_url as technicalPictureUrl,
  1170. a.maturity,
  1171. a.category,
  1172. a.owner_postal_address as city,
  1173. fg.name as fieldAS,
  1174. fgg.name as fieldBS,
  1175. release_date as releaseDate,
  1176. introduction
  1177. from
  1178. achievement a
  1179. left join field_glossory fg on
  1180. fg.id = a.field_a
  1181. left join field_glossory fgg on
  1182. fgg.id = a.field_b
  1183. where
  1184. a.id = #{0}
  1185. and a.data_category=#{1}
  1186. </select>
  1187. <select id="getBoutiquePatent" resultType="com.goafanti.portal.bo.AchievementObject">
  1188. select
  1189. a.technical_picture_url as technicalPictureUrl,
  1190. name,
  1191. id,
  1192. data_category as dataCategory
  1193. from
  1194. achievement a
  1195. where
  1196. a.info_sources = 1
  1197. and audit_status=2
  1198. and a.boutique = 1
  1199. limit #{0}
  1200. </select>
  1201. <select id="guessYouLike" resultType="com.goafanti.portal.bo.AchievementObject">
  1202. select
  1203. a.id,
  1204. a.data_category as dataCategory,
  1205. a.name as name,
  1206. a.transfer_mode as transferMode,
  1207. a.technical_picture_url as technicalPictureUrl,
  1208. a.maturity,
  1209. a.category,
  1210. fg.name as fieldAS,
  1211. fgg.name as fieldBS,
  1212. release_date as releaseDate,
  1213. owner_type as ownerType,
  1214. introduction
  1215. from
  1216. achievement a
  1217. left join field_glossory fg on
  1218. fg.id = a.field_a
  1219. left join field_glossory fgg on
  1220. fgg.id = a.field_b
  1221. where
  1222. audit_status=2
  1223. and info_sources=1
  1224. order by release_date limit #{0}
  1225. </select>
  1226. <select id="listMyAchievementByPage" resultType="com.goafanti.portal.bo.AchievementObject">
  1227. select
  1228. a.id, a.serial_number as serialNumber, a.data_category as dataCategory,
  1229. a.name, a.release_date as releaseDate, a.audit_status as auditStatus
  1230. from achievement a
  1231. where deleted_sign = 0
  1232. <if test="ownerId != null">
  1233. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1234. </if>
  1235. <if test="auditStatus != null">
  1236. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  1237. </if>
  1238. <if test="name != null">
  1239. and a.name like "%"#{name,jdbcType=VARCHAR}"%"
  1240. </if>
  1241. <if test="dataCategory != null and dataCategory != ''">
  1242. and a.data_category = #{dataCategory,jdbcType=INTEGER}
  1243. </if>
  1244. <if test="rStart != null">
  1245. and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  1246. </if>
  1247. <if test="rEnd != null">
  1248. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  1249. </if>
  1250. order by serial_number desc
  1251. <if test="page_sql!=null">
  1252. ${page_sql}
  1253. </if>
  1254. </select>
  1255. <select id="listMyAchievementCount" resultType="java.lang.Integer">
  1256. select
  1257. count(0)
  1258. from achievement a
  1259. where deleted_sign = 0
  1260. <if test="ownerId != null">
  1261. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1262. </if>
  1263. <if test="auditStatus != null">
  1264. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  1265. </if>
  1266. <if test="name != null">
  1267. and a.name like "%"#{name,jdbcType=VARCHAR}"%"
  1268. </if>
  1269. <if test="dataCategory != null and dataCategory != ''">
  1270. and a.data_category = #{dataCategory,jdbcType=INTEGER}
  1271. </if>
  1272. <if test="rStart != null">
  1273. and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  1274. </if>
  1275. <if test="rEnd != null">
  1276. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  1277. </if>
  1278. </select>
  1279. <select id="queryAchievementDetailByid" resultType="com.goafanti.portal.bo.AchievementObject" >
  1280. select
  1281. a.name as name,
  1282. a.transfer_mode as transferMode,
  1283. a.technical_picture_url as technicalPictureUrl,
  1284. a.maturity,
  1285. a.category,
  1286. a.owner_postal_address as city,
  1287. fg.name as fieldAS,
  1288. fgg.name as fieldBS,
  1289. a.release_date as releaseDate,
  1290. a.introduction,
  1291. a.patent_case as patentCase,
  1292. a.parameter,
  1293. a.team_des as teamDes,
  1294. a.field_a as fieldA,
  1295. b.field_b as fieldB,
  1296. a.innovation,
  1297. a.transfer_mode as transferMode,
  1298. a.bargaining_mode as bargainingMode,
  1299. a.boutique,
  1300. a.is_hot as isHot,
  1301. a.audit_status as auditStatus
  1302. from
  1303. achievement a
  1304. left join field_glossory fg on
  1305. fg.id = a.field_a
  1306. left join field_glossory fgg on
  1307. fgg.id = a.field_b
  1308. where
  1309. a.id = #{0}
  1310. </select>
  1311. </mapper>