AchievementMapper.xml 67 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808
  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="contacts" jdbcType="INTEGER" property="contacts" />
  48. <result column="manager_id" jdbcType="VARCHAR" property="managerId" />
  49. <result column="salesman_id" jdbcType="VARCHAR" property="salesmanId" />
  50. <result column="status" jdbcType="INTEGER" property="status" />
  51. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  52. <result column="release_status" jdbcType="INTEGER" property="releaseStatus" />
  53. <result column="release_date" jdbcType="TIMESTAMP" property="releaseDate" />
  54. <result column="deleted_sign" jdbcType="INTEGER" property="deletedSign" />
  55. <result column="audit_status" jdbcType="INTEGER" property="auditStatus" />
  56. <result column="tech_broker_id" jdbcType="VARCHAR" property="techBrokerId" />
  57. <result column="country_name_zh" jdbcType="VARCHAR" property="countryNameZh" />
  58. <result column="international_flag" jdbcType="INTEGER" property="internationalFlag" />
  59. <result column="jmrh_flag" jdbcType="INTEGER" property="jmrhFlag" />
  60. <result column="boutique" jdbcType="INTEGER" property="boutique" />
  61. </resultMap>
  62. <sql id="Base_Column_List">
  63. id, serial_number, data_category, name, keyword, category, summary, introduction,
  64. technical_picture_url, field_a, field_b, field_c, maturity, maturity_picture_url,
  65. maturity_text_file_url, maturity_video_url, innovation, owner_id, owner_name, owner_type, owner_id_number,
  66. owner_mobile, owner_email, owner_postal_address, cooperation_mode, transfer_mode,
  67. bargaining_mode, transfer_price, technical_scene, breakthrough, patent_case, awards,
  68. team_des, parameter, tech_plan_url, business_plan_url, org_id, org_name, org_address,
  69. org_email, org_contacts, org_contacts_mobile, contacts, manager_id, salesman_id,
  70. status, create_time, release_status, release_date, deleted_sign, audit_status, tech_broker_id,
  71. country_name_zh,international_flag,jmrh_flag,boutique
  72. </sql>
  73. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  74. select
  75. <include refid="Base_Column_List" />
  76. from achievement
  77. where id = #{id,jdbcType=VARCHAR}
  78. </select>
  79. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  80. delete from achievement
  81. where id = #{id,jdbcType=VARCHAR}
  82. </delete>
  83. <insert id="insert" parameterType="com.goafanti.common.model.Achievement">
  84. insert into achievement (id, serial_number, data_category,
  85. name, keyword, category,
  86. summary, introduction, technical_picture_url,
  87. field_a, field_b, field_c,
  88. maturity, maturity_picture_url, maturity_text_file_url,
  89. maturity_video_url, innovation, owner_id, owner_name,
  90. owner_type, owner_id_number, owner_mobile,
  91. owner_email, owner_postal_address, cooperation_mode,
  92. transfer_mode, bargaining_mode, transfer_price,
  93. technical_scene, breakthrough, patent_case,
  94. awards, team_des, parameter,
  95. tech_plan_url, business_plan_url, org_id,
  96. org_name, org_address, org_email,
  97. org_contacts, org_contacts_mobile, contacts,
  98. manager_id, salesman_id, status,
  99. create_time, release_status, release_date,
  100. deleted_sign, audit_status, tech_broker_id,
  101. country_name_zh,international_flag,jmrh_flag,boutique,remark)
  102. values (#{id,jdbcType=VARCHAR}, #{serialNumber,jdbcType=INTEGER}, #{dataCategory,jdbcType=INTEGER},
  103. #{name,jdbcType=VARCHAR}, #{keyword,jdbcType=VARCHAR}, #{category,jdbcType=INTEGER},
  104. #{summary,jdbcType=VARCHAR}, #{introduction,jdbcType=LONGVARCHAR}, #{technicalPictureUrl,jdbcType=VARCHAR},
  105. #{fieldA,jdbcType=INTEGER}, #{fieldB,jdbcType=INTEGER}, #{fieldC,jdbcType=INTEGER},
  106. #{maturity,jdbcType=INTEGER}, #{maturityPictureUrl,jdbcType=LONGVARCHAR}, #{maturityTextFileUrl,jdbcType=VARCHAR},
  107. #{maturityVideoUrl,jdbcType=VARCHAR}, #{innovation,jdbcType=INTEGER}, #{ownerId,jdbcType=VARCHAR}, #{ownerName,jdbcType=VARCHAR},
  108. #{ownerType,jdbcType=INTEGER}, #{ownerIdNumber,jdbcType=VARCHAR}, #{ownerMobile,jdbcType=VARCHAR},
  109. #{ownerEmail,jdbcType=VARCHAR}, #{ownerPostalAddress,jdbcType=VARCHAR}, #{cooperationMode,jdbcType=INTEGER},
  110. #{transferMode,jdbcType=INTEGER}, #{bargainingMode,jdbcType=INTEGER}, #{transferPrice,jdbcType=DECIMAL},
  111. #{technicalScene,jdbcType=VARCHAR}, #{breakthrough,jdbcType=VARCHAR}, #{patentCase,jdbcType=VARCHAR},
  112. #{awards,jdbcType=VARCHAR}, #{teamDes,jdbcType=VARCHAR}, #{parameter,jdbcType=VARCHAR},
  113. #{techPlanUrl,jdbcType=VARCHAR}, #{businessPlanUrl,jdbcType=VARCHAR}, #{orgId,jdbcType=VARCHAR},
  114. #{orgName,jdbcType=VARCHAR}, #{orgAddress,jdbcType=VARCHAR}, #{orgEmail,jdbcType=VARCHAR},
  115. #{orgContacts,jdbcType=VARCHAR}, #{orgContactsMobile,jdbcType=VARCHAR}, #{contacts,jdbcType=INTEGER},
  116. #{managerId,jdbcType=VARCHAR}, #{salesmanId,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
  117. #{createTime,jdbcType=TIMESTAMP}, #{releaseStatus,jdbcType=INTEGER}, #{releaseDate,jdbcType=TIMESTAMP},
  118. #{deletedSign,jdbcType=INTEGER}, #{auditStatus,jdbcType=INTEGER}, #{techBrokerId,jdbcType=VARCHAR},
  119. #{countryNameZh,jdbcType=VARCHAR}, #{internationalFlag,jdbcType=INTEGER},#{jmrhFlag,jdbcType=INTEGER},#{boutique,jdbcType=INTEGER},#{remark,jdbcType=VARCHAR})
  120. </insert>
  121. <insert id="insertSelective" parameterType="com.goafanti.common.model.Achievement">
  122. insert into achievement
  123. <trim prefix="(" suffix=")" suffixOverrides=",">
  124. <if test="id != null">
  125. id,
  126. </if>
  127. <if test="serialNumber != null">
  128. serial_number,
  129. </if>
  130. <if test="dataCategory != null">
  131. data_category,
  132. </if>
  133. <if test="name != null">
  134. name,
  135. </if>
  136. <if test="keyword != null">
  137. keyword,
  138. </if>
  139. <if test="category != null">
  140. category,
  141. </if>
  142. <if test="summary != null">
  143. summary,
  144. </if>
  145. <if test="introduction != null">
  146. introduction,
  147. </if>
  148. <if test="technicalPictureUrl != null">
  149. technical_picture_url,
  150. </if>
  151. <if test="fieldA != null">
  152. field_a,
  153. </if>
  154. <if test="fieldB != null">
  155. field_b,
  156. </if>
  157. <if test="fieldC != null">
  158. field_c,
  159. </if>
  160. <if test="maturity != null">
  161. maturity,
  162. </if>
  163. <if test="maturityPictureUrl != null">
  164. maturity_picture_url,
  165. </if>
  166. <if test="maturityTextFileUrl != null">
  167. maturity_text_file_url,
  168. </if>
  169. <if test="maturityVideoUrl != null">
  170. maturity_video_url,
  171. </if>
  172. <if test="innovation != null">
  173. innovation,
  174. </if>
  175. <if test="ownerId != null">
  176. owner_id,
  177. </if>
  178. <if test="ownerName != null">
  179. owner_name,
  180. </if>
  181. <if test="ownerType != null">
  182. owner_type,
  183. </if>
  184. <if test="ownerIdNumber != null">
  185. owner_id_number,
  186. </if>
  187. <if test="ownerMobile != null">
  188. owner_mobile,
  189. </if>
  190. <if test="ownerEmail != null">
  191. owner_email,
  192. </if>
  193. <if test="ownerPostalAddress != null">
  194. owner_postal_address,
  195. </if>
  196. <if test="cooperationMode != null">
  197. cooperation_mode,
  198. </if>
  199. <if test="transferMode != null">
  200. transfer_mode,
  201. </if>
  202. <if test="bargainingMode != null">
  203. bargaining_mode,
  204. </if>
  205. <if test="transferPrice != null">
  206. transfer_price,
  207. </if>
  208. <if test="technicalScene != null">
  209. technical_scene,
  210. </if>
  211. <if test="breakthrough != null">
  212. breakthrough,
  213. </if>
  214. <if test="patentCase != null">
  215. patent_case,
  216. </if>
  217. <if test="awards != null">
  218. awards,
  219. </if>
  220. <if test="teamDes != null">
  221. team_des,
  222. </if>
  223. <if test="parameter != null">
  224. parameter,
  225. </if>
  226. <if test="techPlanUrl != null">
  227. tech_plan_url,
  228. </if>
  229. <if test="businessPlanUrl != null">
  230. business_plan_url,
  231. </if>
  232. <if test="orgId != null">
  233. org_id,
  234. </if>
  235. <if test="orgName != null">
  236. org_name,
  237. </if>
  238. <if test="orgAddress != null">
  239. org_address,
  240. </if>
  241. <if test="orgEmail != null">
  242. org_email,
  243. </if>
  244. <if test="orgContacts != null">
  245. org_contacts,
  246. </if>
  247. <if test="orgContactsMobile != null">
  248. org_contacts_mobile,
  249. </if>
  250. <if test="contacts != null">
  251. contacts,
  252. </if>
  253. <if test="managerId != null">
  254. manager_id,
  255. </if>
  256. <if test="salesmanId != null">
  257. salesman_id,
  258. </if>
  259. <if test="status != null">
  260. status,
  261. </if>
  262. <if test="createTime != null">
  263. create_time,
  264. </if>
  265. <if test="releaseStatus != null">
  266. release_status,
  267. </if>
  268. <if test="releaseDate != null">
  269. release_date,
  270. </if>
  271. <if test="deletedSign != null">
  272. deleted_sign,
  273. </if>
  274. <if test="auditStatus != null">
  275. audit_status,
  276. </if>
  277. <if test="techBrokerId != null">
  278. tech_broker_id,
  279. </if>
  280. <if test="countryNameZh != null">
  281. country_name_zh,
  282. </if>
  283. <if test="internationalFlag != null">
  284. international_flag,
  285. </if>
  286. <if test="jmrhFlag != null">
  287. jmrh_flag,
  288. </if>
  289. <if test="boutique !=null">
  290. boutique,
  291. </if>
  292. </trim>
  293. <trim prefix="values (" suffix=")" suffixOverrides=",">
  294. <if test="id != null">
  295. #{id,jdbcType=VARCHAR},
  296. </if>
  297. <if test="serialNumber != null">
  298. #{serialNumber,jdbcType=INTEGER},
  299. </if>
  300. <if test="dataCategory != null">
  301. #{dataCategory,jdbcType=INTEGER},
  302. </if>
  303. <if test="name != null">
  304. #{name,jdbcType=VARCHAR},
  305. </if>
  306. <if test="keyword != null">
  307. #{keyword,jdbcType=VARCHAR},
  308. </if>
  309. <if test="category != null">
  310. #{category,jdbcType=INTEGER},
  311. </if>
  312. <if test="summary != null">
  313. #{summary,jdbcType=VARCHAR},
  314. </if>
  315. <if test="introduction != null">
  316. #{introduction,jdbcType=LONGVARCHAR},
  317. </if>
  318. <if test="technicalPictureUrl != null">
  319. #{technicalPictureUrl,jdbcType=VARCHAR},
  320. </if>
  321. <if test="fieldA != null">
  322. #{fieldA,jdbcType=INTEGER},
  323. </if>
  324. <if test="fieldB != null">
  325. #{fieldB,jdbcType=INTEGER},
  326. </if>
  327. <if test="fieldC != null">
  328. #{fieldC,jdbcType=INTEGER},
  329. </if>
  330. <if test="maturity != null">
  331. #{maturity,jdbcType=INTEGER},
  332. </if>
  333. <if test="maturityPictureUrl != null">
  334. #{maturityPictureUrl,jdbcType=LONGVARCHAR},
  335. </if>
  336. <if test="maturityTextFileUrl != null">
  337. #{maturityTextFileUrl,jdbcType=VARCHAR},
  338. </if>
  339. <if test="maturityVideoUrl != null">
  340. #{maturityVideoUrl,jdbcType=VARCHAR},
  341. </if>
  342. <if test="innovation != null">
  343. #{innovation,jdbcType=INTEGER},
  344. </if>
  345. <if test="ownerId != null">
  346. #{ownerId,jdbcType=VARCHAR},
  347. </if>
  348. <if test="ownerName != null">
  349. #{ownerName,jdbcType=VARCHAR},
  350. </if>
  351. <if test="ownerType != null">
  352. #{ownerType,jdbcType=INTEGER},
  353. </if>
  354. <if test="ownerIdNumber != null">
  355. #{ownerIdNumber,jdbcType=VARCHAR},
  356. </if>
  357. <if test="ownerMobile != null">
  358. #{ownerMobile,jdbcType=VARCHAR},
  359. </if>
  360. <if test="ownerEmail != null">
  361. #{ownerEmail,jdbcType=VARCHAR},
  362. </if>
  363. <if test="ownerPostalAddress != null">
  364. #{ownerPostalAddress,jdbcType=VARCHAR},
  365. </if>
  366. <if test="cooperationMode != null">
  367. #{cooperationMode,jdbcType=INTEGER},
  368. </if>
  369. <if test="transferMode != null">
  370. #{transferMode,jdbcType=INTEGER},
  371. </if>
  372. <if test="bargainingMode != null">
  373. #{bargainingMode,jdbcType=INTEGER},
  374. </if>
  375. <if test="transferPrice != null">
  376. #{transferPrice,jdbcType=DECIMAL},
  377. </if>
  378. <if test="technicalScene != null">
  379. #{technicalScene,jdbcType=VARCHAR},
  380. </if>
  381. <if test="breakthrough != null">
  382. #{breakthrough,jdbcType=VARCHAR},
  383. </if>
  384. <if test="patentCase != null">
  385. #{patentCase,jdbcType=VARCHAR},
  386. </if>
  387. <if test="awards != null">
  388. #{awards,jdbcType=VARCHAR},
  389. </if>
  390. <if test="teamDes != null">
  391. #{teamDes,jdbcType=VARCHAR},
  392. </if>
  393. <if test="parameter != null">
  394. #{parameter,jdbcType=VARCHAR},
  395. </if>
  396. <if test="techPlanUrl != null">
  397. #{techPlanUrl,jdbcType=VARCHAR},
  398. </if>
  399. <if test="businessPlanUrl != null">
  400. #{businessPlanUrl,jdbcType=VARCHAR},
  401. </if>
  402. <if test="orgId != null">
  403. #{orgId,jdbcType=VARCHAR},
  404. </if>
  405. <if test="orgName != null">
  406. #{orgName,jdbcType=VARCHAR},
  407. </if>
  408. <if test="orgAddress != null">
  409. #{orgAddress,jdbcType=VARCHAR},
  410. </if>
  411. <if test="orgEmail != null">
  412. #{orgEmail,jdbcType=VARCHAR},
  413. </if>
  414. <if test="orgContacts != null">
  415. #{orgContacts,jdbcType=VARCHAR},
  416. </if>
  417. <if test="orgContactsMobile != null">
  418. #{orgContactsMobile,jdbcType=VARCHAR},
  419. </if>
  420. <if test="contacts != null">
  421. #{contacts,jdbcType=INTEGER},
  422. </if>
  423. <if test="managerId != null">
  424. #{managerId,jdbcType=VARCHAR},
  425. </if>
  426. <if test="salesmanId != null">
  427. #{salesmanId,jdbcType=VARCHAR},
  428. </if>
  429. <if test="status != null">
  430. #{status,jdbcType=INTEGER},
  431. </if>
  432. <if test="createTime != null">
  433. #{createTime,jdbcType=TIMESTAMP},
  434. </if>
  435. <if test="releaseStatus != null">
  436. #{releaseStatus,jdbcType=INTEGER},
  437. </if>
  438. <if test="releaseDate != null">
  439. #{releaseDate,jdbcType=TIMESTAMP},
  440. </if>
  441. <if test="deletedSign != null">
  442. #{deletedSign,jdbcType=INTEGER},
  443. </if>
  444. <if test="auditStatus != null">
  445. #{auditStatus,jdbcType=INTEGER},
  446. </if>
  447. <if test="techBrokerId != null">
  448. #{techBrokerId,jdbcType=VARCHAR},
  449. </if>
  450. <if test="countryNameZh != null">
  451. #{countryNameZh,jdbcType=VARCHAR},
  452. </if>
  453. <if test="internationalFlag != null">
  454. #{internationalFlag,jdbcType=INTEGER},
  455. </if>
  456. <if test="jmrhFlag != null">
  457. #{jmrhFlag,jdbcType=INTEGER},
  458. </if>
  459. <if test="boutique != null">
  460. #{boutique,jdbcType=INTEGER}
  461. </if>
  462. </trim>
  463. </insert>
  464. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.Achievement">
  465. update achievement
  466. <set>
  467. <if test="serialNumber != null">
  468. serial_number = #{serialNumber,jdbcType=INTEGER},
  469. </if>
  470. <if test="dataCategory != null">
  471. data_category = #{dataCategory,jdbcType=INTEGER},
  472. </if>
  473. <if test="name != null">
  474. name = #{name,jdbcType=VARCHAR},
  475. </if>
  476. <if test="keyword != null">
  477. keyword = #{keyword,jdbcType=VARCHAR},
  478. </if>
  479. <if test="category != null">
  480. category = #{category,jdbcType=INTEGER},
  481. </if>
  482. <if test="summary != null">
  483. summary = #{summary,jdbcType=VARCHAR},
  484. </if>
  485. <if test="introduction != null">
  486. introduction = #{introduction,jdbcType=LONGVARCHAR},
  487. </if>
  488. <if test="technicalPictureUrl != null">
  489. technical_picture_url = #{technicalPictureUrl,jdbcType=VARCHAR},
  490. </if>
  491. <if test="fieldA != null">
  492. field_a = #{fieldA,jdbcType=INTEGER},
  493. </if>
  494. <if test="fieldB != null">
  495. field_b = #{fieldB,jdbcType=INTEGER},
  496. </if>
  497. <if test="fieldC != null">
  498. field_c = #{fieldC,jdbcType=INTEGER},
  499. </if>
  500. <if test="maturity != null">
  501. maturity = #{maturity,jdbcType=INTEGER},
  502. </if>
  503. <if test="maturityPictureUrl != null">
  504. maturity_picture_url = #{maturityPictureUrl,jdbcType=LONGVARCHAR},
  505. </if>
  506. <if test="maturityTextFileUrl != null">
  507. maturity_text_file_url = #{maturityTextFileUrl,jdbcType=VARCHAR},
  508. </if>
  509. <if test="maturityVideoUrl != null">
  510. maturity_video_url = #{maturityVideoUrl,jdbcType=VARCHAR},
  511. </if>
  512. <if test="innovation != null">
  513. innovation = #{innovation,jdbcType=INTEGER},
  514. </if>
  515. <if test="ownerId != null">
  516. owner_id = #{ownerId,jdbcType=VARCHAR},
  517. </if>
  518. <if test="ownerName != null">
  519. owner_name = #{ownerName,jdbcType=VARCHAR},
  520. </if>
  521. <if test="ownerType != null">
  522. owner_type = #{ownerType,jdbcType=INTEGER},
  523. </if>
  524. <if test="ownerIdNumber != null">
  525. owner_id_number = #{ownerIdNumber,jdbcType=VARCHAR},
  526. </if>
  527. <if test="ownerMobile != null">
  528. owner_mobile = #{ownerMobile,jdbcType=VARCHAR},
  529. </if>
  530. <if test="ownerEmail != null">
  531. owner_email = #{ownerEmail,jdbcType=VARCHAR},
  532. </if>
  533. <if test="ownerPostalAddress != null">
  534. owner_postal_address = #{ownerPostalAddress,jdbcType=VARCHAR},
  535. </if>
  536. <if test="cooperationMode != null">
  537. cooperation_mode = #{cooperationMode,jdbcType=INTEGER},
  538. </if>
  539. <if test="transferMode != null">
  540. transfer_mode = #{transferMode,jdbcType=INTEGER},
  541. </if>
  542. <if test="bargainingMode != null">
  543. bargaining_mode = #{bargainingMode,jdbcType=INTEGER},
  544. </if>
  545. <if test="transferPrice != null">
  546. transfer_price = #{transferPrice,jdbcType=DECIMAL},
  547. </if>
  548. <if test="technicalScene != null">
  549. technical_scene = #{technicalScene,jdbcType=VARCHAR},
  550. </if>
  551. <if test="breakthrough != null">
  552. breakthrough = #{breakthrough,jdbcType=VARCHAR},
  553. </if>
  554. <if test="patentCase != null">
  555. patent_case = #{patentCase,jdbcType=VARCHAR},
  556. </if>
  557. <if test="awards != null">
  558. awards = #{awards,jdbcType=VARCHAR},
  559. </if>
  560. <if test="teamDes != null">
  561. team_des = #{teamDes,jdbcType=VARCHAR},
  562. </if>
  563. <if test="parameter != null">
  564. parameter = #{parameter,jdbcType=VARCHAR},
  565. </if>
  566. <if test="techPlanUrl != null">
  567. tech_plan_url = #{techPlanUrl,jdbcType=VARCHAR},
  568. </if>
  569. <if test="businessPlanUrl != null">
  570. business_plan_url = #{businessPlanUrl,jdbcType=VARCHAR},
  571. </if>
  572. <if test="orgId != null">
  573. org_id = #{orgId,jdbcType=VARCHAR},
  574. </if>
  575. <if test="orgName != null">
  576. org_name = #{orgName,jdbcType=VARCHAR},
  577. </if>
  578. <if test="orgAddress != null">
  579. org_address = #{orgAddress,jdbcType=VARCHAR},
  580. </if>
  581. <if test="orgEmail != null">
  582. org_email = #{orgEmail,jdbcType=VARCHAR},
  583. </if>
  584. <if test="orgContacts != null">
  585. org_contacts = #{orgContacts,jdbcType=VARCHAR},
  586. </if>
  587. <if test="orgContactsMobile != null">
  588. org_contacts_mobile = #{orgContactsMobile,jdbcType=VARCHAR},
  589. </if>
  590. <if test="contacts != null">
  591. contacts = #{contacts,jdbcType=INTEGER},
  592. </if>
  593. <if test="managerId != null">
  594. manager_id = #{managerId,jdbcType=VARCHAR},
  595. </if>
  596. <if test="salesmanId != null">
  597. salesman_id = #{salesmanId,jdbcType=VARCHAR},
  598. </if>
  599. <if test="status != null">
  600. status = #{status,jdbcType=INTEGER},
  601. </if>
  602. <if test="createTime != null">
  603. create_time = #{createTime,jdbcType=TIMESTAMP},
  604. </if>
  605. <if test="releaseStatus != null">
  606. release_status = #{releaseStatus,jdbcType=INTEGER},
  607. </if>
  608. <if test="releaseDate != null">
  609. release_date = #{releaseDate,jdbcType=TIMESTAMP},
  610. </if>
  611. <if test="deletedSign != null">
  612. deleted_sign = #{deletedSign,jdbcType=INTEGER},
  613. </if>
  614. <if test="auditStatus != null">
  615. audit_status = #{auditStatus,jdbcType=INTEGER},
  616. </if>
  617. <if test="techBrokerId != null">
  618. tech_broker_id = #{techBrokerId,jdbcType=VARCHAR},
  619. </if>
  620. <if test="countryNameZh != null">
  621. country_name_zh = #{countryNameZh,jdbcType=VARCHAR},
  622. </if>
  623. <if test="internationalFlag != null">
  624. international_flag = #{internationalFlag,jdbcType=INTEGER},
  625. </if>
  626. <if test="jmrhFlag != null">
  627. jmrh_flag = #{jmrhFlag,jdbcType=INTEGER},
  628. </if>
  629. <if test="boutique != null">
  630. boutique = #{boutique,jdbcType=INTEGER},
  631. </if>
  632. <if test="remark != null">
  633. remark = #{remark,jdbcType=VARCHAR},
  634. </if>
  635. </set>
  636. where id = #{id,jdbcType=VARCHAR}
  637. </update>
  638. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.Achievement">
  639. update achievement
  640. set serial_number = #{serialNumber,jdbcType=INTEGER},
  641. data_category = #{dataCategory,jdbcType=INTEGER},
  642. name = #{name,jdbcType=VARCHAR},
  643. keyword = #{keyword,jdbcType=VARCHAR},
  644. category = #{category,jdbcType=INTEGER},
  645. summary = #{summary,jdbcType=VARCHAR},
  646. introduction = #{introduction,jdbcType=LONGVARCHAR},
  647. technical_picture_url = #{technicalPictureUrl,jdbcType=VARCHAR},
  648. field_a = #{fieldA,jdbcType=INTEGER},
  649. field_b = #{fieldB,jdbcType=INTEGER},
  650. field_c = #{fieldC,jdbcType=INTEGER},
  651. maturity = #{maturity,jdbcType=INTEGER},
  652. maturity_picture_url = #{maturityPictureUrl,jdbcType=LONGVARCHAR},
  653. maturity_text_file_url = #{maturityTextFileUrl,jdbcType=VARCHAR},
  654. maturity_video_url = #{maturityVideoUrl,jdbcType=VARCHAR},
  655. innovation = #{innovation,jdbcType=INTEGER},
  656. owner_id = #{ownerId,jdbcType=VARCHAR},
  657. owner_name = #{ownerName,jdbcType=VARCHAR},
  658. owner_type = #{ownerType,jdbcType=INTEGER},
  659. owner_id_number = #{ownerIdNumber,jdbcType=VARCHAR},
  660. owner_mobile = #{ownerMobile,jdbcType=VARCHAR},
  661. owner_email = #{ownerEmail,jdbcType=VARCHAR},
  662. owner_postal_address = #{ownerPostalAddress,jdbcType=VARCHAR},
  663. cooperation_mode = #{cooperationMode,jdbcType=INTEGER},
  664. transfer_mode = #{transferMode,jdbcType=INTEGER},
  665. bargaining_mode = #{bargainingMode,jdbcType=INTEGER},
  666. transfer_price = #{transferPrice,jdbcType=DECIMAL},
  667. technical_scene = #{technicalScene,jdbcType=VARCHAR},
  668. breakthrough = #{breakthrough,jdbcType=VARCHAR},
  669. patent_case = #{patentCase,jdbcType=VARCHAR},
  670. awards = #{awards,jdbcType=VARCHAR},
  671. team_des = #{teamDes,jdbcType=VARCHAR},
  672. parameter = #{parameter,jdbcType=VARCHAR},
  673. tech_plan_url = #{techPlanUrl,jdbcType=VARCHAR},
  674. business_plan_url = #{businessPlanUrl,jdbcType=VARCHAR},
  675. org_id = #{orgId,jdbcType=VARCHAR},
  676. org_name = #{orgName,jdbcType=VARCHAR},
  677. org_address = #{orgAddress,jdbcType=VARCHAR},
  678. org_email = #{orgEmail,jdbcType=VARCHAR},
  679. org_contacts = #{orgContacts,jdbcType=VARCHAR},
  680. org_contacts_mobile = #{orgContactsMobile,jdbcType=VARCHAR},
  681. contacts = #{contacts,jdbcType=INTEGER},
  682. manager_id = #{managerId,jdbcType=VARCHAR},
  683. salesman_id = #{salesmanId,jdbcType=VARCHAR},
  684. status = #{status,jdbcType=INTEGER},
  685. create_time = #{createTime,jdbcType=TIMESTAMP},
  686. release_status = #{releaseStatus,jdbcType=INTEGER},
  687. release_date = #{releaseDate,jdbcType=TIMESTAMP},
  688. deleted_sign = #{deletedSign,jdbcType=INTEGER},
  689. audit_status = #{auditStatus,jdbcType=INTEGER},
  690. tech_broker_id = #{techBrokerId,jdbcType=VARCHAR},
  691. country_name_zh = #{countryNameZh,jdbcType=VARCHAR},
  692. international_flag = #{internationalFlag,jdbcType=INTEGER},
  693. jmrh_flag = #{jmrhFlag,jdbcType=INTEGER},
  694. boutique = #{boutique,jdbcType=INTEGER}
  695. where id = #{id,jdbcType=VARCHAR}
  696. </update>
  697. <select id="findUserOwnerAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
  698. select
  699. a.id, a.serial_number as serialNumber, a.data_category as dataCategory,
  700. a.name, a.keyword, a.category, a.owner_name as ownerName, a.owner_type as ownerType,
  701. ui.username as username, a.owner_id as ownerId, a.org_id as orgId, a.contacts,
  702. a.release_date as releaseDate, a.audit_status as auditStatus, ad.name as techBrokerId,a.boutique,a.create_time as createTime
  703. <if test="hot != null and hot == 1"><!-- 在首页 -->
  704. ,1 as hot
  705. </if>
  706. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  707. ,0 as hot
  708. </if>
  709. <if test="hot==null"><!-- 无首页参数 -->
  710. ,ifnull(mm.effective,0) as hot
  711. </if>
  712. from achievement a
  713. LEFT JOIN admin ad on ad.id = a.tech_broker_id
  714. LEFT JOIN user_identity ui on a.owner_id = ui.uid
  715. <if test="hot != null and hot == 1"><!-- 在首页 -->
  716. inner join marketing_management mm on a.id = mm.product_id
  717. </if>
  718. <if test="hot == null"> <!-- 无首页参数 -->
  719. left join marketing_management mm on a.id = mm.product_id
  720. </if>
  721. where a.deleted_sign = 0 and a.owner_type = 0
  722. <if test="ownerName != null">
  723. and a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%')
  724. and (a.owner_id is null or a.owner_id = '')
  725. </if>
  726. <if test="username != null">
  727. and ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
  728. </if>
  729. <if test="ownerId != null">
  730. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  731. </if>
  732. <if test="serialNumber != null">
  733. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  734. </if>
  735. <if test="auditStatus != null">
  736. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  737. </if>
  738. <if test="name != null">
  739. and a.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  740. </if>
  741. <if test="keyword != null">
  742. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  743. </if>
  744. <if test="category != null">
  745. and a.category = #{category,jdbcType=INTEGER}
  746. </if>
  747. <if test="status != null">
  748. and a.status = #{status,jdbcType=INTEGER}
  749. </if>
  750. <if test="rStart != null">
  751. and a.release_date <![CDATA[ > ]]> #{rStart,jdbcType=TIMESTAMP}
  752. </if>
  753. <if test="rEnd != null">
  754. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  755. </if>
  756. <if test="cStart != null">
  757. and a.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
  758. </if>
  759. <if test="cEnd != null">
  760. and a.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  761. </if>
  762. <if test="releaseStatus != null">
  763. and a.release_status = #{releaseStatus,jdbcType=INTEGER}
  764. </if>
  765. <if test="techBrokerId != null">
  766. and a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
  767. </if>
  768. <if test="boutique != null">
  769. and a.boutique = #{boutique,jdbcType=INTEGER}
  770. </if>
  771. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  772. and a.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  773. </if>
  774. <if test="hot != null and hot == 1"><!-- 在首页 -->
  775. and mm.effective = 1
  776. </if>
  777. order by a.serial_number desc
  778. <if test="page_sql!=null">
  779. ${page_sql}
  780. </if>
  781. </select>
  782. <select id="findUserOwnerAchievementCount" parameterType="String" resultType="java.lang.Integer">
  783. select
  784. count(1)
  785. from achievement a
  786. <if test="hot != null and hot == 1"><!-- 在首页 -->
  787. inner join marketing_management mm on a.id = mm.product_id
  788. </if>
  789. <if test="hot == null"> <!-- 无首页参数 -->
  790. left join marketing_management mm on a.id = mm.product_id
  791. </if>
  792. where deleted_sign = 0 and owner_type = 0
  793. <if test="ownerName != null">
  794. and a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%')
  795. and (a.owner_id is null or a.owner_id = '')
  796. </if>
  797. <if test="username != null">
  798. and ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
  799. </if>
  800. <if test="ownerId != null">
  801. and owner_id = #{ownerId,jdbcType=VARCHAR}
  802. </if>
  803. <if test="serialNumber != null">
  804. and serial_number = #{serialNumber,jdbcType=INTEGER}
  805. </if>
  806. <if test="auditStatus != null">
  807. and audit_status = #{auditStatus,jdbcType=INTEGER}
  808. </if>
  809. <if test="name != null">
  810. and name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  811. </if>
  812. <if test="keyword != null">
  813. and keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  814. </if>
  815. <if test="category != null">
  816. and category = #{category,jdbcType=INTEGER}
  817. </if>
  818. <if test="status != null">
  819. and status = #{status,jdbcType=INTEGER}
  820. </if>
  821. <if test="rStart != null">
  822. and release_date <![CDATA[ > ]]> #{rStart,jdbcType=TIMESTAMP}
  823. </if>
  824. <if test="rEnd != null">
  825. and release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  826. </if>
  827. <if test="cStart != null">
  828. and a.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
  829. </if>
  830. <if test="cEnd != null">
  831. and a.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  832. </if>
  833. <if test="releaseStatus != null">
  834. and release_status = #{releaseStatus,jdbcType=INTEGER}
  835. </if>
  836. <if test="techBrokerId != null">
  837. and a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
  838. </if>
  839. <if test="boutique != null">
  840. and a.boutique = #{boutique,jdbcType=INTEGER}
  841. </if>
  842. <if test="hot != null and hot = 0"><!-- 不在首页 -->
  843. and a.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  844. </if>
  845. <if test="hot != null and hot = 1"><!-- 在首页 -->
  846. and mm.effective = 1
  847. </if>
  848. </select>
  849. <select id="findOrgOwnerAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
  850. select
  851. a.id, a.serial_number as serialNumber, a.data_category as dataCategory,
  852. a.name, a.keyword, a.category, a.owner_name as ownerName, a.owner_type as ownerType,
  853. <!-- oi.unit_name as username, -->a.owner_id as ownerId, a.org_id as orgId, a.contacts,a.create_time as createTime,
  854. a.release_date as releaseDate, a.audit_status as auditStatus, ad.name as techBrokerId,a.boutique
  855. <if test="hot != null and hot == 1"><!-- 在首页 -->
  856. ,1 as hot
  857. </if>
  858. <if test="hot != null and hot == 0"><!-- 无首页参数 -->
  859. ,0 as hot
  860. </if>
  861. <if test="hot==null"><!-- 在首页 -->
  862. ,ifnull(mm.effective,0) as hot
  863. </if>
  864. from achievement a
  865. LEFT JOIN admin ad on ad.id = a.tech_broker_id
  866. <!-- LEFT JOIN organization_identity oi on a.owner_id = oi.uid -->
  867. <if test="adminId != null">
  868. LEFT JOIN user u on a.owner_id = u.id
  869. </if>
  870. <if test="hot != null and hot == 1"> <!-- 在首页 -->
  871. inner join marketing_management mm on a.id = mm.product_id
  872. </if>
  873. <if test="hot == null"> <!-- 无首页参数 -->
  874. left join marketing_management mm on a.id = mm.product_id
  875. </if>
  876. where a.deleted_sign = 0
  877. <if test="ownerType != null">
  878. and a.owner_type = #{ownerType,jdbcType=VARCHAR}
  879. </if>
  880. <if test="techBrokerId != null">
  881. and a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
  882. </if>
  883. <if test="ownerName != null">
  884. and a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%')
  885. </if>
  886. <!-- <if test="unitName != null">
  887. and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
  888. </if> -->
  889. <if test="ownerId != null">
  890. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  891. </if>
  892. <if test="serialNumber != null">
  893. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  894. </if>
  895. <if test="auditStatus != null">
  896. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  897. </if>
  898. <if test="name != null">
  899. and a.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  900. </if>
  901. <if test="keyword != null">
  902. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  903. </if>
  904. <if test="category != null">
  905. and a.category = #{category,jdbcType=INTEGER}
  906. </if>
  907. <if test="status != null">
  908. and a.status = #{status,jdbcType=INTEGER}
  909. </if>
  910. <if test="rStart != null">
  911. and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  912. </if>
  913. <if test="rEnd != null">
  914. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  915. </if>
  916. <if test="cStart != null">
  917. and a.create_time <![CDATA[ >= ]]> #{cStart,jdbcType=TIMESTAMP}
  918. </if>
  919. <if test="cEnd != null">
  920. and a.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  921. </if>
  922. <if test="releaseStatus != null">
  923. and a.release_status = #{releaseStatus,jdbcType=INTEGER}
  924. </if>
  925. <if test="boutique != null">
  926. and a.boutique = #{boutique,jdbcType=INTEGER}
  927. </if>
  928. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  929. and a.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  930. </if>
  931. <if test="hot != null and hot == 1"><!-- 在首页 -->
  932. and mm.effective = 1
  933. </if>
  934. order by serial_number desc
  935. <if test="page_sql!=null">
  936. ${page_sql}
  937. </if>
  938. </select>
  939. <select id="findOrgOwnerAchievementCount" parameterType="String" resultType="java.lang.Integer">
  940. select
  941. count(1)
  942. from achievement a
  943. LEFT JOIN admin ad on ad.id = a.tech_broker_id
  944. <!-- LEFT JOIN organization_identity oi on a.owner_id = oi.uid -->
  945. <if test="adminId != null">
  946. LEFT JOIN user u on a.owner_id = u.id
  947. </if>
  948. <if test="hot != null and hot == 1"><!-- 在首页 -->
  949. inner join marketing_management mm on a.id = mm.product_id
  950. </if>
  951. <if test="hot == null"> <!-- 无首页参数 -->
  952. left join marketing_management mm on a.id = mm.product_id
  953. </if>
  954. where a.deleted_sign = 0
  955. <if test="ownerType != null">
  956. and a.owner_type = #{ownerType,jdbcType=VARCHAR}
  957. </if>
  958. <if test="techBrokerId != null">
  959. and a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
  960. </if>
  961. <if test="ownerName != null">
  962. and a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%')
  963. </if>
  964. <!-- <if test="unitName != null">
  965. and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
  966. </if> -->
  967. <if test="ownerId != null">
  968. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  969. </if>
  970. <if test="serialNumber != null">
  971. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  972. </if>
  973. <if test="auditStatus != null">
  974. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  975. </if>
  976. <if test="name != null">
  977. and a.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  978. </if>
  979. <if test="keyword != null">
  980. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  981. </if>
  982. <if test="category != null">
  983. and a.category = #{category,jdbcType=INTEGER}
  984. </if>
  985. <if test="status != null">
  986. and a.status = #{status,jdbcType=INTEGER}
  987. </if>
  988. <if test="rStart != null">
  989. and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  990. </if>
  991. <if test="rEnd != null">
  992. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  993. </if>
  994. <if test="cStart != null">
  995. and a.create_time <![CDATA[ >= ]]> #{cStart,jdbcType=TIMESTAMP}
  996. </if>
  997. <if test="cEnd != null">
  998. and a.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  999. </if>
  1000. <if test="releaseStatus != null">
  1001. and a.release_status = #{releaseStatus,jdbcType=INTEGER}
  1002. </if>
  1003. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  1004. and a.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  1005. </if>
  1006. <if test="hot != null and hot == 1"><!-- 在首页 -->
  1007. and mm.effective = 1
  1008. </if>
  1009. </select>
  1010. <update id="updateReleaseDate" parameterType="java.lang.String">
  1011. update achievement set release_date = null
  1012. where id = #{id,jdbcType=VARCHAR}
  1013. </update>
  1014. <update id="batchDeleteByPrimaryKey" parameterType="java.util.List">
  1015. update achievement set deleted_sign = 1
  1016. where id in
  1017. <foreach item="item" collection="list" open="(" separator="," close=")">
  1018. #{item}
  1019. </foreach>
  1020. </update>
  1021. <select id="findAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
  1022. select
  1023. a.id, a.serial_number as serialNumber, a.data_category as dataCategory, a.boutique,
  1024. a.name, a.keyword, a.category, a.introduction,owner_postal_address as ownerPostalAddress,
  1025. a.owner_name as ownerName, a.owner_type as ownerType, a.owner_mobile as ownerMobile,a.field_a as fieldA,a.field_b ,a.field_c as fieldC,
  1026. a.status, a.release_date as releaseDate, a.audit_status as auditStatus,f.name as field,f2.name as fieldB,ifnull(b.countInterest,0) as countInterest
  1027. from achievement a
  1028. left join (
  1029. select count(0) as countInterest,achievement_id from achievement_interest group by achievement_id
  1030. )b on a.id = b.achievement_id
  1031. left join field_glossory f on a.field_a=f.id
  1032. left join field_glossory f2 on a.field_b=f2.id
  1033. where deleted_sign = 0
  1034. <if test="ownerId != null">
  1035. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1036. </if>
  1037. <if test="serialNumber != null">
  1038. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  1039. </if>
  1040. <if test="auditStatus != null">
  1041. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  1042. </if>
  1043. <if test="name != null">
  1044. and a.name = #{name,jdbcType=VARCHAR}
  1045. </if>
  1046. <if test="keyword != null">
  1047. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1048. </if>
  1049. <if test="dataCategory != null and dataCategory != ''">
  1050. and a.data_category = #{dataCategory,jdbcType=INTEGER}
  1051. </if>
  1052. <if test="category != null">
  1053. and a.category = #{category,jdbcType=INTEGER}
  1054. </if>
  1055. <if test="ownerType != null">
  1056. and a.owner_type = #{ownerType,jdbcType=INTEGER}
  1057. </if>
  1058. <if test="fieldA != null">
  1059. and a.field_a = #{fieldA,jdbcType=VARCHAR}
  1060. </if>
  1061. <if test="status != null">
  1062. and a.status = #{status,jdbcType=INTEGER}
  1063. </if>
  1064. <if test="rStart != null">
  1065. and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  1066. </if>
  1067. <if test="rEnd != null">
  1068. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  1069. </if>
  1070. <if test="releaseStatus != null">
  1071. and a.release_status = #{releaseStatus,jdbcType=INTEGER}
  1072. </if>
  1073. order by serial_number desc
  1074. <if test="page_sql!=null">
  1075. ${page_sql}
  1076. </if>
  1077. </select>
  1078. <select id="findAchievementCount" parameterType="String" resultType="java.lang.Integer">
  1079. select
  1080. count(1)
  1081. from achievement a
  1082. left join field_glossory f on a.field_a=f.id
  1083. left join field_glossory f2 on a.field_b=f2.id
  1084. where deleted_sign = 0
  1085. <if test="ownerId != null">
  1086. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1087. </if>
  1088. <if test="serialNumber != null">
  1089. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  1090. </if>
  1091. <if test="auditStatus != null">
  1092. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  1093. </if>
  1094. <if test="name != null">
  1095. and a.name = #{name,jdbcType=VARCHAR}
  1096. </if>
  1097. </select>
  1098. <select id="findAppAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
  1099. select
  1100. a.id, a.serial_number as serialNumber, a.data_category as dataCategory, a.boutique,
  1101. a.name, a.keyword, a.category, a.introduction,owner_postal_address as ownerPostalAddress,
  1102. a.owner_name as ownerName, a.owner_type as ownerType, a.owner_mobile as ownerMobile,a.field_a as fieldA,a.field_b ,a.field_c as fieldC,
  1103. a.status, a.release_date as releaseDate, a.audit_status as auditStatus,f.name as field,f2.name as fieldB,ifnull(b.countInterest,0) as countInterest
  1104. from achievement a
  1105. left join (
  1106. select count(0) as countInterest,achievement_id from achievement_interest group by achievement_id
  1107. )b on a.id = b.achievement_id
  1108. left join field_glossory f on a.field_a=f.id
  1109. left join field_glossory f2 on a.field_b=f2.id
  1110. where deleted_sign = 0
  1111. and audit_status = 3
  1112. <if test="ownerId != null">
  1113. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1114. </if>
  1115. <if test="serialNumber != null">
  1116. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  1117. </if>
  1118. <if test="auditStatus != null">
  1119. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  1120. </if>
  1121. <if test="name != null">
  1122. and a.name = #{name,jdbcType=VARCHAR}
  1123. </if>
  1124. <if test="keyword != null">
  1125. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1126. </if>
  1127. <if test="dataCategory != null and dataCategory != ''">
  1128. and a.data_category = #{dataCategory,jdbcType=INTEGER}
  1129. </if>
  1130. <if test="category != null">
  1131. and a.category = #{category,jdbcType=INTEGER}
  1132. </if>
  1133. <if test="ownerType != null">
  1134. and a.owner_type = #{ownerType,jdbcType=INTEGER}
  1135. </if>
  1136. <if test="fieldA != null">
  1137. and a.field_a = #{fieldA,jdbcType=VARCHAR}
  1138. </if>
  1139. <if test="status != null">
  1140. and a.status = #{status,jdbcType=INTEGER}
  1141. </if>
  1142. <if test="rStart != null">
  1143. and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  1144. </if>
  1145. <if test="rEnd != null">
  1146. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  1147. </if>
  1148. <if test="releaseStatus != null">
  1149. and a.release_status = #{releaseStatus,jdbcType=INTEGER}
  1150. </if>
  1151. order by a.boutique desc
  1152. <if test="page_sql!=null">
  1153. ${page_sql}
  1154. </if>
  1155. </select>
  1156. <select id="findAppAchievementCount" parameterType="String" resultType="java.lang.Integer">
  1157. select
  1158. count(1)
  1159. from achievement a
  1160. left join field_glossory f on a.field_a=f.id
  1161. left join field_glossory f2 on a.field_b=f2.id
  1162. where deleted_sign = 0
  1163. and audit_status = 3
  1164. <if test="ownerId != null">
  1165. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1166. </if>
  1167. <if test="serialNumber != null">
  1168. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  1169. </if>
  1170. <if test="auditStatus != null">
  1171. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  1172. </if>
  1173. <if test="name != null">
  1174. and a.name = #{name,jdbcType=VARCHAR}
  1175. </if>
  1176. <if test="keyword != null">
  1177. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1178. </if>
  1179. <if test="dataCategory != null and dataCategory != ''">
  1180. and a.data_category = #{dataCategory,jdbcType=INTEGER}
  1181. </if>
  1182. <if test="category != null">
  1183. and a.category = #{category,jdbcType=INTEGER}
  1184. </if>
  1185. <if test="ownerType != null">
  1186. and a.owner_type = #{ownerType,jdbcType=INTEGER}
  1187. </if>
  1188. <if test="fieldA != null">
  1189. and a.field_a = #{fieldA,jdbcType=VARCHAR}
  1190. </if>
  1191. <if test="status != null">
  1192. and a.status = #{status,jdbcType=INTEGER}
  1193. </if>
  1194. <if test="rStart != null">
  1195. and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  1196. </if>
  1197. <if test="rEnd != null">
  1198. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  1199. </if>
  1200. <if test="releaseStatus != null">
  1201. and a.release_status = #{releaseStatus,jdbcType=INTEGER}
  1202. </if>
  1203. </select>
  1204. <select id="selectUserOwnerDetail" parameterType="java.lang.String" resultType="com.goafanti.achievement.bo.AchievementUserOwnerDetailBo">
  1205. select
  1206. a.id, a.serial_number as serialNumber, a.data_category as dataCategory,
  1207. a.name, a.keyword, a.category,
  1208. a.summary, a.introduction, a.technical_picture_url as technicalPictureUrl,
  1209. a.field_a as fieldA, a.field_b as fieldB, a.field_c as fieldC,
  1210. a.maturity, a.maturity_picture_url as maturityPictureUrl, a.maturity_text_file_url as maturityTextFileUrl,
  1211. a.maturity_video_url as maturityVideoUrl, a.innovation, a.owner_id as ownerId,
  1212. a.owner_name as ownerName, a.owner_type as ownerType, a.owner_id_number as ownerIdNumber,
  1213. a.owner_mobile as ownerMobile, a.owner_email as ownerEmail, a.owner_postal_address as ownerPostalAddress,
  1214. a.cooperation_mode as cooperationMode, a.transfer_mode as transferMode, a.bargaining_mode as bargainingMode,
  1215. a.transfer_price as transferPrice, a.technical_scene as technicalScene, a.breakthrough,
  1216. a.patent_case as patentCase, a.awards, a.team_des as teamDes,
  1217. a.parameter, a.tech_plan_url as techPlanUrl, a.business_plan_url as businessPlanUrl,
  1218. a.contacts, a.manager_id as managerId, a.salesman_id as salesmanId,
  1219. a.create_time as createTime, a.release_status as releaseStatus,
  1220. a.release_date as releaseDate, a.audit_status as auditStatus, a.tech_broker_id as techBrokerId,
  1221. ui.username as iOwnerName, ui.province, ui.city, ui.area, u.email as iOwnerEmail,
  1222. ui.id_number as iOwnerIdNumber, u.mobile as iOwnerMobile,j.easemob_name as easemobName,
  1223. ifnull(t.x,0) as orderIntentionCount ,ifnull(t2.x,0) as orderCount
  1224. from achievement a
  1225. left join user_identity ui on a.owner_id = ui.uid
  1226. left join (select count(0) as x,tl.commodity_id from t_order tr
  1227. left join t_order_detail tl on tl.order_no=tr.order_no
  1228. where order_status != 4
  1229. group by tl.commodity_id ) t on a.id=t.commodity_id
  1230. left join (select count(0) as x,tl.commodity_id from t_order tr
  1231. left join t_order_detail tl on tl.order_no=tr.order_no
  1232. where tr.order_status != 4 and tr.order_status != 0
  1233. group by tl.commodity_id) t2 on a.id=t2.commodity_id
  1234. left join jpush_easemob_account j on a.owner_id=j.uid
  1235. left join user u on u.id = a.owner_id
  1236. where a.id =#{id,jdbcType=VARCHAR}
  1237. </select>
  1238. <select id="selectOrgOwnerDetail" parameterType="java.lang.String" resultType="com.goafanti.achievement.bo.AchievementOrgOwnerDetailBo">
  1239. select
  1240. a.id, a.serial_number as serialNumber, a.data_category as dataCategory,
  1241. a.name, a.keyword, a.category,
  1242. a.summary, a.introduction, a.technical_picture_url as technicalPictureUrl,
  1243. a.field_a as fieldA, a.field_b as fieldB, a.field_c as fieldC,
  1244. a.maturity, a.maturity_picture_url as maturityPictureUrl, a.maturity_text_file_url as maturityTextFileUrl,
  1245. a.maturity_video_url as maturityVideoUrl, a.innovation, a.owner_id as ownerId,
  1246. a.owner_name as ownerName, a.owner_type as ownerType, a.owner_id_number as ownerIdNumber,
  1247. a.owner_mobile as ownerMobile, a.owner_email as ownerEmail, a.owner_postal_address as ownerPostalAddress,
  1248. a.cooperation_mode as cooperationMode, a.transfer_mode as transferMode, a.bargaining_mode as bargainingMode,
  1249. a.transfer_price as transferPrice, a.technical_scene as technicalScene, a.breakthrough,
  1250. a.patent_case as patentCase, a.awards, a.team_des as teamDes,
  1251. a.parameter, a.tech_plan_url as techPlanUrl, a.business_plan_url as businessPlanUrl,
  1252. a.contacts, a.manager_id as managerId, a.salesman_id as salesmanId, a.international_flag as internationalFlag,
  1253. a.create_time as createTime, a.release_status as releaseStatus,
  1254. a.release_date as releaseDate, a.audit_status as auditStatus, a.tech_broker_id as techBrokerId,
  1255. oi.unit_name as iOwnerName, oi.postal_address as iOwnerPostalAddress, u.email as iOwnerEmail,
  1256. oi.org_code as iOwnerIdNumber, u.mobile as iOwnerMobile,a.boutique,ifnull(mm.effective,0) hot,mm.cover_img as coverImg,a.remark
  1257. from achievement a
  1258. left join organization_identity oi on a.owner_id = oi.uid
  1259. left join user u on u.id = a.owner_id
  1260. left join marketing_management mm on a.id = mm.product_id
  1261. where a.id = #{id,jdbcType=VARCHAR}
  1262. </select>
  1263. <insert id="insertBatch" parameterType="com.goafanti.common.model.Achievement">
  1264. insert into achievement
  1265. (id, deleted_sign, audit_status,
  1266. create_time, release_status, data_category,
  1267. name, keyword, category,
  1268. owner_name, owner_type, owner_id_number,
  1269. owner_mobile, owner_email, owner_postal_address,
  1270. cooperation_mode, introduction, tech_broker_id,international_flag
  1271. )
  1272. values
  1273. <foreach item="item" index="index" collection="list" separator=",">
  1274. (
  1275. #{item.id,jdbcType=VARCHAR}, #{item.deletedSign,jdbcType=INTEGER}, #{item.auditStatus,jdbcType=INTEGER},
  1276. #{item.createTime,jdbcType=TIMESTAMP}, #{item.releaseStatus,jdbcType=INTEGER}, #{item.dataCategory,jdbcType=INTEGER},
  1277. #{item.name,jdbcType=VARCHAR}, #{item.keyword,jdbcType=VARCHAR}, #{item.category,jdbcType=INTEGER},
  1278. #{item.ownerName,jdbcType=VARCHAR}, #{item.ownerType,jdbcType=VARCHAR}, #{item.ownerIdNumber,jdbcType=VARCHAR},
  1279. #{item.ownerMobile,jdbcType=VARCHAR}, #{item.ownerEmail,jdbcType=VARCHAR}, #{item.ownerPostalAddress,jdbcType=VARCHAR},
  1280. #{item.cooperationMode,jdbcType=INTEGER}, #{item.introduction,jdbcType=LONGVARCHAR},#{item.techBrokerId,jdbcType=VARCHAR},
  1281. #{item.internationalFlag,jdbcType=INTEGER}
  1282. )
  1283. </foreach>
  1284. </insert>
  1285. <select id="findSearchAchievementListByPage" parameterType="String" resultType="com.goafanti.portal.bo.AchievementSearchListBo">
  1286. select
  1287. a.id, a.name, a.keyword,a.introduction,a.category,
  1288. a.serial_number as serialNumber,
  1289. a.data_category as dataCategory,
  1290. a.owner_type as ownerType,
  1291. a.owner_name as ownerName,
  1292. a.field_a as fieldA,
  1293. a.field_b as fieldB,
  1294. a.transfer_price as transferPrice,
  1295. a.maturity,
  1296. a.introduction,a.boutique,
  1297. a.transfer_mode as transferMode,
  1298. a.technical_picture_url as technicalPictureUrl,
  1299. b.name as fieldAs
  1300. from achievement a
  1301. left join field_glossory b on a.field_a = b.id
  1302. where a.deleted_sign = 0
  1303. <if test="dataCategory != null and dataCategory != ''">
  1304. and a.data_category = #{dataCategory,jdbcType=INTEGER}
  1305. </if>
  1306. <if test="category != null and category != ''">
  1307. and a.category = #{category,jdbcType=INTEGER}
  1308. </if>
  1309. <if test="fieldA != null and fieldA != ''">
  1310. and a.field_a = #{fieldA,jdbcType=INTEGER}
  1311. </if>
  1312. <if test="keyword != null and keyword != ''">
  1313. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1314. </if>
  1315. <if test="transferMode != null">
  1316. and a.transfer_mode = #{transferMode,jdbcType=INTEGER}
  1317. </if>
  1318. <if test="upperPrice != null and upperPrice != ''">
  1319. and a.transfer_price &lt; #{upperPrice,jdbcType=VARCHAR}
  1320. </if>
  1321. <if test="lowerPrice != null and lowerPrice != ''">
  1322. and a.transfer_price &gt; #{lowerPrice,jdbcType=VARCHAR}
  1323. </if>
  1324. <if test="internationalFlag != null ">
  1325. and a.international_flag = #{internationalFlag,jdbcType=INTEGER}
  1326. </if>
  1327. and a.release_status = 1
  1328. and a.audit_status = 3
  1329. <if test="dateSort == 0">
  1330. order by a.release_date asc
  1331. </if>
  1332. <if test="dateSort == 1">
  1333. order by a.release_date desc
  1334. </if>
  1335. <if test="page_sql != null">
  1336. ${page_sql}
  1337. </if>
  1338. </select>
  1339. <select id="findSearchAchievementCount" parameterType="String" resultType="java.lang.Integer">
  1340. select
  1341. count(1)
  1342. from achievement a
  1343. where a.deleted_sign = 0
  1344. <if test="dataCategory != null and dataCategory != ''">
  1345. and a.data_category = #{dataCategory,jdbcType=INTEGER}
  1346. </if>
  1347. <if test="category != null and category != ''">
  1348. and a.category = #{category,jdbcType=INTEGER}
  1349. </if>
  1350. <if test="fieldA != null and fieldA != ''">
  1351. and a.field_a = #{fieldA,jdbcType=INTEGER}
  1352. </if>
  1353. <if test="keyword != null and keyword != ''">
  1354. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1355. </if>
  1356. <if test="transferMode != null">
  1357. and a.transfer_mode = #{transferMode,jdbcType=INTEGER}
  1358. </if>
  1359. <if test="upperPrice != null and upperPrice != ''">
  1360. and a.transfer_price &lt; #{upperPrice,jdbcType=VARCHAR}
  1361. </if>
  1362. <if test="lowerPrice != null and lowerPrice != ''">
  1363. and a.transfer_price &gt; #{lowerPrice,jdbcType=VARCHAR}
  1364. </if>
  1365. <if test="internationalFlag != null ">
  1366. and a.international_flag = #{internationalFlag,jdbcType=INTEGER}
  1367. </if>
  1368. and a.release_status = 1
  1369. and a.audit_status = 3
  1370. <if test="dateSort == 0">
  1371. order by a.release_date asc
  1372. </if>
  1373. <if test="dateSort == 1">
  1374. order by a.release_date desc
  1375. </if>
  1376. </select>
  1377. <select id="selectAchievementSearchDetail" resultType="com.goafanti.portal.bo.AchievementDetailBo">
  1378. select
  1379. a.id,
  1380. a.owner_name as ownerName,
  1381. a.serial_number as serialNumber,
  1382. a.keyword,
  1383. a.name,
  1384. a.data_category as dataCategory,
  1385. a.category,
  1386. ui.username,
  1387. oi.unit_name as unitName,
  1388. a.release_date as releaseDate,
  1389. a.owner_type as ownerType,
  1390. a.field_a as fieldA,
  1391. a.field_b as fieldB,
  1392. a.transfer_price as transferPrice,
  1393. a.maturity,
  1394. a.transfer_mode as transferMode,
  1395. a.bargaining_mode as bargainingMode,
  1396. a.summary,
  1397. a.introduction,
  1398. a.technical_picture_url as technicalPictureUrl,
  1399. a.maturity_picture_url as maturityPictureUrl,
  1400. a.maturity_text_file_url as maturityTextFileUrl,
  1401. a.maturity_video_url as maturityVideoUrl,
  1402. a.innovation,
  1403. a.cooperation_mode as cooperationMode,
  1404. a.bargaining_mode as bargainingMode,
  1405. a.technical_scene as technicalScene,
  1406. a.breakthrough,
  1407. a.patent_case as patentCase,
  1408. a.awards,
  1409. a.team_des as teamDes,
  1410. a.parameter,
  1411. a.tech_plan_url as techPlanUrl,
  1412. a.business_plan_url as businessPlanUrl,
  1413. ai.id as achievementInterestId,
  1414. ao.id as achievementOrderId,
  1415. ao.status as orderStatus
  1416. from achievement a
  1417. left join user_identity ui on ui.uid = a.owner_id
  1418. left join organization_identity oi on oi.uid = a.owner_id
  1419. left join achievement_interest ai on ai.achievement_id = a.id and ai.uid = #{0}
  1420. left join achievement_order ao on ao.achievement_id = a.id and ao.uid = #{0} and ao.status <![CDATA[ <> ]]> 6
  1421. where a.id = #{1}
  1422. </select>
  1423. <select id="findAchievementNumByUid" parameterType="java.lang.String" resultType="java.lang.Integer">
  1424. select
  1425. count(1)
  1426. from achievement
  1427. where
  1428. deleted_sign = 0
  1429. and release_status = 1
  1430. and audit_status = 3
  1431. and owner_id = #{uid,jdbcType=VARCHAR}
  1432. </select>
  1433. <select id="findPartnerAchievementListByPage" parameterType="java.lang.String" resultType="com.goafanti.achievement.bo.AchievementPartnerListBo">
  1434. SELECT
  1435. id,
  1436. serial_number AS serialNumber,
  1437. data_category AS dataCategory,
  1438. NAME,
  1439. keyword,
  1440. category,
  1441. owner_type as ownerType,
  1442. release_date AS releaseDate,
  1443. field_a as fieldA,
  1444. maturity,
  1445. introduction,
  1446. technical_picture_url as technicalPictureUrl,
  1447. bargaining_mode as bargainingMode,
  1448. transfer_price as transferPrice
  1449. FROM
  1450. achievement
  1451. WHERE
  1452. audit_status = 3
  1453. AND release_status = 1
  1454. AND deleted_sign = 0
  1455. AND owner_id = #{ownerId,jdbcType=VARCHAR}
  1456. </select>
  1457. <select id="findPartnerAchievementCount" parameterType="java.lang.String" resultType="java.lang.Integer">
  1458. SELECT
  1459. count(1)
  1460. FROM
  1461. achievement
  1462. WHERE
  1463. audit_status = 3
  1464. AND release_status = 1
  1465. AND deleted_sign = 0
  1466. AND owner_id = #{ownerId,jdbcType=VARCHAR}
  1467. </select>
  1468. <select id="findUserPortalAchievementDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.AchievementPortalDetailBo">
  1469. SELECT
  1470. a.id,
  1471. a.name,
  1472. a.keyword,
  1473. a.category,
  1474. a.introduction,
  1475. a.maturity,
  1476. a.transfer_price AS transferPrice,
  1477. a.patent_case AS patentCase,
  1478. a.field_a as fieldA,
  1479. fg.name AS fieldAS,
  1480. fgg.name AS fieldBS,
  1481. a.release_date AS releaseDate,
  1482. dg.name as province,
  1483. dgg.name as city,
  1484. a.technical_picture_url AS technicalPictureUrl,
  1485. a.transfer_mode as transferMode,
  1486. interest.id as interestId,
  1487. u.lvl as level,
  1488. a.owner_name as ownerName,
  1489. a.owner_mobile as ownerMobile,
  1490. a.bargaining_mode as bargainingMode,
  1491. ui.city as location
  1492. FROM
  1493. achievement a
  1494. LEFT JOIN <![CDATA[ user ]]> u on u.id = a.owner_id
  1495. LEFT JOIN user_identity ui on ui.uid = a.owner_id
  1496. LEFT JOIN district_glossory dg on dg.id = ui.province
  1497. LEFT JOIN district_glossory dgg on dgg.id = ui.city
  1498. LEFT JOIN field_glossory fg on fg.id = a.field_a
  1499. LEFT JOIN field_glossory fgg on fgg.id = a.field_b
  1500. LEFT JOIN achievement_interest interest on interest.achievement_id = a.id and interest.uid = #{uid,jdbcType=VARCHAR}
  1501. WHERE
  1502. a.id = #{id,jdbcType=VARCHAR}
  1503. </select>
  1504. <select id="findOrgPortalAchievementDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.AchievementPortalDetailBo">
  1505. SELECT
  1506. a.id,
  1507. a.name,
  1508. a.keyword,
  1509. a.category,
  1510. a.introduction,
  1511. a.maturity,
  1512. a.transfer_price AS transferPrice,
  1513. a.patent_case AS patentCase,
  1514. a.field_a as fieldA,
  1515. fg.name AS fieldAS,
  1516. fgg.name AS fieldBS,
  1517. a.release_date AS releaseDate,
  1518. dg.name as province,
  1519. dgg.name as city,
  1520. a.technical_picture_url AS technicalPictureUrl,
  1521. a.transfer_mode as transferMode,
  1522. interest.id as interestId,
  1523. u.lvl as level,
  1524. a.owner_name as ownerName,
  1525. a.bargaining_mode as bargainingMode
  1526. FROM
  1527. achievement a
  1528. LEFT JOIN <![CDATA[ user ]]> u on u.id = a.owner_id
  1529. LEFT JOIN organization_identity oi on oi.uid = a.owner_id
  1530. LEFT JOIN district_glossory dg on dg.id = oi.licence_province
  1531. LEFT JOIN district_glossory dgg on dgg.id = oi.licence_city
  1532. LEFT JOIN field_glossory fg on fg.id = a.field_a
  1533. LEFT JOIN field_glossory fgg on fgg.id = a.field_b
  1534. LEFT JOIN achievement_interest interest on interest.achievement_id = a.id and interest.uid = #{uid,jdbcType=VARCHAR}
  1535. WHERE
  1536. a.id = #{id,jdbcType=VARCHAR}
  1537. </select>
  1538. <select id="findUserPortalSimilarByFieldA" resultType="com.goafanti.portal.bo.AchievementPortalSimilarListBo">
  1539. SELECT
  1540. a.id,
  1541. a.name,
  1542. a.maturity,
  1543. dg.name as uprovince,
  1544. dgg.name as ucity,
  1545. dggg.name as oprovince,
  1546. dgggg.name as ocity,
  1547. a.transfer_price as transferPrice,
  1548. a.bargaining_mode as bargainingMode
  1549. FROM
  1550. achievement a
  1551. LEFT JOIN user_identity ui ON ui.uid = a.owner_id
  1552. LEFT JOIN organization_identity oi on oi.uid = a.owner_id
  1553. LEFT JOIN district_glossory dg on dg.id = ui.province
  1554. LEFT JOIN district_glossory dgg on dgg.id = ui.city
  1555. LEFT JOIN district_glossory dggg on dggg.id = oi.licence_province
  1556. LEFT JOIN district_glossory dgggg on dgggg.id = oi.licence_city
  1557. WHERE
  1558. a.audit_status = 3
  1559. AND a.deleted_sign = 0
  1560. AND a.release_status = 1
  1561. AND a.field_a = #{fieldA,jdbcType=INTEGER}
  1562. AND a.id <![CDATA[ <> ]]> #{id,jdbcType=VARCHAR}
  1563. order by a.serial_number desc
  1564. limit 5
  1565. </select>
  1566. <select id="findOrgPortalSimilarByFieldA" resultType="com.goafanti.portal.bo.AchievementPortalSimilarListBo">
  1567. SELECT
  1568. a.id,
  1569. a.name,
  1570. a.maturity,
  1571. dg.name as oprovince,
  1572. dgg.name as ocity,
  1573. dggg.name as uprovince,
  1574. dgggg.name as ucity,
  1575. a.transfer_price as transferPrice,
  1576. a.bargaining_mode as bargainingMode
  1577. FROM
  1578. achievement a
  1579. LEFT JOIN organization_identity oi ON oi.uid = a.owner_id
  1580. LEFT JOIN user_identity ui ON ui.uid = a.owner_id
  1581. LEFT JOIN district_glossory dg on dg.id = oi.licence_province
  1582. LEFT JOIN district_glossory dgg on dgg.id = oi.licence_city
  1583. LEFT JOIN district_glossory dggg on dggg.id = ui.province
  1584. LEFT JOIN district_glossory dgggg on dgggg.id = ui.city
  1585. WHERE
  1586. a.audit_status = 3
  1587. AND a.deleted_sign = 0
  1588. AND a.release_status = 1
  1589. AND a.field_a = #{fieldA,jdbcType=INTEGER}
  1590. AND a.id <![CDATA[ <> ]]> #{id,jdbcType=VARCHAR}
  1591. order by a.serial_number desc
  1592. limit 5
  1593. </select>
  1594. <update id="updateOwnerId" parameterType="java.lang.String" >
  1595. update achievement
  1596. set owner_id = null
  1597. where id = #{id,jdbcType=VARCHAR}
  1598. </update>
  1599. <select id="selectInternationalAchievement" resultType="com.goafanti.portal.bo.InternationalListBo">
  1600. select
  1601. a.id as id,
  1602. a.name as techName,
  1603. a.introduction,
  1604. a.owner_name as ownerName,
  1605. a.owner_type as ownerType,
  1606. a.technical_picture_url as technicalPictureUrl,
  1607. a.country_name_zh as countryNameZh
  1608. from
  1609. achievement a
  1610. where
  1611. a.deleted_sign = 0 and a.data_category = 1
  1612. <!-- and a.release_status = 1 and nternational_flag = 1 -->
  1613. order by
  1614. a.release_date desc
  1615. limit 0,5
  1616. </select>
  1617. <select id="findBoutiqueListByPage" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.BoutiqueListBo">
  1618. select
  1619. a.id ,
  1620. a.name,
  1621. a.transfer_price as price,
  1622. a.summary as sketch,
  1623. a.technical_picture_url as pictureUrl,
  1624. a.owner_type as ownerType,
  1625. b.name as industryCatalog,
  1626. a.owner_name as personName
  1627. from
  1628. achievement a
  1629. left join
  1630. field_glossory b
  1631. on
  1632. a.field_a = b.id
  1633. where
  1634. a.boutique = 1 and a.audit_status = 3 and a.deleted_sign=0
  1635. <if test="fieldA != null and fieldA != ''">
  1636. and a.field_a = #{fieldA,jdbcType=INTEGER}
  1637. </if>
  1638. <if test="dataCategory != null and dataCategory != ''">
  1639. and data_category = #{dataCategory,jdbcType=INTEGER}
  1640. </if>
  1641. <if test="category != null and category != ''">
  1642. and category = #{category,jdbcType=INTEGER}
  1643. </if>
  1644. order by a.create_time desc
  1645. <if test="page_sql!=null">
  1646. ${page_sql}
  1647. </if>
  1648. </select>
  1649. <select id="findBoutiqueCount" parameterType="java.lang.String" resultType="java.lang.Integer">
  1650. select
  1651. count(0)
  1652. from
  1653. achievement a
  1654. left join
  1655. field_glossory b
  1656. on
  1657. a.field_a = b.id
  1658. where
  1659. a.boutique = 1 and a.audit_status = 3 and a.deleted_sign=0
  1660. <if test="fieldA != null and fieldA != ''">
  1661. and a.field_a = #{fieldA,jdbcType=INTEGER}
  1662. </if>
  1663. <if test="dataCategory != null and dataCategory != ''">
  1664. and data_category = #{dataCategory,jdbcType=INTEGER}
  1665. </if>
  1666. <if test="category != null and category != ''">
  1667. and category = #{category,jdbcType=INTEGER}
  1668. </if>
  1669. </select>
  1670. <select id="listAchievement" resultType="com.goafanti.achievement.bo.AchievementListBo">
  1671. select
  1672. a.id, a.name, a.keyword,a.introduction,a.category,
  1673. a.serial_number as serialNumber,
  1674. a.data_category as dataCategory,
  1675. a.owner_type as ownerType,
  1676. a.owner_name as ownerName,
  1677. a.field_a as fieldA,
  1678. a.transfer_price as transferPrice,
  1679. a.transfer_mode as transfermode,
  1680. a.maturity,
  1681. a.technical_picture_url as technicalpictureurl
  1682. from achievement a
  1683. where
  1684. a.deleted_sign = 0
  1685. and a.category = 0
  1686. and a.release_status = 1
  1687. and a.audit_status = 3
  1688. order by a.release_date desc limit 0,12
  1689. </select>
  1690. <!-- 查询猜你喜欢 -->
  1691. <select id="selectCsutomerLike" resultType="com.goafanti.achievement.bo.AchievementListBo">
  1692. select
  1693. a.id, a.name, a.keyword,a.introduction,a.category,
  1694. a.serial_number as serialNumber,
  1695. a.data_category as dataCategory,
  1696. a.owner_type as ownerType,
  1697. a.owner_name as ownerName,
  1698. a.field_a as fieldA,
  1699. a.field_b as fieldB,
  1700. a.transfer_price as transferPrice,
  1701. a.technical_picture_url as technicalpictureurl
  1702. from achievement a
  1703. LEFT JOIN aft.achievement_interest b on a.id = b.achievement_id
  1704. where
  1705. a.deleted_sign = 0
  1706. and category = 0
  1707. and a.release_status = 1
  1708. and a.audit_status = 3
  1709. <if test="boutique != null">
  1710. and a.boutique= #{boutique,jdbcType=INTEGER}
  1711. </if>
  1712. order by a.release_date desc limit 0,4
  1713. </select>
  1714. <select id="countInterest" resultType="Integer">
  1715. select count(0)
  1716. from achievement_interest
  1717. where achievement_id=#{achievementId,jdbcType=VARCHAR}
  1718. </select>
  1719. <select id="achievementInterest" resultType="com.goafanti.achievement.bo.AchievementInterestBo">
  1720. select
  1721. a.id,a.name,a.create_time as createTime
  1722. from achievement_interest ai
  1723. LEFT join achievement a on ai.achievement_id=a.id
  1724. where uid=#{uid,jdbcType=VARCHAR}
  1725. </select>
  1726. <select id="findMyAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
  1727. select
  1728. a.id, a.boutique,a.name,a.category, a.audit_status as auditStatus,ifnull(t.x,0) as buyIntention,
  1729. a.release_date as releaseDate,ifnull(i.y,0) as countInterest
  1730. from achievement a
  1731. left join (select count(0) as x,commodity_id from t_order
  1732. where order_status != 4
  1733. group by commodity_id ) t on a.id=t.commodity_id
  1734. left join (select count(0) as y,achievement_id from achievement_interest
  1735. group by achievement_id ) i on a.id=i.achievement_id
  1736. where a.deleted_sign = 0
  1737. <if test="ownerId != null">
  1738. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1739. </if>
  1740. <if test="page_sql!=null">
  1741. ${page_sql}
  1742. </if>
  1743. </select>
  1744. <select id="findMyAchievementCount" parameterType="String" resultType="java.lang.Integer">
  1745. select
  1746. count(1)
  1747. from achievement a
  1748. where a.deleted_sign = 0
  1749. <if test="ownerId != null">
  1750. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1751. </if>
  1752. </select>
  1753. </mapper>