AchievementMapper.xml 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312
  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)
  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})
  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. </set>
  551. where id = #{id,jdbcType=VARCHAR}
  552. </update>
  553. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.Achievement">
  554. update achievement
  555. set serial_number = #{serialNumber,jdbcType=INTEGER},
  556. data_category = #{dataCategory,jdbcType=INTEGER},
  557. name = #{name,jdbcType=VARCHAR},
  558. keyword = #{keyword,jdbcType=VARCHAR},
  559. category = #{category,jdbcType=INTEGER},
  560. summary = #{summary,jdbcType=VARCHAR},
  561. introduction = #{introduction,jdbcType=LONGVARCHAR},
  562. technical_picture_url = #{technicalPictureUrl,jdbcType=VARCHAR},
  563. field_a = #{fieldA,jdbcType=INTEGER},
  564. field_b = #{fieldB,jdbcType=INTEGER},
  565. field_c = #{fieldC,jdbcType=INTEGER},
  566. maturity = #{maturity,jdbcType=INTEGER},
  567. maturity_picture_url = #{maturityPictureUrl,jdbcType=LONGVARCHAR},
  568. maturity_text_file_url = #{maturityTextFileUrl,jdbcType=VARCHAR},
  569. maturity_video_url = #{maturityVideoUrl,jdbcType=VARCHAR},
  570. innovation = #{innovation,jdbcType=INTEGER},
  571. owner_id = #{ownerId,jdbcType=VARCHAR},
  572. owner_name = #{ownerName,jdbcType=VARCHAR},
  573. owner_type = #{ownerType,jdbcType=INTEGER},
  574. owner_id_number = #{ownerIdNumber,jdbcType=VARCHAR},
  575. owner_mobile = #{ownerMobile,jdbcType=VARCHAR},
  576. owner_email = #{ownerEmail,jdbcType=VARCHAR},
  577. owner_postal_address = #{ownerPostalAddress,jdbcType=VARCHAR},
  578. cooperation_mode = #{cooperationMode,jdbcType=INTEGER},
  579. transfer_mode = #{transferMode,jdbcType=INTEGER},
  580. bargaining_mode = #{bargainingMode,jdbcType=INTEGER},
  581. transfer_price = #{transferPrice,jdbcType=DECIMAL},
  582. technical_scene = #{technicalScene,jdbcType=VARCHAR},
  583. breakthrough = #{breakthrough,jdbcType=VARCHAR},
  584. patent_case = #{patentCase,jdbcType=VARCHAR},
  585. awards = #{awards,jdbcType=VARCHAR},
  586. team_des = #{teamDes,jdbcType=VARCHAR},
  587. parameter = #{parameter,jdbcType=VARCHAR},
  588. tech_plan_url = #{techPlanUrl,jdbcType=VARCHAR},
  589. business_plan_url = #{businessPlanUrl,jdbcType=VARCHAR},
  590. org_id = #{orgId,jdbcType=VARCHAR},
  591. org_name = #{orgName,jdbcType=VARCHAR},
  592. org_address = #{orgAddress,jdbcType=VARCHAR},
  593. org_email = #{orgEmail,jdbcType=VARCHAR},
  594. org_contacts = #{orgContacts,jdbcType=VARCHAR},
  595. org_contacts_mobile = #{orgContactsMobile,jdbcType=VARCHAR},
  596. contacts = #{contacts,jdbcType=INTEGER},
  597. manager_id = #{managerId,jdbcType=VARCHAR},
  598. salesman_id = #{salesmanId,jdbcType=VARCHAR},
  599. status = #{status,jdbcType=INTEGER},
  600. create_time = #{createTime,jdbcType=TIMESTAMP},
  601. release_status = #{releaseStatus,jdbcType=INTEGER},
  602. release_date = #{releaseDate,jdbcType=TIMESTAMP},
  603. deleted_sign = #{deletedSign,jdbcType=INTEGER},
  604. audit_status = #{auditStatus,jdbcType=INTEGER},
  605. tech_broker_id = #{techBrokerId,jdbcType=VARCHAR},
  606. country_name_zh = #{countryNameZh,jdbcType=VARCHAR},
  607. international_flag = #{internationalFlag,jdbcType=INTEGER},
  608. jmrh_flag = #{jmrhFlag,jdbcType=INTEGER},
  609. boutique = #{boutique,jdbcType=INTEGER}
  610. where id = #{id,jdbcType=VARCHAR}
  611. </update>
  612. <update id="batchDeleteByPrimaryKey" parameterType="java.util.List">
  613. update achievement set deleted_sign = 1
  614. where id in
  615. <foreach item="item" collection="list" open="(" separator="," close=")">
  616. #{item}
  617. </foreach>
  618. </update>
  619. <select id="findAppAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
  620. select
  621. a.id, a.serial_number as serialNumber, a.data_category as dataCategory, a.boutique,
  622. a.name, a.keyword, a.category, a.introduction,owner_postal_address as ownerPostalAddress,
  623. 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,
  624. 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
  625. from achievement a
  626. left join (
  627. select count(0) as countInterest,achievement_id from achievement_interest group by achievement_id
  628. )b on a.id = b.achievement_id
  629. left join field_glossory f on a.field_a=f.id
  630. left join field_glossory f2 on a.field_b=f2.id
  631. where deleted_sign = 0
  632. and audit_status = 3
  633. <if test="ownerId != null">
  634. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  635. </if>
  636. <if test="serialNumber != null">
  637. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  638. </if>
  639. <if test="auditStatus != null">
  640. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  641. </if>
  642. <if test="name != null">
  643. and a.name = #{name,jdbcType=VARCHAR}
  644. </if>
  645. <if test="keyword != null">
  646. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  647. </if>
  648. <if test="dataCategory != null and dataCategory != ''">
  649. and a.data_category = #{dataCategory,jdbcType=INTEGER}
  650. </if>
  651. <if test="category != null">
  652. and a.category = #{category,jdbcType=INTEGER}
  653. </if>
  654. <if test="ownerType != null">
  655. and a.owner_type = #{ownerType,jdbcType=INTEGER}
  656. </if>
  657. <if test="fieldA != null">
  658. and a.field_a = #{fieldA,jdbcType=VARCHAR}
  659. </if>
  660. <if test="status != null">
  661. and a.status = #{status,jdbcType=INTEGER}
  662. </if>
  663. <if test="rStart != null">
  664. and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  665. </if>
  666. <if test="rEnd != null">
  667. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  668. </if>
  669. <if test="releaseStatus != null">
  670. and a.release_status = #{releaseStatus,jdbcType=INTEGER}
  671. </if>
  672. order by a.boutique desc
  673. <if test="page_sql!=null">
  674. ${page_sql}
  675. </if>
  676. </select>
  677. <select id="findAppAchievementCount" parameterType="String" resultType="java.lang.Integer">
  678. select
  679. count(1)
  680. from achievement a
  681. left join field_glossory f on a.field_a=f.id
  682. left join field_glossory f2 on a.field_b=f2.id
  683. where deleted_sign = 0
  684. and audit_status = 3
  685. <if test="ownerId != null">
  686. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  687. </if>
  688. <if test="serialNumber != null">
  689. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  690. </if>
  691. <if test="auditStatus != null">
  692. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  693. </if>
  694. <if test="name != null">
  695. and a.name = #{name,jdbcType=VARCHAR}
  696. </if>
  697. <if test="keyword != null">
  698. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  699. </if>
  700. <if test="dataCategory != null and dataCategory != ''">
  701. and a.data_category = #{dataCategory,jdbcType=INTEGER}
  702. </if>
  703. <if test="category != null">
  704. and a.category = #{category,jdbcType=INTEGER}
  705. </if>
  706. <if test="ownerType != null">
  707. and a.owner_type = #{ownerType,jdbcType=INTEGER}
  708. </if>
  709. <if test="fieldA != null">
  710. and a.field_a = #{fieldA,jdbcType=VARCHAR}
  711. </if>
  712. <if test="status != null">
  713. and a.status = #{status,jdbcType=INTEGER}
  714. </if>
  715. <if test="rStart != null">
  716. and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  717. </if>
  718. <if test="rEnd != null">
  719. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  720. </if>
  721. <if test="releaseStatus != null">
  722. and a.release_status = #{releaseStatus,jdbcType=INTEGER}
  723. </if>
  724. </select>
  725. <select id="selectUserOwnerDetail" parameterType="java.lang.String" resultType="com.goafanti.achievement.bo.AchievementUserOwnerDetailBo">
  726. select
  727. a.id, a.serial_number as serialNumber, a.data_category as dataCategory,
  728. a.name, a.keyword, a.category,
  729. a.summary, a.introduction, a.technical_picture_url as technicalPictureUrl,
  730. a.field_a as fieldA, a.field_b as fieldB, a.field_c as fieldC, f.name as field1, f2.name as field2,
  731. a.maturity, a.maturity_picture_url as maturityPictureUrl, a.maturity_text_file_url as maturityTextFileUrl,
  732. a.maturity_video_url as maturityVideoUrl, a.innovation, a.owner_id as ownerId,
  733. a.owner_name as ownerName, a.owner_type as ownerType, a.owner_id_number as ownerIdNumber,
  734. a.owner_mobile as ownerMobile, a.owner_email as ownerEmail, a.owner_postal_address as ownerPostalAddress,
  735. a.cooperation_mode as cooperationMode, a.transfer_mode as transferMode, a.bargaining_mode as bargainingMode,
  736. a.transfer_price as transferPrice, a.technical_scene as technicalScene, a.breakthrough,
  737. a.patent_case as patentCase, a.awards, a.team_des as teamDes,
  738. a.parameter, a.tech_plan_url as techPlanUrl, a.business_plan_url as businessPlanUrl,
  739. a.contacts, a.manager_id as managerId, a.salesman_id as salesmanId,
  740. a.create_time as createTime, a.release_status as releaseStatus,
  741. a.release_date as releaseDate, a.audit_status as auditStatus, a.tech_broker_id as techBrokerId,
  742. ui.username as iOwnerName, ui.province, ui.city, ui.area, u.email as iOwnerEmail,
  743. ui.id_number as iOwnerIdNumber, u.mobile as iOwnerMobile,j.easemob_name as easemobName,a.remark,
  744. 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,
  745. a.international_flag as internationalFlag
  746. from achievement a
  747. left join user_identity ui on a.owner_id = ui.uid
  748. left join field_glossory f on a.field_a=f.id
  749. left join field_glossory f2 on a.field_b=f2.id
  750. left join (select count(0) as x,tl.commodity_id from t_order tr
  751. left join t_order_detail tl on tl.order_no=tr.order_no
  752. where order_status != 4
  753. group by tl.commodity_id ) t on a.id=t.commodity_id
  754. left join (select count(0) as x,tl.commodity_id from t_order tr
  755. left join t_order_detail tl on tl.order_no=tr.order_no
  756. where tr.order_status != 4 and tr.order_status != 0
  757. group by tl.commodity_id) t2 on a.id=t2.commodity_id
  758. left join jpush_easemob_account j on a.owner_id=j.uid
  759. left join user u on u.id = a.owner_id
  760. left join marketing_management mm on a.id = mm.product_id
  761. where a.id =#{id,jdbcType=VARCHAR}
  762. </select>
  763. <select id="selectOrgOwnerDetail" parameterType="java.lang.String" resultType="com.goafanti.achievement.bo.AchievementOrgOwnerDetailBo">
  764. select
  765. a.id, a.serial_number as serialNumber, a.data_category as dataCategory,
  766. a.name, a.keyword, a.category,
  767. a.summary, a.introduction, a.technical_picture_url as technicalPictureUrl,
  768. a.field_a as fieldA, a.field_b as fieldB, a.field_c as fieldC,
  769. a.maturity, a.maturity_picture_url as maturityPictureUrl, a.maturity_text_file_url as maturityTextFileUrl,
  770. a.maturity_video_url as maturityVideoUrl, a.innovation, a.owner_id as ownerId,
  771. a.owner_name as ownerName, a.owner_type as ownerType, a.owner_id_number as ownerIdNumber,
  772. a.owner_mobile as ownerMobile, a.owner_email as ownerEmail, a.owner_postal_address as ownerPostalAddress,
  773. a.cooperation_mode as cooperationMode, a.transfer_mode as transferMode, a.bargaining_mode as bargainingMode,
  774. a.transfer_price as transferPrice, a.technical_scene as technicalScene, a.breakthrough,
  775. a.patent_case as patentCase, a.awards, a.team_des as teamDes,
  776. a.parameter, a.tech_plan_url as techPlanUrl, a.business_plan_url as businessPlanUrl,
  777. a.contacts, a.manager_id as managerId, a.salesman_id as salesmanId, a.international_flag as internationalFlag,
  778. a.create_time as createTime, a.release_status as releaseStatus,
  779. a.release_date as releaseDate, a.audit_status as auditStatus, a.tech_broker_id as techBrokerId,
  780. oi.unit_name as iOwnerName, oi.postal_address as iOwnerPostalAddress, u.email as iOwnerEmail,
  781. 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
  782. from achievement a
  783. left join organization_identity oi on a.owner_id = oi.uid
  784. left join user u on u.id = a.owner_id
  785. left join marketing_management mm on a.id = mm.product_id
  786. where a.id = #{id,jdbcType=VARCHAR}
  787. </select>
  788. <insert id="insertBatch" parameterType="com.goafanti.common.model.Achievement">
  789. insert into achievement
  790. (id, deleted_sign, audit_status,
  791. create_time, release_status, data_category,
  792. name, keyword, category,
  793. owner_name, owner_type, owner_id_number,
  794. owner_mobile, owner_email, owner_postal_address,
  795. cooperation_mode, introduction, tech_broker_id,international_flag
  796. )
  797. values
  798. <foreach item="item" index="index" collection="list" separator=",">
  799. (
  800. #{item.id,jdbcType=VARCHAR}, #{item.deletedSign,jdbcType=INTEGER}, #{item.auditStatus,jdbcType=INTEGER},
  801. #{item.createTime,jdbcType=TIMESTAMP}, #{item.releaseStatus,jdbcType=INTEGER}, #{item.dataCategory,jdbcType=INTEGER},
  802. #{item.name,jdbcType=VARCHAR}, #{item.keyword,jdbcType=VARCHAR}, #{item.category,jdbcType=INTEGER},
  803. #{item.ownerName,jdbcType=VARCHAR}, #{item.ownerType,jdbcType=VARCHAR}, #{item.ownerIdNumber,jdbcType=VARCHAR},
  804. #{item.ownerMobile,jdbcType=VARCHAR}, #{item.ownerEmail,jdbcType=VARCHAR}, #{item.ownerPostalAddress,jdbcType=VARCHAR},
  805. #{item.cooperationMode,jdbcType=INTEGER}, #{item.introduction,jdbcType=LONGVARCHAR},#{item.techBrokerId,jdbcType=VARCHAR},
  806. #{item.internationalFlag,jdbcType=INTEGER}
  807. )
  808. </foreach>
  809. </insert>
  810. <select id="selectAchievementDetail" resultType="com.goafanti.portal.bo.AchievementDetailBo">
  811. select
  812. a.id,
  813. a.owner_name as ownerName,
  814. a.serial_number as serialNumber,
  815. a.keyword,
  816. a.name,
  817. a.data_category as dataCategory,
  818. a.category,
  819. ui.username,
  820. oi.unit_name as unitName,
  821. a.release_date as releaseDate,
  822. a.owner_type as ownerType,
  823. a.field_a as fieldA,
  824. a.field_b as fieldB,
  825. a.transfer_price as transferPrice,
  826. a.maturity,
  827. a.transfer_mode as transferMode,
  828. a.bargaining_mode as bargainingMode,
  829. a.summary,
  830. a.introduction,
  831. a.technical_picture_url as technicalPictureUrl,
  832. a.maturity_picture_url as maturityPictureUrl,
  833. a.maturity_text_file_url as maturityTextFileUrl,
  834. a.maturity_video_url as maturityVideoUrl,
  835. a.innovation,
  836. a.cooperation_mode as cooperationMode,
  837. a.bargaining_mode as bargainingMode,
  838. a.technical_scene as technicalScene,
  839. a.breakthrough,
  840. a.patent_case as patentCase,
  841. a.awards,
  842. a.team_des as teamDes,
  843. a.parameter,
  844. a.tech_plan_url as techPlanUrl,
  845. a.business_plan_url as businessPlanUrl,
  846. ai.id as achievementInterestId,
  847. ao.id as achievementOrderId,
  848. ao.status as orderStatus
  849. from achievement a
  850. left join user_identity ui on ui.uid = a.owner_id
  851. left join organization_identity oi on oi.uid = a.owner_id
  852. left join achievement_interest ai on ai.achievement_id = a.id and ai.uid = #{0}
  853. left join achievement_order ao on ao.achievement_id = a.id and ao.uid = #{0} and ao.status <![CDATA[ <> ]]> 6
  854. where a.id = #{1}
  855. </select>
  856. <select id="findPartnerAchievementListByPage" parameterType="java.lang.String" resultType="com.goafanti.achievement.bo.AchievementPartnerListBo">
  857. SELECT
  858. id,
  859. serial_number AS serialNumber,
  860. data_category AS dataCategory,
  861. NAME,
  862. keyword,
  863. category,
  864. owner_type as ownerType,
  865. release_date AS releaseDate,
  866. field_a as fieldA,
  867. maturity,
  868. introduction,
  869. technical_picture_url as technicalPictureUrl,
  870. bargaining_mode as bargainingMode,
  871. transfer_price as transferPrice
  872. FROM
  873. achievement
  874. WHERE
  875. audit_status = 3
  876. AND release_status = 1
  877. AND deleted_sign = 0
  878. AND owner_id = #{ownerId,jdbcType=VARCHAR}
  879. </select>
  880. <select id="findPartnerAchievementCount" parameterType="java.lang.String" resultType="java.lang.Integer">
  881. SELECT
  882. count(1)
  883. FROM
  884. achievement
  885. WHERE
  886. audit_status = 3
  887. AND release_status = 1
  888. AND deleted_sign = 0
  889. AND owner_id = #{ownerId,jdbcType=VARCHAR}
  890. </select>
  891. <select id="findUserPortalAchievementDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.AchievementPortalDetailBo">
  892. SELECT
  893. a.id,
  894. a.name,
  895. a.keyword,
  896. a.category,
  897. a.introduction,
  898. a.maturity,
  899. a.transfer_price AS transferPrice,
  900. a.patent_case AS patentCase,
  901. a.field_a as fieldA,
  902. fg.name AS fieldAS,
  903. fgg.name AS fieldBS,
  904. a.release_date AS releaseDate,
  905. dg.name as province,
  906. dgg.name as city,
  907. a.technical_picture_url AS technicalPictureUrl,
  908. a.transfer_mode as transferMode,
  909. interest.id as interestId,
  910. u.lvl as level,
  911. a.owner_name as ownerName,
  912. a.owner_mobile as ownerMobile,
  913. a.bargaining_mode as bargainingMode,
  914. ui.city as location
  915. FROM
  916. achievement a
  917. LEFT JOIN <![CDATA[ user ]]> u on u.id = a.owner_id
  918. LEFT JOIN user_identity ui on ui.uid = a.owner_id
  919. LEFT JOIN district_glossory dg on dg.id = ui.province
  920. LEFT JOIN district_glossory dgg on dgg.id = ui.city
  921. LEFT JOIN field_glossory fg on fg.id = a.field_a
  922. LEFT JOIN field_glossory fgg on fgg.id = a.field_b
  923. LEFT JOIN achievement_interest interest on interest.achievement_id = a.id and interest.uid = #{uid,jdbcType=VARCHAR}
  924. WHERE
  925. a.id = #{id,jdbcType=VARCHAR}
  926. </select>
  927. <select id="findOrgPortalAchievementDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.AchievementPortalDetailBo">
  928. SELECT
  929. a.id,
  930. a.name,
  931. a.keyword,
  932. a.category,
  933. a.introduction,
  934. a.maturity,
  935. a.transfer_price AS transferPrice,
  936. a.patent_case AS patentCase,
  937. a.field_a as fieldA,
  938. fg.name AS fieldAS,
  939. fgg.name AS fieldBS,
  940. a.release_date AS releaseDate,
  941. dg.name as province,
  942. dgg.name as city,
  943. a.technical_picture_url AS technicalPictureUrl,
  944. a.transfer_mode as transferMode,
  945. interest.id as interestId,
  946. u.lvl as level,
  947. a.owner_name as ownerName,
  948. a.bargaining_mode as bargainingMode
  949. FROM
  950. achievement a
  951. LEFT JOIN <![CDATA[ user ]]> u on u.id = a.owner_id
  952. LEFT JOIN organization_identity oi on oi.uid = a.owner_id
  953. LEFT JOIN district_glossory dg on dg.id = oi.licence_province
  954. LEFT JOIN district_glossory dgg on dgg.id = oi.licence_city
  955. LEFT JOIN field_glossory fg on fg.id = a.field_a
  956. LEFT JOIN field_glossory fgg on fgg.id = a.field_b
  957. LEFT JOIN achievement_interest interest on interest.achievement_id = a.id and interest.uid = #{uid,jdbcType=VARCHAR}
  958. WHERE
  959. a.id = #{id,jdbcType=VARCHAR}
  960. </select>
  961. <select id="listAchievement" resultType="com.goafanti.achievement.bo.AchievementListBo">
  962. select
  963. a.id, a.name, a.keyword,a.introduction,a.category,
  964. a.serial_number as serialNumber,
  965. a.data_category as dataCategory,
  966. a.owner_type as ownerType,
  967. a.owner_name as ownerName,
  968. a.field_a as fieldA,
  969. a.transfer_price as transferPrice,
  970. a.transfer_mode as transfermode,
  971. a.maturity,
  972. a.technical_picture_url as technicalpictureurl
  973. from achievement a
  974. where
  975. a.deleted_sign = 0
  976. and a.category = 0
  977. and a.release_status = 1
  978. and a.audit_status = 3
  979. order by a.release_date desc limit 0,12
  980. </select>
  981. <select id="countInterest" resultType="Integer">
  982. select count(0)
  983. from achievement_interest
  984. where achievement_id=#{achievementId,jdbcType=VARCHAR}
  985. </select>
  986. <select id="achievementInterest" resultType="com.goafanti.achievement.bo.AchievementInterestBo">
  987. select
  988. a.id,a.name,a.create_time as createTime
  989. from achievement_interest ai
  990. LEFT join achievement a on ai.achievement_id=a.id
  991. where uid=#{uid,jdbcType=VARCHAR}
  992. </select>
  993. <select id="findMyAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
  994. select
  995. a.id, a.boutique,a.name,a.category, a.audit_status as auditStatus,ifnull(t.x,0) as buyIntention,
  996. a.release_date as releaseDate,a.create_time as createTime,ifnull(i.y,0) as countInterest
  997. from achievement a
  998. left join (select count(0) as x, tl.commodity_id from t_order tr
  999. left join t_order_detail tl on tr.order_no=tl.order_no
  1000. where tr.order_status != 4
  1001. group by tl.commodity_id ) t on a.id=t.commodity_id
  1002. left join (select count(0) as y,achievement_id from achievement_interest
  1003. group by achievement_id ) i on a.id=i.achievement_id
  1004. where a.deleted_sign = 0
  1005. <if test="ownerId != null">
  1006. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1007. </if>
  1008. order by a.create_time desc
  1009. <if test="page_sql!=null">
  1010. ${page_sql}
  1011. </if>
  1012. </select>
  1013. <select id="findMyAchievementCount" parameterType="String" resultType="java.lang.Integer">
  1014. select
  1015. count(1)
  1016. from achievement a
  1017. where a.deleted_sign = 0
  1018. <if test="ownerId != null">
  1019. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1020. </if>
  1021. </select>
  1022. <select id="getAppHomeAchievement" resultType="com.goafanti.app.bo.HomeAchievemend">
  1023. select ap.achievement_id as id ,a.name as name ,a.technical_picture_url as img,
  1024. ap.if_top,ap.top_number,ap.show_number
  1025. from achievement_publish ap
  1026. left join achievement a on ap.achievement_id=a.id
  1027. where ap.publish_client='1'
  1028. and ap.publish_page='W03'
  1029. order by ap.if_top,ap.top_number,ap.show_number asc
  1030. limit 0,4
  1031. </select>
  1032. <select id="getAppHomeRecommended" resultType="com.goafanti.achievement.bo.AchievementRecommended">
  1033. select ap.achievement_id as id,a.name,a.introduction,a.technical_picture_url as technicalpictureUrl,
  1034. a.field_a,a.field_b,f1.name as fieldA,f2.name as fieldB,a.boutique
  1035. from achievement_publish ap
  1036. left join achievement a on ap.achievement_id = a.id
  1037. left join field_glossory f1 on a.field_a=f1.id
  1038. left join field_glossory f2 on a.field_b=f2.id
  1039. where
  1040. ap.publish_client = '1'
  1041. and ap.publish_page = 'W01'
  1042. order by
  1043. ap.if_top,
  1044. ap.top_number,
  1045. ap.show_number asc limit 0,
  1046. 6
  1047. </select>
  1048. <select id="getRecentAchievements" resultType="com.goafanti.portal.bo.AchievementObject">
  1049. select
  1050. d.name,
  1051. d.id ,
  1052. data_category as dataCategory,
  1053. release_date as releaseDate,
  1054. category,
  1055. d.audit_status ,
  1056. fg.name as industryCategory1,
  1057. fgg.name as industryCategory2,
  1058. d.technical_picture_url as technicalPictureUrl
  1059. from
  1060. achievement d
  1061. left join aft.field_glossory fg on
  1062. fg.id = d.field_a
  1063. left join aft.field_glossory fgg on
  1064. fgg.id = d.field_b
  1065. left join branch_information branchInfo on
  1066. instr( branchInfo.domain_name, #{1} )>0
  1067. left join achievement_publish dp on
  1068. dp.achievement_id = d.id
  1069. and dp.publish_platform = branchInfo.id
  1070. where
  1071. audit_status = 2
  1072. and dp.achievement_id = d.id
  1073. and dp.publish_platform = branchInfo.id
  1074. and instr( dp.publish_page, #{2} )>0
  1075. and info_sources = 1
  1076. order by
  1077. release_date desc limit #{0}
  1078. </select>
  1079. <select id="getHotAchievements" resultType="com.goafanti.portal.bo.AchievementObject">
  1080. select
  1081. a.name as name ,
  1082. a.id as id,
  1083. a.technical_picture_url as technicalPictureUrl,
  1084. b.ct as interestCount,
  1085. a.category,
  1086. a.data_category as dataCategory
  1087. from achievement a
  1088. left join branch_information branchInfo
  1089. on INSTR(branchInfo.domain_name,#{1})>0
  1090. left join achievement_publish ap
  1091. on ap.achievement_id=a.id
  1092. left join
  1093. (select
  1094. count(0) as ct,
  1095. achievement_id as interest_aid
  1096. from achievement_interest
  1097. group by
  1098. achievement_id
  1099. ) b
  1100. on b.interest_aid=a.id
  1101. where a.audit_status=2
  1102. and ap.achievement_id=a.id
  1103. and branchInfo.id = ap.publish_platform
  1104. and instr(ap.publish_page,#{2})>0
  1105. and is_hot=1
  1106. and info_sources=1
  1107. order by ct desc limit #{0}
  1108. </select>
  1109. <select id="getPatentList" resultType="com.goafanti.portal.bo.AchievementObject">
  1110. select
  1111. a.id,
  1112. a.name,
  1113. a.technical_picture_url as technicalPictureUrl,
  1114. a.category,
  1115. data_category as dataCategory,
  1116. release_date as releaseDate
  1117. from
  1118. achievement a
  1119. left join branch_information bi on instr(bi.domain_name,#{1})>0
  1120. left join achievement_publish ap on ap.achievement_id=a.id
  1121. where audit_status=2
  1122. and bi.id =ap.publish_platform
  1123. and category=0
  1124. and instr(ap.publish_page,#{2})>0
  1125. and info_sources=1
  1126. order by release_date desc limit #{0}
  1127. </select>
  1128. <select id="getPracticalTechnologys" resultType="com.goafanti.portal.bo.AchievementObject">
  1129. select
  1130. a.id,
  1131. a.name,
  1132. a.technical_picture_url as technicalPictureUrl,
  1133. a.category,
  1134. release_date as releaseDate,
  1135. a.data_category as dataCategory,
  1136. transfer_mode as transferMode,
  1137. fg.name as fieldAS,
  1138. fgg.name as fieldBS
  1139. from
  1140. achievement a
  1141. left join branch_information bi on instr(bi.domain_name,#{1})>0
  1142. left join achievement_publish ap on ap.achievement_id=a.id
  1143. left join aft.field_glossory fg on
  1144. fg.id = a.field_a
  1145. left join aft.field_glossory fgg on
  1146. fgg.id = a.field_b
  1147. where audit_status=2
  1148. and bi.id =ap.publish_platform
  1149. and data_category=1
  1150. and instr(ap.publish_page,#{2})>0
  1151. and info_sources=1
  1152. order by release_date desc limit #{0}
  1153. </select>
  1154. <select id="getIntellectualProperty" resultType="com.goafanti.common.bo.PolicyEntity" >
  1155. 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
  1156. left join district_glossory dg1 on dg1.id=p.province
  1157. left join district_glossory dg2 on dg2.id=p.city
  1158. where audit_status = 2
  1159. order by edit_time
  1160. limit #{0}
  1161. </select>
  1162. <select id="getAchievementDetail" resultType="com.goafanti.portal.bo.AchievementObject" >
  1163. select
  1164. a.name as name,
  1165. a.transfer_mode as transferMode,
  1166. a.technical_picture_url as technicalPictureUrl,
  1167. a.maturity,
  1168. a.category,
  1169. a.owner_postal_address as city,
  1170. fg.name as fieldAS,
  1171. fgg.name as fieldBS,
  1172. release_date as releaseDate,
  1173. introduction
  1174. from
  1175. achievement a
  1176. left join field_glossory fg on
  1177. fg.id = a.field_a
  1178. left join field_glossory fgg on
  1179. fgg.id = a.field_b
  1180. where
  1181. a.id = #{0}
  1182. and a.data_category=#{1}
  1183. </select>
  1184. <select id="getBoutiquePatent" resultType="com.goafanti.portal.bo.AchievementObject">
  1185. select
  1186. a.technical_picture_url as technicalPictureUrl,
  1187. name,
  1188. id,
  1189. data_category as dataCategory
  1190. from
  1191. achievement a
  1192. where
  1193. a.info_sources = 1
  1194. and audit_status=2
  1195. and a.boutique = 1
  1196. limit #{0}
  1197. </select>
  1198. <select id="guessYouLike" resultType="com.goafanti.portal.bo.AchievementObject">
  1199. select
  1200. a.id,
  1201. a.data_category as dataCategory,
  1202. a.name as name,
  1203. a.transfer_mode as transferMode,
  1204. a.technical_picture_url as technicalPictureUrl,
  1205. a.maturity,
  1206. a.category,
  1207. fg.name as fieldAS,
  1208. fgg.name as fieldBS,
  1209. release_date as releaseDate,
  1210. owner_type as ownerType,
  1211. introduction
  1212. from
  1213. achievement a
  1214. left join field_glossory fg on
  1215. fg.id = a.field_a
  1216. left join field_glossory fgg on
  1217. fgg.id = a.field_b
  1218. where
  1219. audit_status=2
  1220. and info_sources=1
  1221. order by release_date limit #{0}
  1222. </select>
  1223. <select id="listMyAchievementByPage" resultType="com.goafanti.demand.bo.DemandAchievementListBo">
  1224. select
  1225. a.id, a.serial_number as serialNumber, a.data_category as dataCategory,
  1226. a.name, a.release_date as releaseDate, a.audit_status as auditStatus
  1227. from achievement a
  1228. where deleted_sign = 0
  1229. <if test="ownerId != null">
  1230. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1231. </if>
  1232. <if test="auditStatus != null">
  1233. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  1234. </if>
  1235. <if test="name != null">
  1236. and a.name like "%"#{name,jdbcType=VARCHAR}"%"
  1237. </if>
  1238. <if test="dataCategory != null and dataCategory != ''">
  1239. and a.data_category = #{dataCategory,jdbcType=INTEGER}
  1240. </if>
  1241. <if test="rStart != null">
  1242. and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  1243. </if>
  1244. <if test="rEnd != null">
  1245. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  1246. </if>
  1247. order by serial_number desc
  1248. <if test="page_sql!=null">
  1249. ${page_sql}
  1250. </if>
  1251. </select>
  1252. <select id="listMyAchievementCount" resultType="java.lang.Integer">
  1253. select
  1254. count(0)
  1255. from achievement a
  1256. where deleted_sign = 0
  1257. <if test="ownerId != null">
  1258. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1259. </if>
  1260. <if test="auditStatus != null">
  1261. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  1262. </if>
  1263. <if test="name != null">
  1264. and a.name like "%"#{name,jdbcType=VARCHAR}"%"
  1265. </if>
  1266. <if test="dataCategory != null and dataCategory != ''">
  1267. and a.data_category = #{dataCategory,jdbcType=INTEGER}
  1268. </if>
  1269. <if test="rStart != null">
  1270. and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  1271. </if>
  1272. <if test="rEnd != null">
  1273. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  1274. </if>
  1275. </select>
  1276. </mapper>