AchievementMapper.xml 55 KB

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