AchievementMapper.xml 54 KB

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