AchievementMapper.xml 53 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442
  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,info_sources)
  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},#{infoSources,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. <if test="auditInfo != null">
  554. audit_info = #{auditInfo,jdbcType=VARCHAR},
  555. </if>
  556. </set>
  557. where id = #{id,jdbcType=VARCHAR}
  558. </update>
  559. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.Achievement">
  560. update achievement
  561. set serial_number = #{serialNumber,jdbcType=INTEGER},
  562. data_category = #{dataCategory,jdbcType=INTEGER},
  563. name = #{name,jdbcType=VARCHAR},
  564. keyword = #{keyword,jdbcType=VARCHAR},
  565. category = #{category,jdbcType=INTEGER},
  566. summary = #{summary,jdbcType=VARCHAR},
  567. introduction = #{introduction,jdbcType=LONGVARCHAR},
  568. technical_picture_url = #{technicalPictureUrl,jdbcType=VARCHAR},
  569. field_a = #{fieldA,jdbcType=INTEGER},
  570. field_b = #{fieldB,jdbcType=INTEGER},
  571. field_c = #{fieldC,jdbcType=INTEGER},
  572. maturity = #{maturity,jdbcType=INTEGER},
  573. innovation = #{innovation,jdbcType=INTEGER},
  574. owner_id = #{ownerId,jdbcType=VARCHAR},
  575. owner_postal_address = #{ownerPostalAddress,jdbcType=VARCHAR},
  576. transfer_mode = #{transferMode,jdbcType=INTEGER},
  577. bargaining_mode = #{bargainingMode,jdbcType=INTEGER},
  578. transfer_price = #{transferPrice,jdbcType=DECIMAL},
  579. patent_case = #{patentCase,jdbcType=VARCHAR},
  580. team_des = #{teamDes,jdbcType=VARCHAR},
  581. parameter = #{parameter,jdbcType=VARCHAR},
  582. release_status = #{releaseStatus,jdbcType=INTEGER},
  583. release_date = #{releaseDate,jdbcType=TIMESTAMP},
  584. deleted_sign = #{deletedSign,jdbcType=INTEGER},
  585. audit_status = #{auditStatus,jdbcType=INTEGER},
  586. country_name_zh = #{countryNameZh,jdbcType=VARCHAR},
  587. international_flag = #{internationalFlag,jdbcType=INTEGER},
  588. boutique = #{boutique,jdbcType=INTEGER}
  589. where id = #{id,jdbcType=VARCHAR}
  590. </update>
  591. <update id="batchDeleteByPrimaryKey" parameterType="java.util.List">
  592. update achievement set deleted_sign = 1
  593. where id in
  594. <foreach item="item" collection="list" open="(" separator="," close=")">
  595. #{item}
  596. </foreach>
  597. </update>
  598. <select id="findAchievementListWithPid" resultType="com.goafanti.portal.bo.AchievementObject">
  599. select a.name,a.id,release_date as releaseDate,technical_picture_url as technicalPictureUrl,data_category as dataCategory,is_hot as isHot
  600. ,field_a as fieldA,field_b as fieldB,ic.name as fieldAS,icc.name as fieldBS
  601. from achievement a
  602. left join industry_category ic on ic.id=a.field_a
  603. left join industry_category icc on icc.id=a.field_b
  604. where info_sources=1 and audit_status=2
  605. <if test="fieldA!=null">
  606. and a.field_a =#{fieldA,jdbcType=INTEGER}
  607. </if>
  608. <if test="fieldB!=null">
  609. and a.field_b=#{fieldB,jdbcType=INTEGER}
  610. </if>
  611. <if test="name !=null">
  612. and a.name like concat("%",#{name,jdbcType=VARCHAR},"%")
  613. </if>
  614. order by a.release_date
  615. <if test="page_sql !=null">
  616. ${page_sql}
  617. </if>
  618. </select>
  619. <select id="findAchievementCountWithPid" resultType="java.lang.Integer">
  620. select
  621. count(0)
  622. from achievement a
  623. where info_sources=1 and audit_status=2
  624. <if test="fieldA!=null">
  625. and a.field_a =#{fieldA,jdbcType=INTEGER}
  626. </if>
  627. <if test="fieldB!=null">
  628. and a.field_b=#{fieldB,jdbcType=INTEGER}
  629. </if>
  630. <if test="name !=null">
  631. and a.name like concat("%",#{name,jdbcType=VARCHAR},"%")
  632. </if>
  633. </select>
  634. <select id="findAppAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
  635. select
  636. a.id,a.name, a.keyword, a.introduction,a.field_a as fieldA,a.field_b as fieldB,a.data_category as dataCategory,
  637. a.status, a.release_date as releaseDate, a.audit_status as auditStatus,a.maturity,
  638. f.name as field1,f2.name as field2,ifnull(b.countInterest,0) as countInterest,if(isnull(c.achievement_id),0,1) as interested
  639. from achievement a
  640. left join (select count(0) as countInterest,achievement_id from achievement_interest
  641. group by achievement_id)b on a.id = b.achievement_id
  642. left join (select achievement_id from achievement_interest where uid=#{uid,jdbcType=VARCHAR})c
  643. on a.id=c.achievement_id
  644. left join field_glossory f on a.field_a=f.id
  645. left join field_glossory f2 on a.field_b=f2.id
  646. where a.deleted_sign = 0 and a.audit_status = 2 and a.info_sources=1
  647. <if test="ownerId != null">
  648. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  649. </if>
  650. <if test="serialNumber != null">
  651. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  652. </if>
  653. <if test="auditStatus != null">
  654. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  655. </if>
  656. <if test="name != null">
  657. and a.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  658. </if>
  659. <if test="keyword != null">
  660. and a.keyword like CONCAT('%',#{keyword,jdbcType=VARCHAR},'%')
  661. </if>
  662. <if test="dataCategory != null and dataCategory != ''">
  663. and a.data_category = #{dataCategory,jdbcType=INTEGER}
  664. </if>
  665. <if test="category != null">
  666. and a.category = #{category,jdbcType=INTEGER}
  667. </if>
  668. <if test="ownerType != null">
  669. and a.owner_type = #{ownerType,jdbcType=INTEGER}
  670. </if>
  671. <if test="fieldA != null">
  672. and a.field_a = #{fieldA,jdbcType=VARCHAR}
  673. </if>
  674. <if test="status != null">
  675. and a.status = #{status,jdbcType=INTEGER}
  676. </if>
  677. <if test="rStart != null">
  678. and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  679. </if>
  680. <if test="rEnd != null">
  681. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  682. </if>
  683. <if test="releaseStatus != null">
  684. and a.release_status = #{releaseStatus,jdbcType=INTEGER}
  685. </if>
  686. order by a.release_date desc
  687. <if test="page_sql!=null">
  688. ${page_sql}
  689. </if>
  690. </select>
  691. <select id="findAppAchievementCount" parameterType="String" resultType="java.lang.Integer">
  692. select
  693. count(1)
  694. from achievement a
  695. where a.deleted_sign = 0 and a.audit_status = 2 and a.info_sources=1 and a.release_status=1
  696. <if test="ownerId != null">
  697. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  698. </if>
  699. <if test="serialNumber != null">
  700. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  701. </if>
  702. <if test="auditStatus != null">
  703. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  704. </if>
  705. <if test="name != null">
  706. and a.name = #{name,jdbcType=VARCHAR}
  707. </if>
  708. <if test="keyword != null">
  709. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  710. </if>
  711. <if test="dataCategory != null and dataCategory != ''">
  712. and a.data_category = #{dataCategory,jdbcType=INTEGER}
  713. </if>
  714. <if test="category != null">
  715. and a.category = #{category,jdbcType=INTEGER}
  716. </if>
  717. <if test="ownerType != null">
  718. and a.owner_type = #{ownerType,jdbcType=INTEGER}
  719. </if>
  720. <if test="fieldA != null">
  721. and a.field_a = #{fieldA,jdbcType=VARCHAR}
  722. </if>
  723. <if test="status != null">
  724. and a.status = #{status,jdbcType=INTEGER}
  725. </if>
  726. <if test="rStart != null">
  727. and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  728. </if>
  729. <if test="rEnd != null">
  730. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  731. </if>
  732. <if test="releaseStatus != null">
  733. and a.release_status = #{releaseStatus,jdbcType=INTEGER}
  734. </if>
  735. </select>
  736. <select id="selectUserOwnerDetail" parameterType="java.lang.String" resultType="com.goafanti.achievement.bo.AchievementUserOwnerDetailBo">
  737. select
  738. a.id, a.serial_number as serialNumber, a.data_category as dataCategory,
  739. a.name, a.keyword, a.category,
  740. a.summary, a.introduction, a.technical_picture_url as technicalPictureUrl,
  741. a.field_a as fieldA, a.field_b as fieldB, a.field_c as fieldC, f.name as field1, f2.name as field2,
  742. a.maturity, a.maturity_picture_url as maturityPictureUrl, a.maturity_text_file_url as maturityTextFileUrl,
  743. a.maturity_video_url as maturityVideoUrl, a.innovation, a.owner_id as ownerId,
  744. a.owner_name as ownerName, a.owner_type as ownerType, a.owner_id_number as ownerIdNumber,
  745. a.owner_mobile as ownerMobile, a.owner_email as ownerEmail, a.owner_postal_address as ownerPostalAddress,
  746. a.cooperation_mode as cooperationMode, a.transfer_mode as transferMode, a.bargaining_mode as bargainingMode,
  747. a.transfer_price as transferPrice, a.technical_scene as technicalScene, a.breakthrough,
  748. a.patent_case as patentCase, a.awards, a.team_des as teamDes,
  749. a.parameter, a.tech_plan_url as techPlanUrl, a.business_plan_url as businessPlanUrl,
  750. a.contacts, a.manager_id as managerId, a.salesman_id as salesmanId,
  751. a.create_time as createTime, a.release_status as releaseStatus,
  752. a.release_date as releaseDate, a.audit_status as auditStatus, a.tech_broker_id as techBrokerId,
  753. ui.username as iOwnerName, ui.province, ui.city, ui.area, u.email as iOwnerEmail,
  754. ui.id_number as iOwnerIdNumber, u.mobile as iOwnerMobile,j.easemob_name as easemobName,a.remark,
  755. ifnull(t2.x,0) as orderCount,a.boutique,a.contacts,a.contact_mobile as contactMobile,
  756. a.international_flag as internationalFlag
  757. from achievement a
  758. left join user_identity ui on a.owner_id = ui.uid
  759. left join field_glossory f on a.field_a=f.id
  760. left join field_glossory f2 on a.field_b=f2.id
  761. left join (select count(0) as x,tl.commodity_id from t_order tr
  762. left join t_order_detail tl on tl.order_no=tr.order_no
  763. where tr.order_status != 4 and tr.order_status != 0
  764. group by tl.commodity_id) t2 on a.id=t2.commodity_id
  765. left join jpush_easemob_account j on a.owner_id=j.uid
  766. left join user u on u.id = a.owner_id
  767. where a.id =#{id,jdbcType=VARCHAR}
  768. </select>
  769. <select id="selectOrgOwnerDetail" parameterType="java.lang.String" resultType="com.goafanti.achievement.bo.AchievementOrgOwnerDetailBo">
  770. select
  771. a.id, a.serial_number as serialNumber, a.data_category as dataCategory,
  772. a.name, a.keyword, a.category,
  773. a.summary, a.introduction, a.technical_picture_url as technicalPictureUrl,
  774. a.field_a as fieldA, a.field_b as fieldB, a.field_c as fieldC,
  775. a.maturity, a.maturity_picture_url as maturityPictureUrl, a.maturity_text_file_url as maturityTextFileUrl,
  776. a.maturity_video_url as maturityVideoUrl, a.innovation, a.owner_id as ownerId,
  777. a.owner_name as ownerName, a.owner_type as ownerType, a.owner_id_number as ownerIdNumber,
  778. a.owner_mobile as ownerMobile, a.owner_email as ownerEmail, a.owner_postal_address as ownerPostalAddress,
  779. a.cooperation_mode as cooperationMode, a.transfer_mode as transferMode, a.bargaining_mode as bargainingMode,
  780. a.transfer_price as transferPrice, a.technical_scene as technicalScene, a.breakthrough,
  781. a.patent_case as patentCase, a.awards, a.team_des as teamDes,
  782. a.parameter, a.tech_plan_url as techPlanUrl, a.business_plan_url as businessPlanUrl,
  783. a.contacts, a.manager_id as managerId, a.salesman_id as salesmanId, a.international_flag as internationalFlag,
  784. a.create_time as createTime, a.release_status as releaseStatus,
  785. a.release_date as releaseDate, a.audit_status as auditStatus, a.tech_broker_id as techBrokerId,
  786. oi.unit_name as iOwnerName, oi.postal_address as iOwnerPostalAddress, u.email as iOwnerEmail,
  787. 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
  788. from achievement a
  789. left join organization_identity oi on a.owner_id = oi.uid
  790. left join user u on u.id = a.owner_id
  791. left join marketing_management mm on a.id = mm.product_id
  792. where a.id = #{id,jdbcType=VARCHAR}
  793. </select>
  794. <insert id="insertBatch" parameterType="com.goafanti.common.model.Achievement">
  795. insert into achievement
  796. (id, deleted_sign, audit_status,
  797. create_time, release_status, data_category,
  798. name, keyword, category,
  799. owner_name, owner_type, owner_id_number,
  800. owner_mobile, owner_email, owner_postal_address,
  801. cooperation_mode, introduction, tech_broker_id,international_flag
  802. )
  803. values
  804. <foreach item="item" index="index" collection="list" separator=",">
  805. (
  806. #{item.id,jdbcType=VARCHAR}, #{item.deletedSign,jdbcType=INTEGER}, #{item.auditStatus,jdbcType=INTEGER},
  807. #{item.createTime,jdbcType=TIMESTAMP}, #{item.releaseStatus,jdbcType=INTEGER}, #{item.dataCategory,jdbcType=INTEGER},
  808. #{item.name,jdbcType=VARCHAR}, #{item.keyword,jdbcType=VARCHAR}, #{item.category,jdbcType=INTEGER},
  809. #{item.ownerName,jdbcType=VARCHAR}, #{item.ownerType,jdbcType=VARCHAR}, #{item.ownerIdNumber,jdbcType=VARCHAR},
  810. #{item.ownerMobile,jdbcType=VARCHAR}, #{item.ownerEmail,jdbcType=VARCHAR}, #{item.ownerPostalAddress,jdbcType=VARCHAR},
  811. #{item.cooperationMode,jdbcType=INTEGER}, #{item.introduction,jdbcType=LONGVARCHAR},#{item.techBrokerId,jdbcType=VARCHAR},
  812. #{item.internationalFlag,jdbcType=INTEGER}
  813. )
  814. </foreach>
  815. </insert>
  816. <select id="selectAchievementDetail" resultType="com.goafanti.portal.bo.AchievementDetailBo">
  817. select
  818. a.id,
  819. a.owner_name as ownerName,
  820. a.serial_number as serialNumber,
  821. a.keyword,
  822. a.name,
  823. a.data_category as dataCategory,
  824. a.category,
  825. ui.username,
  826. oi.unit_name as unitName,
  827. a.release_date as releaseDate,
  828. a.owner_type as ownerType,
  829. a.field_a as fieldA,
  830. a.field_b as fieldB,
  831. a.transfer_price as transferPrice,
  832. a.maturity,
  833. a.transfer_mode as transferMode,
  834. a.bargaining_mode as bargainingMode,
  835. a.summary,
  836. a.introduction,
  837. a.technical_picture_url as technicalPictureUrl,
  838. a.maturity_picture_url as maturityPictureUrl,
  839. a.maturity_text_file_url as maturityTextFileUrl,
  840. a.maturity_video_url as maturityVideoUrl,
  841. a.innovation,
  842. a.cooperation_mode as cooperationMode,
  843. a.bargaining_mode as bargainingMode,
  844. a.technical_scene as technicalScene,
  845. a.breakthrough,
  846. a.patent_case as patentCase,
  847. a.awards,
  848. a.team_des as teamDes,
  849. a.parameter,
  850. a.tech_plan_url as techPlanUrl,
  851. a.business_plan_url as businessPlanUrl,
  852. ai.id as achievementInterestId
  853. from achievement a
  854. left join user_identity ui on ui.uid = a.owner_id
  855. left join organization_identity oi on oi.uid = a.owner_id
  856. left join achievement_interest ai on ai.achievement_id = a.id and ai.uid = #{0}
  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 industry_category fg on
  1065. fg.id = d.field_a
  1066. left join industry_category fgg on
  1067. fgg.id = d.field_b
  1068. left join branch_information branchInfo on
  1069. instr( #{1},branchInfo.domain_name )>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. fg.name as fieldAS,
  1091. fgg.name as fieldBS,
  1092. a.introduction
  1093. from achievement a
  1094. left join branch_information branchInfo
  1095. on INSTR(#{1},branchInfo.domain_name)>0
  1096. left join achievement_publish ap
  1097. on ap.achievement_id=a.id
  1098. left join industry_category fg on
  1099. fg.id = a.field_a
  1100. left join industry_category fgg on
  1101. fgg.id = a.field_b
  1102. left join
  1103. (select
  1104. count(0) as ct,
  1105. achievement_id as interest_aid
  1106. from achievement_interest
  1107. group by
  1108. achievement_id
  1109. ) b
  1110. on b.interest_aid=a.id
  1111. where a.audit_status=2
  1112. and ap.achievement_id=a.id
  1113. and branchInfo.id = ap.publish_platform
  1114. and instr(ap.publish_page,#{2})>0
  1115. and info_sources=1
  1116. order by a.release_date desc limit #{0}
  1117. </select>
  1118. <select id="getPatentList" resultType="com.goafanti.portal.bo.AchievementObject">
  1119. select
  1120. a.id,
  1121. a.name,
  1122. a.technical_picture_url as technicalPictureUrl,
  1123. a.category,
  1124. data_category as dataCategory,
  1125. release_date as releaseDate
  1126. from
  1127. achievement a
  1128. left join branch_information bi on instr(#{1},bi.domain_name)>0
  1129. left join achievement_publish ap on ap.achievement_id=a.id
  1130. where audit_status=2
  1131. and bi.id =ap.publish_platform
  1132. and category=0
  1133. and instr(ap.publish_page,#{2})>0
  1134. and info_sources=1
  1135. order by release_date desc limit #{0}
  1136. </select>
  1137. <select id="getPracticalTechnologys" resultType="com.goafanti.portal.bo.AchievementObject">
  1138. select
  1139. a.id,
  1140. a.name,
  1141. a.technical_picture_url as technicalPictureUrl,
  1142. a.is_hot as isHot,
  1143. a.category,
  1144. release_date as releaseDate,
  1145. a.data_category as dataCategory,
  1146. transfer_mode as transferMode,
  1147. fg.name as fieldAS,
  1148. fgg.name as fieldBS
  1149. from
  1150. achievement a
  1151. left join branch_information bi on instr(#{1},bi.domain_name)>0
  1152. left join achievement_publish ap on ap.achievement_id=a.id
  1153. left join industry_category fg on
  1154. fg.id = a.field_a
  1155. left join industry_category fgg on
  1156. fgg.id = a.field_b
  1157. where audit_status=2
  1158. and bi.id =ap.publish_platform
  1159. and data_category=1
  1160. and instr(ap.publish_page,#{2})>0
  1161. and info_sources=1
  1162. order by release_date desc limit #{0}
  1163. </select>
  1164. <select id="getIntellectualProperty" resultType="com.goafanti.common.bo.PolicyEntity" >
  1165. select p.id,p.title,p.title_img as titleImg,p.summary,dg1.name as provinceS,dg2.name as cityS,edit_time as editTime ,create_time as createTime,p.id,p.source,p.source_url as sourceUrl from policy p
  1166. left join district_glossory dg1 on dg1.id=p.province
  1167. left join district_glossory dg2 on dg2.id=p.city
  1168. where audit_status = 2
  1169. order by edit_time
  1170. limit #{0}
  1171. </select>
  1172. <select id="getAchievementDetail" resultType="com.goafanti.portal.bo.AchievementObject" >
  1173. select
  1174. a.name as name,
  1175. a.transfer_mode as transferMode,
  1176. a.technical_picture_url as technicalPictureUrl,
  1177. a.maturity,
  1178. a.category,
  1179. a.owner_postal_address as city,
  1180. fg.name as fieldAS,
  1181. fgg.name as fieldBS,
  1182. a.release_date as releaseDate,
  1183. a.introduction,
  1184. u.identify_name as ownerName
  1185. from
  1186. achievement a
  1187. left join industry_category fg on
  1188. fg.id = a.field_a
  1189. left join industry_category fgg on
  1190. fgg.id = a.field_b
  1191. left join user u on u.id=a.owner_id
  1192. where
  1193. a.id = #{0}
  1194. </select>
  1195. <select id="getBoutiquePatent" resultType="com.goafanti.portal.bo.AchievementObject">
  1196. select
  1197. a.technical_picture_url as technicalPictureUrl,
  1198. name,
  1199. id,
  1200. data_category as dataCategory,
  1201. summary
  1202. from
  1203. achievement a
  1204. where
  1205. a.info_sources = 1
  1206. and audit_status=2
  1207. and a.boutique = 1
  1208. order by a.release_date desc
  1209. limit #{0}
  1210. </select>
  1211. <select id="guessYouLike" resultType="com.goafanti.portal.bo.AchievementObject">
  1212. select
  1213. a.id,
  1214. a.data_category as dataCategory,
  1215. a.name as name,
  1216. a.transfer_mode as transferMode,
  1217. a.technical_picture_url as technicalPictureUrl,
  1218. a.maturity,
  1219. a.category,
  1220. fg.name as fieldAS,
  1221. fgg.name as fieldBS,
  1222. release_date as releaseDate,
  1223. owner_type as ownerType,
  1224. introduction
  1225. from
  1226. achievement a
  1227. left join industry_category fg on
  1228. fg.id = a.field_a
  1229. left join industry_category fgg on
  1230. fgg.id = a.field_b
  1231. where
  1232. audit_status=2
  1233. and info_sources=1
  1234. order by release_date limit #{0}
  1235. </select>
  1236. <select id="listMyAchievementByPage" resultType="com.goafanti.portal.bo.AchievementObject">
  1237. select
  1238. a.id,
  1239. a.serial_number as serialNumber,
  1240. a.category,
  1241. a.data_category as dataCategory,
  1242. a.name,
  1243. a.release_date as releaseDate,
  1244. a.audit_status as auditStatus,
  1245. a.boutique,
  1246. if(isnull(c.interestCount),0,c.interestCount) as interestCount,
  1247. if(isnull(d.achievement_id),0,1) as ifInterest,
  1248. b.identify_name as ownerName
  1249. from achievement a
  1250. left join user b on a.owner_id = b.id left join (select achievement_id,count(*)as interestCount from achievement_interest group by achievement_id) c
  1251. on a.id=c.achievement_id left join (select achievement_id from achievement_interest where uid= #{ownerId,jdbcType=VARCHAR} )d on a.id=d.achievement_id
  1252. where a.deleted_sign = 0 and info_sources=1
  1253. <if test="ownerId != null">
  1254. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1255. </if>
  1256. <if test="name != null">
  1257. and a.name like concat('%',#{name,jdbcType=VARCHAR},'%')
  1258. </if>
  1259. <if test="ownerName != null">
  1260. and b.identify_name =#{ownerName,jdbcType=VARCHAR}
  1261. </if>
  1262. <if test="auditStatus != null">
  1263. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  1264. </if>
  1265. <if test="category != null">
  1266. and a.category = #{category,jdbcType=INTEGER}
  1267. </if>
  1268. <if test="dataCategory != null ">
  1269. and a.data_category = #{dataCategory,jdbcType=INTEGER}
  1270. </if>
  1271. <if test="startDate != null">
  1272. and a.release_date <![CDATA[ >= ]]> #{startDate,jdbcType=TIMESTAMP}
  1273. </if>
  1274. <if test="endDate != null">
  1275. and a.release_date <![CDATA[ <= ]]> #{endDate,jdbcType=TIMESTAMP}
  1276. </if>
  1277. order by a.release_date desc
  1278. <if test="page_sql!=null">
  1279. ${page_sql}
  1280. </if>
  1281. </select>
  1282. <select id="listMyAchievementCount" resultType="java.lang.Integer">
  1283. select
  1284. count(0)
  1285. from achievement a
  1286. left join user b on a.owner_id = b.id left join (select achievement_id,count(*)as interestCount from achievement_interest group by achievement_id) c
  1287. on a.id=c.achievement_id left join (select achievement_id from achievement_interest where uid='1' )d on a.id=d.achievement_id
  1288. where a.deleted_sign = 0 and info_sources=1
  1289. <if test="ownerId != null">
  1290. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1291. </if>
  1292. <if test="name != null">
  1293. and a.name like concat('%',#{name,jdbcType=VARCHAR},'%')
  1294. </if>
  1295. <if test="ownerName != null">
  1296. and b.identify_name=#{ownerName,jdbcType=VARCHAR}
  1297. </if>
  1298. <if test="auditStatus != null">
  1299. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  1300. </if>
  1301. <if test="category != null">
  1302. and a.category = #{category,jdbcType=INTEGER}
  1303. </if>
  1304. <if test="dataCategory != null ">
  1305. and a.data_category = #{dataCategory,jdbcType=INTEGER}
  1306. </if>
  1307. <if test="startDate != null">
  1308. and a.release_date <![CDATA[ >= ]]> #{startDate,jdbcType=TIMESTAMP}
  1309. </if>
  1310. <if test="endDate != null">
  1311. and a.release_date <![CDATA[ =< ]]> #{endDate,jdbcType=TIMESTAMP}
  1312. </if>
  1313. </select>
  1314. <select id="getAchievementDetailById" resultType="com.goafanti.portal.bo.AchievementResultObject" >
  1315. select
  1316. a.id,
  1317. a.name as name,
  1318. a.transfer_mode as transferMode,
  1319. a.technical_picture_url as technicalPictureUrl,
  1320. a.maturity,
  1321. a.category,
  1322. a.data_category as dataCategory,
  1323. a.owner_postal_address as city,
  1324. fg.name as fieldAS,
  1325. fgg.name as fieldBS,
  1326. a.release_date as releaseDate,
  1327. a.introduction,
  1328. a.patent_case as patentCase,
  1329. a.parameter,
  1330. a.team_des as teamDes,
  1331. a.field_a as fieldA,
  1332. a.field_b as fieldB,
  1333. a.innovation,
  1334. a.transfer_mode as transferMode,
  1335. a.bargaining_mode as bargainingMode,
  1336. a.boutique,
  1337. a.is_hot as isHot,
  1338. a.audit_status as auditStatus,
  1339. a.audit_info as auditInfo
  1340. from
  1341. achievement a
  1342. left join industry_category fg on
  1343. fg.id = a.field_a
  1344. left join industry_category fgg on
  1345. fgg.id = a.field_b
  1346. where
  1347. a.id = #{0}
  1348. </select>
  1349. <select id="listInterestedAchievement" resultType="com.goafanti.portal.bo.AchievementObject">
  1350. select
  1351. a.id,
  1352. a.serial_number as serialNumber,
  1353. a.category,
  1354. a.data_category as dataCategory,
  1355. a.name,
  1356. a.release_date as releaseDate,
  1357. a.audit_status as auditStatus,
  1358. a.technical_picture_url as technicalPictureUrl,
  1359. a.boutique,
  1360. a.release_date as releaseDate,
  1361. introduction
  1362. from achievement a
  1363. left join achievement_interest ai on ai.achievement_id=a.id
  1364. where ai.uid=#{uid,jdbcType=VARCHAR}
  1365. <if test="page_sql!=null">
  1366. ${page_sql}
  1367. </if>
  1368. </select>
  1369. <select id="listInterestedAchievementCount" resultType="java.lang.Integer">
  1370. select
  1371. count(0)
  1372. from achievement a
  1373. left join achievement_interest ai on ai.achievement_id=a.id
  1374. where ai.uid=#{uid,jdbcType=VARCHAR}
  1375. </select>
  1376. <select id="selectAppAchuevementDetail" resultType="com.goafanti.achievement.bo.AchievementEntity">
  1377. select a.id,a.name,a.keyword,a.data_category,a.summary,a.introduction,a.transfer_mode as transferMode,a.status,a.transfer_price as transferPrice ,a.innovation,a.maturity,a.audit_status,a.technical_picture_url as technicalPictureUrl,
  1378. a.field_a as fieldA,a.field_b as fieldB,a.field_c as fieldC,f.name as field1,f2.name as field2,f3.name as field3,a.release_status as releaseStatus,a.audit_status as auditStatus,a.boutique,a.field_a as fieldA,a.is_hot as isHot,a.release_date as releaseDate,if(isnull(b.count),0,b.count) as interestCount,
  1379. if(isnull(d.achievement_id),0,1) interest,ifnull(t.x,0) as orderCount
  1380. from achievement a left join industry_category f on a.field_a=f.id
  1381. left join industry_category f2 on a.field_b=f2.id
  1382. left join industry_category f3 on a.field_c=f3.id
  1383. left join ( select count(0) as x,tl.commodity_id from t_order tr
  1384. left join t_order_detail tl on tl.order_no=tr.order_no
  1385. where tr.order_status != 4 and tr.order_status != 0
  1386. group by tl.commodity_id) t on a.id=t.commodity_id
  1387. left join (select achievement_id,count(*) as count from achievement_interest group by achievement_id ) b
  1388. on a.id=b.achievement_id left join (select achievement_id from achievement_interest where uid= #{uid,jdbcType=VARCHAR} )d on a.id=d.achievement_id
  1389. where a.deleted_sign = 0 and a.info_sources=1
  1390. AND a.id =#{id,jdbcType=VARCHAR}
  1391. </select>
  1392. <select id="myCollectionAchievementList" resultType="com.goafanti.common.bo.MyCollection">
  1393. select
  1394. a.id, a.name, a.introduction, b.name as fieidA, ai.uid, a.maturity as textA
  1395. from achievement a
  1396. left join achievement_interest ai on ai.achievement_id=a.id
  1397. left join field_glossory b on a.field_a= b.id
  1398. where ai.uid= #{uid,jdbcType=VARCHAR}
  1399. order by ai.create_time desc
  1400. <if test="page_sql!=null">
  1401. ${page_sql}
  1402. </if>
  1403. </select>
  1404. <select id="myCollectionAchievementCount" resultType="java.lang.Integer">
  1405. select
  1406. count(0)
  1407. from achievement a
  1408. left join achievement_interest ai on ai.achievement_id=a.id
  1409. where ai.uid=#{uid,jdbcType=VARCHAR}
  1410. </select>
  1411. </mapper>