AchievementMapper.xml 54 KB

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