AchievementMapper.xml 80 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224
  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, maturity_picture_url, maturity_text_file_url,
  90. maturity_video_url, innovation, owner_id, owner_name,
  91. owner_type, owner_id_number, owner_mobile,
  92. owner_email, owner_postal_address, cooperation_mode,
  93. transfer_mode, bargaining_mode, transfer_price,
  94. technical_scene, breakthrough, patent_case,
  95. awards, team_des, parameter,
  96. tech_plan_url, business_plan_url, org_id,
  97. org_name, org_address, org_email,
  98. org_contacts, org_contacts_mobile,
  99. manager_id, salesman_id, status,
  100. create_time, release_status, release_date,
  101. deleted_sign, audit_status, tech_broker_id,
  102. country_name_zh,international_flag,jmrh_flag,boutique,remark,contacts,contact_mobile )
  103. values (#{id,jdbcType=VARCHAR}, #{serialNumber,jdbcType=INTEGER}, #{dataCategory,jdbcType=INTEGER},
  104. #{name,jdbcType=VARCHAR}, #{keyword,jdbcType=VARCHAR}, #{category,jdbcType=INTEGER},
  105. #{summary,jdbcType=VARCHAR}, #{introduction,jdbcType=LONGVARCHAR}, #{technicalPictureUrl,jdbcType=VARCHAR},
  106. #{fieldA,jdbcType=INTEGER}, #{fieldB,jdbcType=INTEGER}, #{fieldC,jdbcType=INTEGER},
  107. #{maturity,jdbcType=INTEGER}, #{maturityPictureUrl,jdbcType=LONGVARCHAR}, #{maturityTextFileUrl,jdbcType=VARCHAR},
  108. #{maturityVideoUrl,jdbcType=VARCHAR}, #{innovation,jdbcType=INTEGER}, #{ownerId,jdbcType=VARCHAR}, #{ownerName,jdbcType=VARCHAR},
  109. #{ownerType,jdbcType=INTEGER}, #{ownerIdNumber,jdbcType=VARCHAR}, #{ownerMobile,jdbcType=VARCHAR},
  110. #{ownerEmail,jdbcType=VARCHAR}, #{ownerPostalAddress,jdbcType=VARCHAR}, #{cooperationMode,jdbcType=INTEGER},
  111. #{transferMode,jdbcType=INTEGER}, #{bargainingMode,jdbcType=INTEGER}, #{transferPrice,jdbcType=DECIMAL},
  112. #{technicalScene,jdbcType=VARCHAR}, #{breakthrough,jdbcType=VARCHAR}, #{patentCase,jdbcType=VARCHAR},
  113. #{awards,jdbcType=VARCHAR}, #{teamDes,jdbcType=VARCHAR}, #{parameter,jdbcType=VARCHAR},
  114. #{techPlanUrl,jdbcType=VARCHAR}, #{businessPlanUrl,jdbcType=VARCHAR}, #{orgId,jdbcType=VARCHAR},
  115. #{orgName,jdbcType=VARCHAR}, #{orgAddress,jdbcType=VARCHAR}, #{orgEmail,jdbcType=VARCHAR},
  116. #{orgContacts,jdbcType=VARCHAR}, #{orgContactsMobile,jdbcType=VARCHAR},
  117. #{managerId,jdbcType=VARCHAR}, #{salesmanId,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
  118. #{createTime,jdbcType=TIMESTAMP}, #{releaseStatus,jdbcType=INTEGER}, #{releaseDate,jdbcType=TIMESTAMP},
  119. #{deletedSign,jdbcType=INTEGER}, #{auditStatus,jdbcType=INTEGER}, #{techBrokerId,jdbcType=VARCHAR},
  120. #{countryNameZh,jdbcType=VARCHAR}, #{internationalFlag,jdbcType=INTEGER},#{jmrhFlag,jdbcType=INTEGER},#{boutique,jdbcType=INTEGER},#{remark,jdbcType=VARCHAR},#{contacts,jdbcType=VARCHAR},#{contactMobile,jdbcType=VARCHAR})
  121. </insert>
  122. <insert id="insertSelective" parameterType="com.goafanti.common.model.Achievement">
  123. insert into achievement
  124. <trim prefix="(" suffix=")" suffixOverrides=",">
  125. <if test="id != null">
  126. id,
  127. </if>
  128. <if test="serialNumber != null">
  129. serial_number,
  130. </if>
  131. <if test="dataCategory != null">
  132. data_category,
  133. </if>
  134. <if test="name != null">
  135. name,
  136. </if>
  137. <if test="keyword != null">
  138. keyword,
  139. </if>
  140. <if test="category != null">
  141. category,
  142. </if>
  143. <if test="summary != null">
  144. summary,
  145. </if>
  146. <if test="introduction != null">
  147. introduction,
  148. </if>
  149. <if test="technicalPictureUrl != null">
  150. technical_picture_url,
  151. </if>
  152. <if test="fieldA != null">
  153. field_a,
  154. </if>
  155. <if test="fieldB != null">
  156. field_b,
  157. </if>
  158. <if test="fieldC != null">
  159. field_c,
  160. </if>
  161. <if test="maturity != null">
  162. maturity,
  163. </if>
  164. <if test="maturityPictureUrl != null">
  165. maturity_picture_url,
  166. </if>
  167. <if test="maturityTextFileUrl != null">
  168. maturity_text_file_url,
  169. </if>
  170. <if test="maturityVideoUrl != null">
  171. maturity_video_url,
  172. </if>
  173. <if test="innovation != null">
  174. innovation,
  175. </if>
  176. <if test="ownerId != null">
  177. owner_id,
  178. </if>
  179. <if test="ownerName != null">
  180. owner_name,
  181. </if>
  182. <if test="ownerType != null">
  183. owner_type,
  184. </if>
  185. <if test="ownerIdNumber != null">
  186. owner_id_number,
  187. </if>
  188. <if test="ownerMobile != null">
  189. owner_mobile,
  190. </if>
  191. <if test="ownerEmail != null">
  192. owner_email,
  193. </if>
  194. <if test="ownerPostalAddress != null">
  195. owner_postal_address,
  196. </if>
  197. <if test="cooperationMode != null">
  198. cooperation_mode,
  199. </if>
  200. <if test="transferMode != null">
  201. transfer_mode,
  202. </if>
  203. <if test="bargainingMode != null">
  204. bargaining_mode,
  205. </if>
  206. <if test="transferPrice != null">
  207. transfer_price,
  208. </if>
  209. <if test="technicalScene != null">
  210. technical_scene,
  211. </if>
  212. <if test="breakthrough != null">
  213. breakthrough,
  214. </if>
  215. <if test="patentCase != null">
  216. patent_case,
  217. </if>
  218. <if test="awards != null">
  219. awards,
  220. </if>
  221. <if test="teamDes != null">
  222. team_des,
  223. </if>
  224. <if test="parameter != null">
  225. parameter,
  226. </if>
  227. <if test="techPlanUrl != null">
  228. tech_plan_url,
  229. </if>
  230. <if test="businessPlanUrl != null">
  231. business_plan_url,
  232. </if>
  233. <if test="orgId != null">
  234. org_id,
  235. </if>
  236. <if test="orgName != null">
  237. org_name,
  238. </if>
  239. <if test="orgAddress != null">
  240. org_address,
  241. </if>
  242. <if test="orgEmail != null">
  243. org_email,
  244. </if>
  245. <if test="orgContacts != null">
  246. org_contacts,
  247. </if>
  248. <if test="orgContactsMobile != null">
  249. org_contacts_mobile,
  250. </if>
  251. <if test="contacts != null">
  252. contacts,
  253. </if>
  254. <if test="managerId != null">
  255. manager_id,
  256. </if>
  257. <if test="salesmanId != null">
  258. salesman_id,
  259. </if>
  260. <if test="status != null">
  261. status,
  262. </if>
  263. <if test="createTime != null">
  264. create_time,
  265. </if>
  266. <if test="releaseStatus != null">
  267. release_status,
  268. </if>
  269. <if test="releaseDate != null">
  270. release_date,
  271. </if>
  272. <if test="deletedSign != null">
  273. deleted_sign,
  274. </if>
  275. <if test="auditStatus != null">
  276. audit_status,
  277. </if>
  278. <if test="techBrokerId != null">
  279. tech_broker_id,
  280. </if>
  281. <if test="countryNameZh != null">
  282. country_name_zh,
  283. </if>
  284. <if test="internationalFlag != null">
  285. international_flag,
  286. </if>
  287. <if test="jmrhFlag != null">
  288. jmrh_flag,
  289. </if>
  290. <if test="boutique !=null">
  291. boutique,
  292. </if>
  293. </trim>
  294. <trim prefix="values (" suffix=")" suffixOverrides=",">
  295. <if test="id != null">
  296. #{id,jdbcType=VARCHAR},
  297. </if>
  298. <if test="serialNumber != null">
  299. #{serialNumber,jdbcType=INTEGER},
  300. </if>
  301. <if test="dataCategory != null">
  302. #{dataCategory,jdbcType=INTEGER},
  303. </if>
  304. <if test="name != null">
  305. #{name,jdbcType=VARCHAR},
  306. </if>
  307. <if test="keyword != null">
  308. #{keyword,jdbcType=VARCHAR},
  309. </if>
  310. <if test="category != null">
  311. #{category,jdbcType=INTEGER},
  312. </if>
  313. <if test="summary != null">
  314. #{summary,jdbcType=VARCHAR},
  315. </if>
  316. <if test="introduction != null">
  317. #{introduction,jdbcType=LONGVARCHAR},
  318. </if>
  319. <if test="technicalPictureUrl != null">
  320. #{technicalPictureUrl,jdbcType=VARCHAR},
  321. </if>
  322. <if test="fieldA != null">
  323. #{fieldA,jdbcType=INTEGER},
  324. </if>
  325. <if test="fieldB != null">
  326. #{fieldB,jdbcType=INTEGER},
  327. </if>
  328. <if test="fieldC != null">
  329. #{fieldC,jdbcType=INTEGER},
  330. </if>
  331. <if test="maturity != null">
  332. #{maturity,jdbcType=INTEGER},
  333. </if>
  334. <if test="maturityPictureUrl != null">
  335. #{maturityPictureUrl,jdbcType=LONGVARCHAR},
  336. </if>
  337. <if test="maturityTextFileUrl != null">
  338. #{maturityTextFileUrl,jdbcType=VARCHAR},
  339. </if>
  340. <if test="maturityVideoUrl != null">
  341. #{maturityVideoUrl,jdbcType=VARCHAR},
  342. </if>
  343. <if test="innovation != null">
  344. #{innovation,jdbcType=INTEGER},
  345. </if>
  346. <if test="ownerId != null">
  347. #{ownerId,jdbcType=VARCHAR},
  348. </if>
  349. <if test="ownerName != null">
  350. #{ownerName,jdbcType=VARCHAR},
  351. </if>
  352. <if test="ownerType != null">
  353. #{ownerType,jdbcType=INTEGER},
  354. </if>
  355. <if test="ownerIdNumber != null">
  356. #{ownerIdNumber,jdbcType=VARCHAR},
  357. </if>
  358. <if test="ownerMobile != null">
  359. #{ownerMobile,jdbcType=VARCHAR},
  360. </if>
  361. <if test="ownerEmail != null">
  362. #{ownerEmail,jdbcType=VARCHAR},
  363. </if>
  364. <if test="ownerPostalAddress != null">
  365. #{ownerPostalAddress,jdbcType=VARCHAR},
  366. </if>
  367. <if test="cooperationMode != null">
  368. #{cooperationMode,jdbcType=INTEGER},
  369. </if>
  370. <if test="transferMode != null">
  371. #{transferMode,jdbcType=INTEGER},
  372. </if>
  373. <if test="bargainingMode != null">
  374. #{bargainingMode,jdbcType=INTEGER},
  375. </if>
  376. <if test="transferPrice != null">
  377. #{transferPrice,jdbcType=DECIMAL},
  378. </if>
  379. <if test="technicalScene != null">
  380. #{technicalScene,jdbcType=VARCHAR},
  381. </if>
  382. <if test="breakthrough != null">
  383. #{breakthrough,jdbcType=VARCHAR},
  384. </if>
  385. <if test="patentCase != null">
  386. #{patentCase,jdbcType=VARCHAR},
  387. </if>
  388. <if test="awards != null">
  389. #{awards,jdbcType=VARCHAR},
  390. </if>
  391. <if test="teamDes != null">
  392. #{teamDes,jdbcType=VARCHAR},
  393. </if>
  394. <if test="parameter != null">
  395. #{parameter,jdbcType=VARCHAR},
  396. </if>
  397. <if test="techPlanUrl != null">
  398. #{techPlanUrl,jdbcType=VARCHAR},
  399. </if>
  400. <if test="businessPlanUrl != null">
  401. #{businessPlanUrl,jdbcType=VARCHAR},
  402. </if>
  403. <if test="orgId != null">
  404. #{orgId,jdbcType=VARCHAR},
  405. </if>
  406. <if test="orgName != null">
  407. #{orgName,jdbcType=VARCHAR},
  408. </if>
  409. <if test="orgAddress != null">
  410. #{orgAddress,jdbcType=VARCHAR},
  411. </if>
  412. <if test="orgEmail != null">
  413. #{orgEmail,jdbcType=VARCHAR},
  414. </if>
  415. <if test="orgContacts != null">
  416. #{orgContacts,jdbcType=VARCHAR},
  417. </if>
  418. <if test="orgContactsMobile != null">
  419. #{orgContactsMobile,jdbcType=VARCHAR},
  420. </if>
  421. <if test="contacts != null">
  422. #{contacts,jdbcType=INTEGER},
  423. </if>
  424. <if test="managerId != null">
  425. #{managerId,jdbcType=VARCHAR},
  426. </if>
  427. <if test="salesmanId != null">
  428. #{salesmanId,jdbcType=VARCHAR},
  429. </if>
  430. <if test="status != null">
  431. #{status,jdbcType=INTEGER},
  432. </if>
  433. <if test="createTime != null">
  434. #{createTime,jdbcType=TIMESTAMP},
  435. </if>
  436. <if test="releaseStatus != null">
  437. #{releaseStatus,jdbcType=INTEGER},
  438. </if>
  439. <if test="releaseDate != null">
  440. #{releaseDate,jdbcType=TIMESTAMP},
  441. </if>
  442. <if test="deletedSign != null">
  443. #{deletedSign,jdbcType=INTEGER},
  444. </if>
  445. <if test="auditStatus != null">
  446. #{auditStatus,jdbcType=INTEGER},
  447. </if>
  448. <if test="techBrokerId != null">
  449. #{techBrokerId,jdbcType=VARCHAR},
  450. </if>
  451. <if test="countryNameZh != null">
  452. #{countryNameZh,jdbcType=VARCHAR},
  453. </if>
  454. <if test="internationalFlag != null">
  455. #{internationalFlag,jdbcType=INTEGER},
  456. </if>
  457. <if test="jmrhFlag != null">
  458. #{jmrhFlag,jdbcType=INTEGER},
  459. </if>
  460. <if test="boutique != null">
  461. #{boutique,jdbcType=INTEGER}
  462. </if>
  463. </trim>
  464. </insert>
  465. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.Achievement">
  466. update achievement
  467. <set>
  468. <if test="serialNumber != null">
  469. serial_number = #{serialNumber,jdbcType=INTEGER},
  470. </if>
  471. <if test="dataCategory != null">
  472. data_category = #{dataCategory,jdbcType=INTEGER},
  473. </if>
  474. <if test="name != null">
  475. name = #{name,jdbcType=VARCHAR},
  476. </if>
  477. <if test="keyword != null">
  478. keyword = #{keyword,jdbcType=VARCHAR},
  479. </if>
  480. <if test="category != null">
  481. category = #{category,jdbcType=INTEGER},
  482. </if>
  483. <if test="summary != null">
  484. summary = #{summary,jdbcType=VARCHAR},
  485. </if>
  486. <if test="introduction != null">
  487. introduction = #{introduction,jdbcType=LONGVARCHAR},
  488. </if>
  489. <if test="technicalPictureUrl != null">
  490. technical_picture_url = #{technicalPictureUrl,jdbcType=VARCHAR},
  491. </if>
  492. <if test="fieldA != null">
  493. field_a = #{fieldA,jdbcType=INTEGER},
  494. </if>
  495. <if test="fieldB != null">
  496. field_b = #{fieldB,jdbcType=INTEGER},
  497. </if>
  498. <if test="fieldC != null">
  499. field_c = #{fieldC,jdbcType=INTEGER},
  500. </if>
  501. <if test="maturity != null">
  502. maturity = #{maturity,jdbcType=INTEGER},
  503. </if>
  504. <if test="maturityPictureUrl != null">
  505. maturity_picture_url = #{maturityPictureUrl,jdbcType=LONGVARCHAR},
  506. </if>
  507. <if test="maturityTextFileUrl != null">
  508. maturity_text_file_url = #{maturityTextFileUrl,jdbcType=VARCHAR},
  509. </if>
  510. <if test="maturityVideoUrl != null">
  511. maturity_video_url = #{maturityVideoUrl,jdbcType=VARCHAR},
  512. </if>
  513. <if test="innovation != null">
  514. innovation = #{innovation,jdbcType=INTEGER},
  515. </if>
  516. <if test="ownerId != null">
  517. owner_id = #{ownerId,jdbcType=VARCHAR},
  518. </if>
  519. <if test="ownerName != null">
  520. owner_name = #{ownerName,jdbcType=VARCHAR},
  521. </if>
  522. <if test="ownerType != null">
  523. owner_type = #{ownerType,jdbcType=INTEGER},
  524. </if>
  525. <if test="ownerIdNumber != null">
  526. owner_id_number = #{ownerIdNumber,jdbcType=VARCHAR},
  527. </if>
  528. <if test="ownerMobile != null">
  529. owner_mobile = #{ownerMobile,jdbcType=VARCHAR},
  530. </if>
  531. <if test="ownerEmail != null">
  532. owner_email = #{ownerEmail,jdbcType=VARCHAR},
  533. </if>
  534. <if test="ownerPostalAddress != null">
  535. owner_postal_address = #{ownerPostalAddress,jdbcType=VARCHAR},
  536. </if>
  537. <if test="cooperationMode != null">
  538. cooperation_mode = #{cooperationMode,jdbcType=INTEGER},
  539. </if>
  540. <if test="transferMode != null">
  541. transfer_mode = #{transferMode,jdbcType=INTEGER},
  542. </if>
  543. <if test="bargainingMode != null">
  544. bargaining_mode = #{bargainingMode,jdbcType=INTEGER},
  545. </if>
  546. <if test="transferPrice != null">
  547. transfer_price = #{transferPrice,jdbcType=DECIMAL},
  548. </if>
  549. <if test="technicalScene != null">
  550. technical_scene = #{technicalScene,jdbcType=VARCHAR},
  551. </if>
  552. <if test="breakthrough != null">
  553. breakthrough = #{breakthrough,jdbcType=VARCHAR},
  554. </if>
  555. <if test="patentCase != null">
  556. patent_case = #{patentCase,jdbcType=VARCHAR},
  557. </if>
  558. <if test="awards != null">
  559. awards = #{awards,jdbcType=VARCHAR},
  560. </if>
  561. <if test="teamDes != null">
  562. team_des = #{teamDes,jdbcType=VARCHAR},
  563. </if>
  564. <if test="parameter != null">
  565. parameter = #{parameter,jdbcType=VARCHAR},
  566. </if>
  567. <if test="techPlanUrl != null">
  568. tech_plan_url = #{techPlanUrl,jdbcType=VARCHAR},
  569. </if>
  570. <if test="businessPlanUrl != null">
  571. business_plan_url = #{businessPlanUrl,jdbcType=VARCHAR},
  572. </if>
  573. <if test="orgId != null">
  574. org_id = #{orgId,jdbcType=VARCHAR},
  575. </if>
  576. <if test="orgName != null">
  577. org_name = #{orgName,jdbcType=VARCHAR},
  578. </if>
  579. <if test="orgAddress != null">
  580. org_address = #{orgAddress,jdbcType=VARCHAR},
  581. </if>
  582. <if test="orgEmail != null">
  583. org_email = #{orgEmail,jdbcType=VARCHAR},
  584. </if>
  585. <if test="orgContacts != null">
  586. org_contacts = #{orgContacts,jdbcType=VARCHAR},
  587. </if>
  588. <if test="orgContactsMobile != null">
  589. org_contacts_mobile = #{orgContactsMobile,jdbcType=VARCHAR},
  590. </if>
  591. <if test="contacts != null">
  592. contacts = #{contacts,jdbcType=INTEGER},
  593. </if>
  594. <if test="managerId != null">
  595. manager_id = #{managerId,jdbcType=VARCHAR},
  596. </if>
  597. <if test="salesmanId != null">
  598. salesman_id = #{salesmanId,jdbcType=VARCHAR},
  599. </if>
  600. <if test="status != null">
  601. status = #{status,jdbcType=INTEGER},
  602. </if>
  603. <if test="createTime != null">
  604. create_time = #{createTime,jdbcType=TIMESTAMP},
  605. </if>
  606. <if test="releaseStatus != null">
  607. release_status = #{releaseStatus,jdbcType=INTEGER},
  608. </if>
  609. <if test="releaseDate != null">
  610. release_date = #{releaseDate,jdbcType=TIMESTAMP},
  611. </if>
  612. <if test="deletedSign != null">
  613. deleted_sign = #{deletedSign,jdbcType=INTEGER},
  614. </if>
  615. <if test="auditStatus != null">
  616. audit_status = #{auditStatus,jdbcType=INTEGER},
  617. </if>
  618. <if test="techBrokerId != null">
  619. tech_broker_id = #{techBrokerId,jdbcType=VARCHAR},
  620. </if>
  621. <if test="countryNameZh != null">
  622. country_name_zh = #{countryNameZh,jdbcType=VARCHAR},
  623. </if>
  624. <if test="internationalFlag != null">
  625. international_flag = #{internationalFlag,jdbcType=INTEGER},
  626. </if>
  627. <if test="jmrhFlag != null">
  628. jmrh_flag = #{jmrhFlag,jdbcType=INTEGER},
  629. </if>
  630. <if test="boutique != null">
  631. boutique = #{boutique,jdbcType=INTEGER},
  632. </if>
  633. <if test="remark != null">
  634. remark = #{remark,jdbcType=VARCHAR},
  635. </if>
  636. <if test="contacts != null">
  637. contacts = #{contacts,jdbcType=VARCHAR},
  638. </if>
  639. <if test="contactMobile != null">
  640. contact_mobile = #{contactMobile ,jdbcType=VARCHAR},
  641. </if>
  642. </set>
  643. where id = #{id,jdbcType=VARCHAR}
  644. </update>
  645. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.Achievement">
  646. update achievement
  647. set serial_number = #{serialNumber,jdbcType=INTEGER},
  648. data_category = #{dataCategory,jdbcType=INTEGER},
  649. name = #{name,jdbcType=VARCHAR},
  650. keyword = #{keyword,jdbcType=VARCHAR},
  651. category = #{category,jdbcType=INTEGER},
  652. summary = #{summary,jdbcType=VARCHAR},
  653. introduction = #{introduction,jdbcType=LONGVARCHAR},
  654. technical_picture_url = #{technicalPictureUrl,jdbcType=VARCHAR},
  655. field_a = #{fieldA,jdbcType=INTEGER},
  656. field_b = #{fieldB,jdbcType=INTEGER},
  657. field_c = #{fieldC,jdbcType=INTEGER},
  658. maturity = #{maturity,jdbcType=INTEGER},
  659. maturity_picture_url = #{maturityPictureUrl,jdbcType=LONGVARCHAR},
  660. maturity_text_file_url = #{maturityTextFileUrl,jdbcType=VARCHAR},
  661. maturity_video_url = #{maturityVideoUrl,jdbcType=VARCHAR},
  662. innovation = #{innovation,jdbcType=INTEGER},
  663. owner_id = #{ownerId,jdbcType=VARCHAR},
  664. owner_name = #{ownerName,jdbcType=VARCHAR},
  665. owner_type = #{ownerType,jdbcType=INTEGER},
  666. owner_id_number = #{ownerIdNumber,jdbcType=VARCHAR},
  667. owner_mobile = #{ownerMobile,jdbcType=VARCHAR},
  668. owner_email = #{ownerEmail,jdbcType=VARCHAR},
  669. owner_postal_address = #{ownerPostalAddress,jdbcType=VARCHAR},
  670. cooperation_mode = #{cooperationMode,jdbcType=INTEGER},
  671. transfer_mode = #{transferMode,jdbcType=INTEGER},
  672. bargaining_mode = #{bargainingMode,jdbcType=INTEGER},
  673. transfer_price = #{transferPrice,jdbcType=DECIMAL},
  674. technical_scene = #{technicalScene,jdbcType=VARCHAR},
  675. breakthrough = #{breakthrough,jdbcType=VARCHAR},
  676. patent_case = #{patentCase,jdbcType=VARCHAR},
  677. awards = #{awards,jdbcType=VARCHAR},
  678. team_des = #{teamDes,jdbcType=VARCHAR},
  679. parameter = #{parameter,jdbcType=VARCHAR},
  680. tech_plan_url = #{techPlanUrl,jdbcType=VARCHAR},
  681. business_plan_url = #{businessPlanUrl,jdbcType=VARCHAR},
  682. org_id = #{orgId,jdbcType=VARCHAR},
  683. org_name = #{orgName,jdbcType=VARCHAR},
  684. org_address = #{orgAddress,jdbcType=VARCHAR},
  685. org_email = #{orgEmail,jdbcType=VARCHAR},
  686. org_contacts = #{orgContacts,jdbcType=VARCHAR},
  687. org_contacts_mobile = #{orgContactsMobile,jdbcType=VARCHAR},
  688. contacts = #{contacts,jdbcType=INTEGER},
  689. manager_id = #{managerId,jdbcType=VARCHAR},
  690. salesman_id = #{salesmanId,jdbcType=VARCHAR},
  691. status = #{status,jdbcType=INTEGER},
  692. create_time = #{createTime,jdbcType=TIMESTAMP},
  693. release_status = #{releaseStatus,jdbcType=INTEGER},
  694. release_date = #{releaseDate,jdbcType=TIMESTAMP},
  695. deleted_sign = #{deletedSign,jdbcType=INTEGER},
  696. audit_status = #{auditStatus,jdbcType=INTEGER},
  697. tech_broker_id = #{techBrokerId,jdbcType=VARCHAR},
  698. country_name_zh = #{countryNameZh,jdbcType=VARCHAR},
  699. international_flag = #{internationalFlag,jdbcType=INTEGER},
  700. jmrh_flag = #{jmrhFlag,jdbcType=INTEGER},
  701. boutique = #{boutique,jdbcType=INTEGER}
  702. where id = #{id,jdbcType=VARCHAR}
  703. </update>
  704. <select id="findUserOwnerAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
  705. select
  706. a.id, a.serial_number as serialNumber, a.data_category as dataCategory,
  707. a.name, a.keyword, a.category, a.owner_name as ownerName, a.owner_type as ownerType,
  708. ui.username as username, a.owner_id as ownerId, a.org_id as orgId, a.contacts,
  709. a.release_date as releaseDate, a.audit_status as auditStatus, ad.name as techBrokerId,a.boutique,a.create_time as createTime
  710. <if test="hot != null and hot == 1"><!-- 在首页 -->
  711. ,1 as hot
  712. </if>
  713. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  714. ,0 as hot
  715. </if>
  716. <if test="hot==null"><!-- 无首页参数 -->
  717. ,ifnull(mm.effective,0) as hot
  718. </if>
  719. from achievement a
  720. LEFT JOIN admin ad on ad.id = a.tech_broker_id
  721. LEFT JOIN user_identity ui on a.owner_id = ui.uid
  722. <if test="hot != null and hot == 1"><!-- 在首页 -->
  723. inner join marketing_management mm on a.id = mm.product_id
  724. </if>
  725. <if test="hot == null"> <!-- 无首页参数 -->
  726. left join marketing_management mm on a.id = mm.product_id
  727. </if>
  728. where a.deleted_sign = 0 and a.owner_type = 0
  729. <if test="ownerName != null">
  730. and a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%')
  731. and (a.owner_id is null or a.owner_id = '')
  732. </if>
  733. <if test="username != null">
  734. and ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
  735. </if>
  736. <if test="ownerId != null">
  737. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  738. </if>
  739. <if test="serialNumber != null">
  740. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  741. </if>
  742. <if test="auditStatus != null">
  743. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  744. </if>
  745. <if test="name != null">
  746. and a.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  747. </if>
  748. <if test="keyword != null">
  749. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  750. </if>
  751. <if test="category != null">
  752. and a.category = #{category,jdbcType=INTEGER}
  753. </if>
  754. <if test="status != null">
  755. and a.status = #{status,jdbcType=INTEGER}
  756. </if>
  757. <if test="rStart != null">
  758. and a.release_date <![CDATA[ > ]]> #{rStart,jdbcType=TIMESTAMP}
  759. </if>
  760. <if test="rEnd != null">
  761. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  762. </if>
  763. <if test="cStart != null">
  764. and a.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
  765. </if>
  766. <if test="cEnd != null">
  767. and a.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  768. </if>
  769. <if test="releaseStatus != null">
  770. and a.release_status = #{releaseStatus,jdbcType=INTEGER}
  771. </if>
  772. <if test="techBrokerId != null">
  773. and a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
  774. </if>
  775. <if test="boutique != null">
  776. and a.boutique = #{boutique,jdbcType=INTEGER}
  777. </if>
  778. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  779. and a.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  780. </if>
  781. <if test="hot != null and hot == 1"><!-- 在首页 -->
  782. and mm.effective = 1
  783. </if>
  784. order by a.serial_number desc
  785. <if test="page_sql!=null">
  786. ${page_sql}
  787. </if>
  788. </select>
  789. <select id="findUserOwnerAchievementCount" parameterType="String" resultType="java.lang.Integer">
  790. select
  791. count(1)
  792. from achievement a
  793. <if test="hot != null and hot == 1"><!-- 在首页 -->
  794. inner join marketing_management mm on a.id = mm.product_id
  795. </if>
  796. <if test="hot == null"> <!-- 无首页参数 -->
  797. left join marketing_management mm on a.id = mm.product_id
  798. </if>
  799. where deleted_sign = 0 and owner_type = 0
  800. <if test="ownerName != null">
  801. and a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%')
  802. and (a.owner_id is null or a.owner_id = '')
  803. </if>
  804. <if test="username != null">
  805. and ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
  806. </if>
  807. <if test="ownerId != null">
  808. and owner_id = #{ownerId,jdbcType=VARCHAR}
  809. </if>
  810. <if test="serialNumber != null">
  811. and serial_number = #{serialNumber,jdbcType=INTEGER}
  812. </if>
  813. <if test="auditStatus != null">
  814. and audit_status = #{auditStatus,jdbcType=INTEGER}
  815. </if>
  816. <if test="name != null">
  817. and name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  818. </if>
  819. <if test="keyword != null">
  820. and keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  821. </if>
  822. <if test="category != null">
  823. and category = #{category,jdbcType=INTEGER}
  824. </if>
  825. <if test="status != null">
  826. and status = #{status,jdbcType=INTEGER}
  827. </if>
  828. <if test="rStart != null">
  829. and release_date <![CDATA[ > ]]> #{rStart,jdbcType=TIMESTAMP}
  830. </if>
  831. <if test="rEnd != null">
  832. and release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  833. </if>
  834. <if test="cStart != null">
  835. and a.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
  836. </if>
  837. <if test="cEnd != null">
  838. and a.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  839. </if>
  840. <if test="releaseStatus != null">
  841. and release_status = #{releaseStatus,jdbcType=INTEGER}
  842. </if>
  843. <if test="techBrokerId != null">
  844. and a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
  845. </if>
  846. <if test="boutique != null">
  847. and a.boutique = #{boutique,jdbcType=INTEGER}
  848. </if>
  849. <if test="hot != null and hot = 0"><!-- 不在首页 -->
  850. and a.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  851. </if>
  852. <if test="hot != null and hot = 1"><!-- 在首页 -->
  853. and mm.effective = 1
  854. </if>
  855. </select>
  856. <select id="findOrgOwnerAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
  857. select
  858. a.id, a.serial_number as serialNumber, a.data_category as dataCategory,
  859. a.name, a.keyword, a.category, a.owner_name as ownerName, a.owner_type as ownerType,
  860. a.owner_id as ownerId, a.org_id as orgId,a.create_time as createTime,
  861. a.release_date as releaseDate, a.audit_status as auditStatus, ad.name as techBrokerId,a.boutique,ad.id techBrokerIdd,
  862. a.release_status as releaseStatus
  863. <if test="hot != null and hot == 1"><!-- 在首页 -->
  864. ,1 as hot
  865. </if>
  866. <if test="hot != null and hot == 0"><!-- 无首页参数 -->
  867. ,0 as hot
  868. </if>
  869. <if test="hot==null"><!-- 在首页 -->
  870. ,ifnull(mm.effective,0) as hot
  871. </if>
  872. from achievement a
  873. LEFT JOIN admin ad on ad.id = a.tech_broker_id
  874. <if test="hot != null and hot == 1"> <!-- 在首页 -->
  875. inner join marketing_management mm on a.id = mm.product_id
  876. </if>
  877. <if test="hot == null"> <!-- 无首页参数 -->
  878. left join marketing_management mm on a.id = mm.product_id
  879. </if>
  880. where a.deleted_sign = 0
  881. <if test="recordPerson != null">
  882. and ad.name = #{recordPerson,jdbcType=VARCHAR}
  883. </if>
  884. <if test="ownerType != null">
  885. and a.owner_type = #{ownerType,jdbcType=VARCHAR}
  886. </if>
  887. <if test="ownerName != null">
  888. and a.owner_name like CONCAT(#{ownerName,jdbcType=VARCHAR},'%')
  889. </if>
  890. <if test="ownerId != null">
  891. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  892. </if>
  893. <if test="serialNumber != null">
  894. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  895. </if>
  896. <if test="auditStatus != null">
  897. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  898. </if>
  899. <if test="name != null">
  900. and a.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  901. </if>
  902. <if test="keyword != null">
  903. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  904. </if>
  905. <if test="category != null">
  906. and a.category = #{category,jdbcType=INTEGER}
  907. </if>
  908. <if test="status != null">
  909. and a.status = #{status,jdbcType=INTEGER}
  910. </if>
  911. <if test="rStart != null">
  912. and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  913. </if>
  914. <if test="rEnd != null">
  915. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  916. </if>
  917. <if test="cStart != null">
  918. and a.create_time <![CDATA[ >= ]]> #{cStart,jdbcType=TIMESTAMP}
  919. </if>
  920. <if test="cEnd != null">
  921. and a.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  922. </if>
  923. <if test="releaseStatus != null">
  924. and a.release_status = #{releaseStatus,jdbcType=INTEGER}
  925. </if>
  926. <if test="boutique != null">
  927. and a.boutique = #{boutique,jdbcType=INTEGER}
  928. </if>
  929. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  930. and a.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  931. </if>
  932. <if test="hot != null and hot == 1"><!-- 在首页 -->
  933. and mm.effective = 1
  934. </if>
  935. order by serial_number desc
  936. <if test="page_sql!=null">
  937. ${page_sql}
  938. </if>
  939. </select>
  940. <select id="findOrgOwnerAchievementCount" parameterType="String" resultType="java.lang.Integer">
  941. select
  942. count(1)
  943. from achievement a
  944. LEFT JOIN admin ad on ad.id = a.tech_broker_id
  945. <if test="hot != null and hot == 1"><!-- 在首页 -->
  946. inner join marketing_management mm on a.id = mm.product_id
  947. </if>
  948. <if test="hot == null"> <!-- 无首页参数 -->
  949. left join marketing_management mm on a.id = mm.product_id
  950. </if>
  951. where a.deleted_sign = 0
  952. <if test="recordPerson != null">
  953. and ad.name = #{recordPerson,jdbcType=VARCHAR}
  954. </if>
  955. <if test="ownerType != null">
  956. and a.owner_type = #{ownerType,jdbcType=VARCHAR}
  957. </if>
  958. <if test="ownerName != null">
  959. and a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%')
  960. </if>
  961. <if test="ownerId != null">
  962. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  963. </if>
  964. <if test="serialNumber != null">
  965. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  966. </if>
  967. <if test="auditStatus != null">
  968. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  969. </if>
  970. <if test="name != null">
  971. and a.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  972. </if>
  973. <if test="keyword != null">
  974. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  975. </if>
  976. <if test="category != null">
  977. and a.category = #{category,jdbcType=INTEGER}
  978. </if>
  979. <if test="status != null">
  980. and a.status = #{status,jdbcType=INTEGER}
  981. </if>
  982. <if test="rStart != null">
  983. and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  984. </if>
  985. <if test="rEnd != null">
  986. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  987. </if>
  988. <if test="cStart != null">
  989. and a.create_time <![CDATA[ >= ]]> #{cStart,jdbcType=TIMESTAMP}
  990. </if>
  991. <if test="cEnd != null">
  992. and a.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  993. </if>
  994. <if test="releaseStatus != null">
  995. and a.release_status = #{releaseStatus,jdbcType=INTEGER}
  996. </if>
  997. <if test="boutique != null">
  998. and a.boutique = #{boutique,jdbcType=INTEGER}
  999. </if>
  1000. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  1001. and a.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  1002. </if>
  1003. <if test="hot != null and hot == 1"><!-- 在首页 -->
  1004. and mm.effective = 1
  1005. </if>
  1006. </select>
  1007. <update id="updateReleaseDate" parameterType="java.lang.String">
  1008. update achievement set release_date = null
  1009. where id = #{id,jdbcType=VARCHAR}
  1010. </update>
  1011. <update id="batchDeleteByPrimaryKey" parameterType="java.util.List">
  1012. update achievement set deleted_sign = 1
  1013. where id in
  1014. <foreach item="item" collection="list" open="(" separator="," close=")">
  1015. #{item}
  1016. </foreach>
  1017. </update>
  1018. <select id="findAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
  1019. select
  1020. a.id, a.serial_number as serialNumber, a.data_category as dataCategory, a.boutique,
  1021. a.name, a.keyword, a.category, a.introduction,owner_postal_address as ownerPostalAddress,
  1022. a.owner_name as ownerName, a.owner_type as ownerType, a.owner_mobile as ownerMobile,a.field_a as fieldA,a.field_b ,a.field_c as fieldC,
  1023. a.status, a.release_date as releaseDate, a.audit_status as auditStatus,f.name as field,f2.name as fieldB,ifnull(b.countInterest,0) as countInterest
  1024. from achievement a
  1025. left join (
  1026. select count(0) as countInterest,achievement_id from achievement_interest group by achievement_id
  1027. )b on a.id = b.achievement_id
  1028. left join field_glossory f on a.field_a=f.id
  1029. left join field_glossory f2 on a.field_b=f2.id
  1030. where deleted_sign = 0
  1031. <if test="ownerId != null">
  1032. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1033. </if>
  1034. <if test="serialNumber != null">
  1035. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  1036. </if>
  1037. <if test="auditStatus != null">
  1038. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  1039. </if>
  1040. <if test="name != null">
  1041. and a.name = #{name,jdbcType=VARCHAR}
  1042. </if>
  1043. <if test="keyword != null">
  1044. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1045. </if>
  1046. <if test="dataCategory != null and dataCategory != ''">
  1047. and a.data_category = #{dataCategory,jdbcType=INTEGER}
  1048. </if>
  1049. <if test="category != null">
  1050. and a.category = #{category,jdbcType=INTEGER}
  1051. </if>
  1052. <if test="ownerType != null">
  1053. and a.owner_type = #{ownerType,jdbcType=INTEGER}
  1054. </if>
  1055. <if test="fieldA != null">
  1056. and a.field_a = #{fieldA,jdbcType=VARCHAR}
  1057. </if>
  1058. <if test="status != null">
  1059. and a.status = #{status,jdbcType=INTEGER}
  1060. </if>
  1061. <if test="rStart != null">
  1062. and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  1063. </if>
  1064. <if test="rEnd != null">
  1065. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  1066. </if>
  1067. <if test="releaseStatus != null">
  1068. and a.release_status = #{releaseStatus,jdbcType=INTEGER}
  1069. </if>
  1070. order by serial_number desc
  1071. <if test="page_sql!=null">
  1072. ${page_sql}
  1073. </if>
  1074. </select>
  1075. <select id="findAchievementCount" parameterType="String" resultType="java.lang.Integer">
  1076. select
  1077. count(1)
  1078. from achievement a
  1079. left join (
  1080. select count(0) as countInterest,achievement_id from achievement_interest group by achievement_id
  1081. )b on a.id = b.achievement_id
  1082. left join field_glossory f on a.field_a=f.id
  1083. left join field_glossory f2 on a.field_b=f2.id
  1084. where deleted_sign = 0
  1085. <if test="ownerId != null">
  1086. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1087. </if>
  1088. <if test="serialNumber != null">
  1089. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  1090. </if>
  1091. <if test="auditStatus != null">
  1092. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  1093. </if>
  1094. <if test="name != null">
  1095. and a.name = #{name,jdbcType=VARCHAR}
  1096. </if>
  1097. </select>
  1098. <select id="findAppAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
  1099. select
  1100. a.id, a.serial_number as serialNumber, a.data_category as dataCategory, a.boutique,
  1101. a.name, a.keyword, a.category, a.introduction,owner_postal_address as ownerPostalAddress,
  1102. a.owner_name as ownerName, a.owner_type as ownerType, a.owner_mobile as ownerMobile,a.field_a as fieldA,a.field_b ,a.field_c as fieldC,
  1103. a.status, a.release_date as releaseDate, a.audit_status as auditStatus,f.name as field,f2.name as fieldB,ifnull(b.countInterest,0) as countInterest
  1104. from achievement a
  1105. left join (
  1106. select count(0) as countInterest,achievement_id from achievement_interest group by achievement_id
  1107. )b on a.id = b.achievement_id
  1108. left join field_glossory f on a.field_a=f.id
  1109. left join field_glossory f2 on a.field_b=f2.id
  1110. where deleted_sign = 0
  1111. and audit_status = 3
  1112. <if test="ownerId != null">
  1113. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1114. </if>
  1115. <if test="serialNumber != null">
  1116. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  1117. </if>
  1118. <if test="auditStatus != null">
  1119. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  1120. </if>
  1121. <if test="name != null">
  1122. and a.name = #{name,jdbcType=VARCHAR}
  1123. </if>
  1124. <if test="keyword != null">
  1125. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1126. </if>
  1127. <if test="dataCategory != null and dataCategory != ''">
  1128. and a.data_category = #{dataCategory,jdbcType=INTEGER}
  1129. </if>
  1130. <if test="category != null">
  1131. and a.category = #{category,jdbcType=INTEGER}
  1132. </if>
  1133. <if test="ownerType != null">
  1134. and a.owner_type = #{ownerType,jdbcType=INTEGER}
  1135. </if>
  1136. <if test="fieldA != null">
  1137. and a.field_a = #{fieldA,jdbcType=VARCHAR}
  1138. </if>
  1139. <if test="status != null">
  1140. and a.status = #{status,jdbcType=INTEGER}
  1141. </if>
  1142. <if test="rStart != null">
  1143. and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  1144. </if>
  1145. <if test="rEnd != null">
  1146. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  1147. </if>
  1148. <if test="releaseStatus != null">
  1149. and a.release_status = #{releaseStatus,jdbcType=INTEGER}
  1150. </if>
  1151. order by a.boutique desc
  1152. <if test="page_sql!=null">
  1153. ${page_sql}
  1154. </if>
  1155. </select>
  1156. <select id="findAppAchievementCount" parameterType="String" resultType="java.lang.Integer">
  1157. select
  1158. count(1)
  1159. from achievement a
  1160. left join field_glossory f on a.field_a=f.id
  1161. left join field_glossory f2 on a.field_b=f2.id
  1162. where deleted_sign = 0
  1163. and audit_status = 3
  1164. <if test="ownerId != null">
  1165. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1166. </if>
  1167. <if test="serialNumber != null">
  1168. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  1169. </if>
  1170. <if test="auditStatus != null">
  1171. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  1172. </if>
  1173. <if test="name != null">
  1174. and a.name = #{name,jdbcType=VARCHAR}
  1175. </if>
  1176. <if test="keyword != null">
  1177. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1178. </if>
  1179. <if test="dataCategory != null and dataCategory != ''">
  1180. and a.data_category = #{dataCategory,jdbcType=INTEGER}
  1181. </if>
  1182. <if test="category != null">
  1183. and a.category = #{category,jdbcType=INTEGER}
  1184. </if>
  1185. <if test="ownerType != null">
  1186. and a.owner_type = #{ownerType,jdbcType=INTEGER}
  1187. </if>
  1188. <if test="fieldA != null">
  1189. and a.field_a = #{fieldA,jdbcType=VARCHAR}
  1190. </if>
  1191. <if test="status != null">
  1192. and a.status = #{status,jdbcType=INTEGER}
  1193. </if>
  1194. <if test="rStart != null">
  1195. and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  1196. </if>
  1197. <if test="rEnd != null">
  1198. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  1199. </if>
  1200. <if test="releaseStatus != null">
  1201. and a.release_status = #{releaseStatus,jdbcType=INTEGER}
  1202. </if>
  1203. </select>
  1204. <select id="selectUserOwnerDetail" parameterType="java.lang.String" resultType="com.goafanti.achievement.bo.AchievementUserOwnerDetailBo">
  1205. select
  1206. a.id, a.serial_number as serialNumber, a.data_category as dataCategory,
  1207. a.name, a.keyword, a.category,
  1208. a.summary, a.introduction, a.technical_picture_url as technicalPictureUrl,
  1209. a.field_a as fieldA, a.field_b as fieldB, a.field_c as fieldC, f.name as field1, f2.name as field2,
  1210. a.maturity, a.maturity_picture_url as maturityPictureUrl, a.maturity_text_file_url as maturityTextFileUrl,
  1211. a.maturity_video_url as maturityVideoUrl, a.innovation, a.owner_id as ownerId,
  1212. a.owner_name as ownerName, a.owner_type as ownerType, a.owner_id_number as ownerIdNumber,
  1213. a.owner_mobile as ownerMobile, a.owner_email as ownerEmail, a.owner_postal_address as ownerPostalAddress,
  1214. a.cooperation_mode as cooperationMode, a.transfer_mode as transferMode, a.bargaining_mode as bargainingMode,
  1215. a.transfer_price as transferPrice, a.technical_scene as technicalScene, a.breakthrough,
  1216. a.patent_case as patentCase, a.awards, a.team_des as teamDes,
  1217. a.parameter, a.tech_plan_url as techPlanUrl, a.business_plan_url as businessPlanUrl,
  1218. a.contacts, a.manager_id as managerId, a.salesman_id as salesmanId,
  1219. a.create_time as createTime, a.release_status as releaseStatus,
  1220. a.release_date as releaseDate, a.audit_status as auditStatus, a.tech_broker_id as techBrokerId,
  1221. ui.username as iOwnerName, ui.province, ui.city, ui.area, u.email as iOwnerEmail,
  1222. ui.id_number as iOwnerIdNumber, u.mobile as iOwnerMobile,j.easemob_name as easemobName,a.remark,
  1223. ifnull(t.x,0) as orderIntentionCount ,ifnull(t2.x,0) as orderCount,ifnull(mm.effective,0) hot,a.boutique,a.contacts,a.contact_mobile as contactMobile,
  1224. a.international_flag as internationalFlag
  1225. from achievement a
  1226. left join user_identity ui on a.owner_id = ui.uid
  1227. left join field_glossory f on a.field_a=f.id
  1228. left join field_glossory f2 on a.field_b=f2.id
  1229. left join (select count(0) as x,tl.commodity_id from t_order tr
  1230. left join t_order_detail tl on tl.order_no=tr.order_no
  1231. where order_status != 4
  1232. group by tl.commodity_id ) t on a.id=t.commodity_id
  1233. left join (select count(0) as x,tl.commodity_id from t_order tr
  1234. left join t_order_detail tl on tl.order_no=tr.order_no
  1235. where tr.order_status != 4 and tr.order_status != 0
  1236. group by tl.commodity_id) t2 on a.id=t2.commodity_id
  1237. left join jpush_easemob_account j on a.owner_id=j.uid
  1238. left join user u on u.id = a.owner_id
  1239. left join marketing_management mm on a.id = mm.product_id
  1240. where a.id =#{id,jdbcType=VARCHAR}
  1241. </select>
  1242. <select id="selectOrgOwnerDetail" parameterType="java.lang.String" resultType="com.goafanti.achievement.bo.AchievementOrgOwnerDetailBo">
  1243. select
  1244. a.id, a.serial_number as serialNumber, a.data_category as dataCategory,
  1245. a.name, a.keyword, a.category,
  1246. a.summary, a.introduction, a.technical_picture_url as technicalPictureUrl,
  1247. a.field_a as fieldA, a.field_b as fieldB, a.field_c as fieldC,
  1248. a.maturity, a.maturity_picture_url as maturityPictureUrl, a.maturity_text_file_url as maturityTextFileUrl,
  1249. a.maturity_video_url as maturityVideoUrl, a.innovation, a.owner_id as ownerId,
  1250. a.owner_name as ownerName, a.owner_type as ownerType, a.owner_id_number as ownerIdNumber,
  1251. a.owner_mobile as ownerMobile, a.owner_email as ownerEmail, a.owner_postal_address as ownerPostalAddress,
  1252. a.cooperation_mode as cooperationMode, a.transfer_mode as transferMode, a.bargaining_mode as bargainingMode,
  1253. a.transfer_price as transferPrice, a.technical_scene as technicalScene, a.breakthrough,
  1254. a.patent_case as patentCase, a.awards, a.team_des as teamDes,
  1255. a.parameter, a.tech_plan_url as techPlanUrl, a.business_plan_url as businessPlanUrl,
  1256. a.contacts, a.manager_id as managerId, a.salesman_id as salesmanId, a.international_flag as internationalFlag,
  1257. a.create_time as createTime, a.release_status as releaseStatus,
  1258. a.release_date as releaseDate, a.audit_status as auditStatus, a.tech_broker_id as techBrokerId,
  1259. oi.unit_name as iOwnerName, oi.postal_address as iOwnerPostalAddress, u.email as iOwnerEmail,
  1260. 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
  1261. from achievement a
  1262. left join organization_identity oi on a.owner_id = oi.uid
  1263. left join user u on u.id = a.owner_id
  1264. left join marketing_management mm on a.id = mm.product_id
  1265. where a.id = #{id,jdbcType=VARCHAR}
  1266. </select>
  1267. <insert id="insertBatch" parameterType="com.goafanti.common.model.Achievement">
  1268. insert into achievement
  1269. (id, deleted_sign, audit_status,
  1270. create_time, release_status, data_category,
  1271. name, keyword, category,
  1272. owner_name, owner_type, owner_id_number,
  1273. owner_mobile, owner_email, owner_postal_address,
  1274. cooperation_mode, introduction, tech_broker_id,international_flag
  1275. )
  1276. values
  1277. <foreach item="item" index="index" collection="list" separator=",">
  1278. (
  1279. #{item.id,jdbcType=VARCHAR}, #{item.deletedSign,jdbcType=INTEGER}, #{item.auditStatus,jdbcType=INTEGER},
  1280. #{item.createTime,jdbcType=TIMESTAMP}, #{item.releaseStatus,jdbcType=INTEGER}, #{item.dataCategory,jdbcType=INTEGER},
  1281. #{item.name,jdbcType=VARCHAR}, #{item.keyword,jdbcType=VARCHAR}, #{item.category,jdbcType=INTEGER},
  1282. #{item.ownerName,jdbcType=VARCHAR}, #{item.ownerType,jdbcType=VARCHAR}, #{item.ownerIdNumber,jdbcType=VARCHAR},
  1283. #{item.ownerMobile,jdbcType=VARCHAR}, #{item.ownerEmail,jdbcType=VARCHAR}, #{item.ownerPostalAddress,jdbcType=VARCHAR},
  1284. #{item.cooperationMode,jdbcType=INTEGER}, #{item.introduction,jdbcType=LONGVARCHAR},#{item.techBrokerId,jdbcType=VARCHAR},
  1285. #{item.internationalFlag,jdbcType=INTEGER}
  1286. )
  1287. </foreach>
  1288. </insert>
  1289. <select id="findSearchAchievementListByPage" parameterType="String" resultType="com.goafanti.portal.bo.AchievementSearchListBo">
  1290. select
  1291. a.id, a.name, a.keyword,a.introduction,a.category,
  1292. a.serial_number as serialNumber,
  1293. a.data_category as dataCategory,
  1294. a.owner_type as ownerType,
  1295. a.owner_name as ownerName,
  1296. a.field_a as fieldA,
  1297. a.field_b as fieldB,
  1298. a.transfer_price as transferPrice,
  1299. a.maturity,
  1300. a.introduction,a.boutique,
  1301. a.transfer_mode as transferMode,
  1302. a.technical_picture_url as technicalPictureUrl,
  1303. b.name as fieldAs,
  1304. ap.publish_page,ap.publish_platform,ap.publish_client,ap.if_top,ap.top_number,ap.show_number,bi.domain_name
  1305. from achievement a
  1306. right join achievement_publish ap on a.id=ap.achievement_id
  1307. left join branch_information bi on bi.id=ap.publish_platform
  1308. left join field_glossory b on a.field_a = b.id
  1309. where a.deleted_sign = 0
  1310. and ap.publish_client=0
  1311. and ap.publish_page='W02'
  1312. and bi.domain_name like "%"#{url,jdbcType=VARCHAR}"%"
  1313. <if test="dataCategory != null and dataCategory != ''">
  1314. and a.data_category = #{dataCategory,jdbcType=INTEGER}
  1315. </if>
  1316. <if test="category != null and category != ''">
  1317. and a.category = #{category,jdbcType=INTEGER}
  1318. </if>
  1319. <if test="fieldA != null and fieldA != ''">
  1320. and a.field_a = #{fieldA,jdbcType=INTEGER}
  1321. </if>
  1322. <if test="keyword != null and keyword != ''">
  1323. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1324. </if>
  1325. <if test="transferMode != null">
  1326. and a.transfer_mode = #{transferMode,jdbcType=INTEGER}
  1327. </if>
  1328. <if test="upperPrice != null and upperPrice != ''">
  1329. and a.transfer_price &lt; #{upperPrice,jdbcType=VARCHAR}
  1330. </if>
  1331. <if test="lowerPrice != null and lowerPrice != ''">
  1332. and a.transfer_price &gt; #{lowerPrice,jdbcType=VARCHAR}
  1333. </if>
  1334. <if test="internationalFlag != null ">
  1335. and a.international_flag = #{internationalFlag,jdbcType=INTEGER}
  1336. </if>
  1337. and a.audit_status = 3
  1338. <if test="dateSort == 0">
  1339. order by ap.if_top,ap.top_number,ap.show_number,a.release_date asc
  1340. </if>
  1341. <if test="dateSort == 1">
  1342. order by ap.if_top asc,ap.top_number asc,ap.show_number asc,a.release_date desc
  1343. </if>
  1344. <if test="page_sql != null">
  1345. ${page_sql}
  1346. </if>
  1347. </select>
  1348. <select id="findSearchAchievementCount" parameterType="String" resultType="java.lang.Integer">
  1349. select
  1350. count(1)
  1351. from achievement a
  1352. right join achievement_publish ap on a.id=ap.achievement_id
  1353. left join branch_information bi on bi.id=ap.publish_platform
  1354. left join field_glossory b on a.field_a = b.id
  1355. where a.deleted_sign = 0
  1356. and ap.publish_client=0
  1357. and ap.publish_page='W02'
  1358. and bi.domain_name like "%"#{url,jdbcType=VARCHAR}"%"
  1359. <if test="dataCategory != null and dataCategory != ''">
  1360. and a.data_category = #{dataCategory,jdbcType=INTEGER}
  1361. </if>
  1362. <if test="category != null and category != ''">
  1363. and a.category = #{category,jdbcType=INTEGER}
  1364. </if>
  1365. <if test="fieldA != null and fieldA != ''">
  1366. and a.field_a = #{fieldA,jdbcType=INTEGER}
  1367. </if>
  1368. <if test="keyword != null and keyword != ''">
  1369. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1370. </if>
  1371. <if test="transferMode != null">
  1372. and a.transfer_mode = #{transferMode,jdbcType=INTEGER}
  1373. </if>
  1374. <if test="upperPrice != null and upperPrice != ''">
  1375. and a.transfer_price &lt; #{upperPrice,jdbcType=VARCHAR}
  1376. </if>
  1377. <if test="lowerPrice != null and lowerPrice != ''">
  1378. and a.transfer_price &gt; #{lowerPrice,jdbcType=VARCHAR}
  1379. </if>
  1380. <if test="internationalFlag != null ">
  1381. and a.international_flag = #{internationalFlag,jdbcType=INTEGER}
  1382. </if>
  1383. and a.audit_status = 3
  1384. </select>
  1385. <select id="selectAchievementSearchDetail" resultType="com.goafanti.portal.bo.AchievementDetailBo">
  1386. select
  1387. a.id,
  1388. a.owner_name as ownerName,
  1389. a.serial_number as serialNumber,
  1390. a.keyword,
  1391. a.name,
  1392. a.data_category as dataCategory,
  1393. a.category,
  1394. ui.username,
  1395. oi.unit_name as unitName,
  1396. a.release_date as releaseDate,
  1397. a.owner_type as ownerType,
  1398. a.field_a as fieldA,
  1399. a.field_b as fieldB,
  1400. a.transfer_price as transferPrice,
  1401. a.maturity,
  1402. a.transfer_mode as transferMode,
  1403. a.bargaining_mode as bargainingMode,
  1404. a.summary,
  1405. a.introduction,
  1406. a.technical_picture_url as technicalPictureUrl,
  1407. a.maturity_picture_url as maturityPictureUrl,
  1408. a.maturity_text_file_url as maturityTextFileUrl,
  1409. a.maturity_video_url as maturityVideoUrl,
  1410. a.innovation,
  1411. a.cooperation_mode as cooperationMode,
  1412. a.bargaining_mode as bargainingMode,
  1413. a.technical_scene as technicalScene,
  1414. a.breakthrough,
  1415. a.patent_case as patentCase,
  1416. a.awards,
  1417. a.team_des as teamDes,
  1418. a.parameter,
  1419. a.tech_plan_url as techPlanUrl,
  1420. a.business_plan_url as businessPlanUrl,
  1421. ai.id as achievementInterestId,
  1422. ao.id as achievementOrderId,
  1423. ao.status as orderStatus
  1424. from achievement a
  1425. left join user_identity ui on ui.uid = a.owner_id
  1426. left join organization_identity oi on oi.uid = a.owner_id
  1427. left join achievement_interest ai on ai.achievement_id = a.id and ai.uid = #{0}
  1428. left join achievement_order ao on ao.achievement_id = a.id and ao.uid = #{0} and ao.status <![CDATA[ <> ]]> 6
  1429. where a.id = #{1}
  1430. </select>
  1431. <select id="findAchievementNumByUid" parameterType="java.lang.String" resultType="java.lang.Integer">
  1432. select
  1433. count(1)
  1434. from achievement
  1435. where
  1436. deleted_sign = 0
  1437. and release_status = 1
  1438. and audit_status = 3
  1439. and owner_id = #{uid,jdbcType=VARCHAR}
  1440. </select>
  1441. <select id="findPartnerAchievementListByPage" parameterType="java.lang.String" resultType="com.goafanti.achievement.bo.AchievementPartnerListBo">
  1442. SELECT
  1443. id,
  1444. serial_number AS serialNumber,
  1445. data_category AS dataCategory,
  1446. NAME,
  1447. keyword,
  1448. category,
  1449. owner_type as ownerType,
  1450. release_date AS releaseDate,
  1451. field_a as fieldA,
  1452. maturity,
  1453. introduction,
  1454. technical_picture_url as technicalPictureUrl,
  1455. bargaining_mode as bargainingMode,
  1456. transfer_price as transferPrice
  1457. FROM
  1458. achievement
  1459. WHERE
  1460. audit_status = 3
  1461. AND release_status = 1
  1462. AND deleted_sign = 0
  1463. AND owner_id = #{ownerId,jdbcType=VARCHAR}
  1464. </select>
  1465. <select id="findPartnerAchievementCount" parameterType="java.lang.String" resultType="java.lang.Integer">
  1466. SELECT
  1467. count(1)
  1468. FROM
  1469. achievement
  1470. WHERE
  1471. audit_status = 3
  1472. AND release_status = 1
  1473. AND deleted_sign = 0
  1474. AND owner_id = #{ownerId,jdbcType=VARCHAR}
  1475. </select>
  1476. <select id="findUserPortalAchievementDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.AchievementPortalDetailBo">
  1477. SELECT
  1478. a.id,
  1479. a.name,
  1480. a.keyword,
  1481. a.category,
  1482. a.introduction,
  1483. a.maturity,
  1484. a.transfer_price AS transferPrice,
  1485. a.patent_case AS patentCase,
  1486. a.field_a as fieldA,
  1487. fg.name AS fieldAS,
  1488. fgg.name AS fieldBS,
  1489. a.release_date AS releaseDate,
  1490. dg.name as province,
  1491. dgg.name as city,
  1492. a.technical_picture_url AS technicalPictureUrl,
  1493. a.transfer_mode as transferMode,
  1494. interest.id as interestId,
  1495. u.lvl as level,
  1496. a.owner_name as ownerName,
  1497. a.owner_mobile as ownerMobile,
  1498. a.bargaining_mode as bargainingMode,
  1499. ui.city as location
  1500. FROM
  1501. achievement a
  1502. LEFT JOIN <![CDATA[ user ]]> u on u.id = a.owner_id
  1503. LEFT JOIN user_identity ui on ui.uid = a.owner_id
  1504. LEFT JOIN district_glossory dg on dg.id = ui.province
  1505. LEFT JOIN district_glossory dgg on dgg.id = ui.city
  1506. LEFT JOIN field_glossory fg on fg.id = a.field_a
  1507. LEFT JOIN field_glossory fgg on fgg.id = a.field_b
  1508. LEFT JOIN achievement_interest interest on interest.achievement_id = a.id and interest.uid = #{uid,jdbcType=VARCHAR}
  1509. WHERE
  1510. a.id = #{id,jdbcType=VARCHAR}
  1511. </select>
  1512. <select id="findOrgPortalAchievementDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.AchievementPortalDetailBo">
  1513. SELECT
  1514. a.id,
  1515. a.name,
  1516. a.keyword,
  1517. a.category,
  1518. a.introduction,
  1519. a.maturity,
  1520. a.transfer_price AS transferPrice,
  1521. a.patent_case AS patentCase,
  1522. a.field_a as fieldA,
  1523. fg.name AS fieldAS,
  1524. fgg.name AS fieldBS,
  1525. a.release_date AS releaseDate,
  1526. dg.name as province,
  1527. dgg.name as city,
  1528. a.technical_picture_url AS technicalPictureUrl,
  1529. a.transfer_mode as transferMode,
  1530. interest.id as interestId,
  1531. u.lvl as level,
  1532. a.owner_name as ownerName,
  1533. a.bargaining_mode as bargainingMode
  1534. FROM
  1535. achievement a
  1536. LEFT JOIN <![CDATA[ user ]]> u on u.id = a.owner_id
  1537. LEFT JOIN organization_identity oi on oi.uid = a.owner_id
  1538. LEFT JOIN district_glossory dg on dg.id = oi.licence_province
  1539. LEFT JOIN district_glossory dgg on dgg.id = oi.licence_city
  1540. LEFT JOIN field_glossory fg on fg.id = a.field_a
  1541. LEFT JOIN field_glossory fgg on fgg.id = a.field_b
  1542. LEFT JOIN achievement_interest interest on interest.achievement_id = a.id and interest.uid = #{uid,jdbcType=VARCHAR}
  1543. WHERE
  1544. a.id = #{id,jdbcType=VARCHAR}
  1545. </select>
  1546. <select id="findUserPortalSimilarByFieldA" resultType="com.goafanti.portal.bo.AchievementPortalSimilarListBo">
  1547. SELECT
  1548. a.id,
  1549. a.name,
  1550. a.maturity,
  1551. dg.name as uprovince,
  1552. dgg.name as ucity,
  1553. dggg.name as oprovince,
  1554. dgggg.name as ocity,
  1555. a.transfer_price as transferPrice,
  1556. a.bargaining_mode as bargainingMode
  1557. FROM
  1558. achievement a
  1559. LEFT JOIN user_identity ui ON ui.uid = a.owner_id
  1560. LEFT JOIN organization_identity oi on oi.uid = a.owner_id
  1561. LEFT JOIN district_glossory dg on dg.id = ui.province
  1562. LEFT JOIN district_glossory dgg on dgg.id = ui.city
  1563. LEFT JOIN district_glossory dggg on dggg.id = oi.licence_province
  1564. LEFT JOIN district_glossory dgggg on dgggg.id = oi.licence_city
  1565. WHERE
  1566. a.audit_status = 3
  1567. AND a.deleted_sign = 0
  1568. AND a.release_status = 1
  1569. AND a.field_a = #{fieldA,jdbcType=INTEGER}
  1570. AND a.id <![CDATA[ <> ]]> #{id,jdbcType=VARCHAR}
  1571. order by a.serial_number desc
  1572. limit 5
  1573. </select>
  1574. <select id="findOrgPortalSimilarByFieldA" resultType="com.goafanti.portal.bo.AchievementPortalSimilarListBo">
  1575. SELECT
  1576. a.id,
  1577. a.name,
  1578. a.maturity,
  1579. dg.name as oprovince,
  1580. dgg.name as ocity,
  1581. dggg.name as uprovince,
  1582. dgggg.name as ucity,
  1583. a.transfer_price as transferPrice,
  1584. a.bargaining_mode as bargainingMode
  1585. FROM
  1586. achievement a
  1587. LEFT JOIN organization_identity oi ON oi.uid = a.owner_id
  1588. LEFT JOIN user_identity ui ON ui.uid = a.owner_id
  1589. LEFT JOIN district_glossory dg on dg.id = oi.licence_province
  1590. LEFT JOIN district_glossory dgg on dgg.id = oi.licence_city
  1591. LEFT JOIN district_glossory dggg on dggg.id = ui.province
  1592. LEFT JOIN district_glossory dgggg on dgggg.id = ui.city
  1593. WHERE
  1594. a.audit_status = 3
  1595. AND a.deleted_sign = 0
  1596. AND a.release_status = 1
  1597. AND a.field_a = #{fieldA,jdbcType=INTEGER}
  1598. AND a.id <![CDATA[ <> ]]> #{id,jdbcType=VARCHAR}
  1599. order by a.serial_number desc
  1600. limit 5
  1601. </select>
  1602. <update id="updateOwnerId" parameterType="java.lang.String" >
  1603. update achievement
  1604. set owner_id = null
  1605. where id = #{id,jdbcType=VARCHAR}
  1606. </update>
  1607. <select id="selectInternationalAchievement" resultType="com.goafanti.portal.bo.InternationalListBo">
  1608. select
  1609. a.id as id,
  1610. a.name as techName,
  1611. a.introduction,
  1612. a.owner_name as ownerName,
  1613. a.owner_type as ownerType,
  1614. a.technical_picture_url as technicalPictureUrl,
  1615. a.country_name_zh as countryNameZh
  1616. from
  1617. achievement a
  1618. where
  1619. a.deleted_sign = 0 and a.data_category = 1
  1620. <!-- and a.release_status = 1 and nternational_flag = 1 -->
  1621. order by
  1622. a.release_date desc
  1623. limit 0,5
  1624. </select>
  1625. <select id="findBoutiqueListByPage" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.BoutiqueListBo">
  1626. select
  1627. a.id ,
  1628. a.name,
  1629. a.transfer_price as price,
  1630. a.summary as sketch,
  1631. a.technical_picture_url as pictureUrl,
  1632. a.owner_type as ownerType,
  1633. b.name as industryCatalog,
  1634. a.owner_name as personName
  1635. from
  1636. achievement a
  1637. left join
  1638. field_glossory b
  1639. on
  1640. a.field_a = b.id
  1641. where
  1642. a.boutique = 1 and a.audit_status = 3 and a.deleted_sign=0
  1643. <if test="fieldA != null and fieldA != ''">
  1644. and a.field_a = #{fieldA,jdbcType=INTEGER}
  1645. </if>
  1646. <if test="dataCategory != null and dataCategory != ''">
  1647. and data_category = #{dataCategory,jdbcType=INTEGER}
  1648. </if>
  1649. <if test="category != null and category != ''">
  1650. and category = #{category,jdbcType=INTEGER}
  1651. </if>
  1652. order by a.create_time desc
  1653. <if test="page_sql!=null">
  1654. ${page_sql}
  1655. </if>
  1656. </select>
  1657. <select id="findBoutiqueCount" parameterType="java.lang.String" resultType="java.lang.Integer">
  1658. select
  1659. count(0)
  1660. from
  1661. achievement a
  1662. left join
  1663. field_glossory b
  1664. on
  1665. a.field_a = b.id
  1666. where
  1667. a.boutique = 1 and a.audit_status = 3 and a.deleted_sign=0
  1668. <if test="fieldA != null and fieldA != ''">
  1669. and a.field_a = #{fieldA,jdbcType=INTEGER}
  1670. </if>
  1671. <if test="dataCategory != null and dataCategory != ''">
  1672. and data_category = #{dataCategory,jdbcType=INTEGER}
  1673. </if>
  1674. <if test="category != null and category != ''">
  1675. and category = #{category,jdbcType=INTEGER}
  1676. </if>
  1677. </select>
  1678. <select id="listAchievement" resultType="com.goafanti.achievement.bo.AchievementListBo">
  1679. select
  1680. a.id, a.name, a.keyword,a.introduction,a.category,
  1681. a.serial_number as serialNumber,
  1682. a.data_category as dataCategory,
  1683. a.owner_type as ownerType,
  1684. a.owner_name as ownerName,
  1685. a.field_a as fieldA,
  1686. a.transfer_price as transferPrice,
  1687. a.transfer_mode as transfermode,
  1688. a.maturity,
  1689. a.technical_picture_url as technicalpictureurl
  1690. from achievement a
  1691. where
  1692. a.deleted_sign = 0
  1693. and a.category = 0
  1694. and a.release_status = 1
  1695. and a.audit_status = 3
  1696. order by a.release_date desc limit 0,12
  1697. </select>
  1698. <!-- 查询猜你喜欢 -->
  1699. <select id="selectCsutomerLike" resultType="com.goafanti.achievement.bo.AchievementListBo">
  1700. select
  1701. a.id, a.name, a.keyword,a.introduction,a.category,
  1702. a.serial_number as serialNumber,
  1703. a.data_category as dataCategory,
  1704. a.owner_type as ownerType,
  1705. a.owner_name as ownerName,
  1706. a.field_a as fieldA,
  1707. a.field_b as fieldB,
  1708. a.transfer_price as transferPrice,
  1709. a.technical_picture_url as technicalpictureurl
  1710. from achievement a
  1711. LEFT JOIN aft.achievement_interest b on a.id = b.achievement_id
  1712. where
  1713. a.deleted_sign = 0
  1714. and category = 0
  1715. and a.release_status = 1
  1716. and a.audit_status = 3
  1717. <if test="boutique != null">
  1718. and a.boutique= #{boutique,jdbcType=INTEGER}
  1719. </if>
  1720. order by a.release_date desc limit 0,4
  1721. </select>
  1722. <select id="countInterest" resultType="Integer">
  1723. select count(0)
  1724. from achievement_interest
  1725. where achievement_id=#{achievementId,jdbcType=VARCHAR}
  1726. </select>
  1727. <select id="achievementInterest" resultType="com.goafanti.achievement.bo.AchievementInterestBo">
  1728. select
  1729. a.id,a.name,a.create_time as createTime
  1730. from achievement_interest ai
  1731. LEFT join achievement a on ai.achievement_id=a.id
  1732. where uid=#{uid,jdbcType=VARCHAR}
  1733. </select>
  1734. <select id="findMyAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
  1735. select
  1736. a.id, a.boutique,a.name,a.category, a.audit_status as auditStatus,ifnull(t.x,0) as buyIntention,
  1737. a.release_date as releaseDate,a.create_time as createTime,ifnull(i.y,0) as countInterest
  1738. from achievement a
  1739. left join (select count(0) as x, tl.commodity_id from t_order tr
  1740. left join t_order_detail tl on tr.order_no=tl.order_no
  1741. where tr.order_status != 4
  1742. group by tl.commodity_id ) t on a.id=t.commodity_id
  1743. left join (select count(0) as y,achievement_id from achievement_interest
  1744. group by achievement_id ) i on a.id=i.achievement_id
  1745. where a.deleted_sign = 0
  1746. <if test="ownerId != null">
  1747. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1748. </if>
  1749. order by a.create_time desc
  1750. <if test="page_sql!=null">
  1751. ${page_sql}
  1752. </if>
  1753. </select>
  1754. <select id="findMyAchievementCount" parameterType="String" resultType="java.lang.Integer">
  1755. select
  1756. count(1)
  1757. from achievement a
  1758. where a.deleted_sign = 0
  1759. <if test="ownerId != null">
  1760. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1761. </if>
  1762. </select>
  1763. <select id="findMyyAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
  1764. select
  1765. a.id, a.serial_number as serialNumber, a.data_category as dataCategory,
  1766. a.name, a.keyword, a.category, a.owner_name as ownerName, a.owner_type as ownerType,
  1767. <!-- oi.unit_name as username, -->a.owner_id as ownerId, a.org_id as orgId,a.create_time as createTime,
  1768. a.release_date as releaseDate, a.audit_status as auditStatus, ad.name as techBrokerId,a.boutique
  1769. <if test="hot != null and hot == 1"><!-- 在首页 -->
  1770. ,1 as hot
  1771. </if>
  1772. <if test="hot != null and hot == 0"><!-- 无首页参数 -->
  1773. ,0 as hot
  1774. </if>
  1775. <if test="hot==null"><!-- 在首页 -->
  1776. ,ifnull(mm.effective,0) as hot
  1777. </if>
  1778. from achievement a
  1779. LEFT JOIN admin ad on ad.id = a.tech_broker_id
  1780. <!-- LEFT JOIN organization_identity oi on a.owner_id = oi.uid -->
  1781. <if test="adminId != null">
  1782. LEFT JOIN user u on a.owner_id = u.id
  1783. </if>
  1784. <if test="hot != null and hot == 1"> <!-- 在首页 -->
  1785. inner join marketing_management mm on a.id = mm.product_id
  1786. </if>
  1787. <if test="hot == null"> <!-- 无首页参数 -->
  1788. left join marketing_management mm on a.id = mm.product_id
  1789. </if>
  1790. where a.deleted_sign = 0
  1791. <if test="ownerType != null">
  1792. and a.owner_type = #{ownerType,jdbcType=VARCHAR}
  1793. </if>
  1794. <if test="techBrokerId != null">
  1795. and a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
  1796. </if>
  1797. <if test="ownerName != null">
  1798. and a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%')
  1799. </if>
  1800. <!-- <if test="unitName != null">
  1801. and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
  1802. </if> -->
  1803. <if test="ownerId != null">
  1804. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1805. </if>
  1806. <if test="serialNumber != null">
  1807. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  1808. </if>
  1809. <if test="auditStatus != null">
  1810. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  1811. </if>
  1812. <if test="name != null">
  1813. and a.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1814. </if>
  1815. <if test="keyword != null">
  1816. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1817. </if>
  1818. <if test="category != null">
  1819. and a.category = #{category,jdbcType=INTEGER}
  1820. </if>
  1821. <if test="status != null">
  1822. and a.status = #{status,jdbcType=INTEGER}
  1823. </if>
  1824. <if test="rStart != null">
  1825. and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  1826. </if>
  1827. <if test="rEnd != null">
  1828. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  1829. </if>
  1830. <if test="cStart != null">
  1831. and a.create_time <![CDATA[ >= ]]> #{cStart,jdbcType=TIMESTAMP}
  1832. </if>
  1833. <if test="cEnd != null">
  1834. and a.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  1835. </if>
  1836. <if test="releaseStatus != null">
  1837. and a.release_status = #{releaseStatus,jdbcType=INTEGER}
  1838. </if>
  1839. <if test="boutique != null">
  1840. and a.boutique = #{boutique,jdbcType=INTEGER}
  1841. </if>
  1842. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  1843. and a.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  1844. </if>
  1845. <if test="hot != null and hot == 1"><!-- 在首页 -->
  1846. and mm.effective = 1
  1847. </if>
  1848. order by serial_number desc
  1849. <if test="page_sql!=null">
  1850. ${page_sql}
  1851. </if>
  1852. </select>
  1853. <select id="findMyyAchievementCount" parameterType="String" resultType="java.lang.Integer">
  1854. select
  1855. count(1)
  1856. from achievement a
  1857. LEFT JOIN admin ad on ad.id = a.tech_broker_id
  1858. <!-- LEFT JOIN organization_identity oi on a.owner_id = oi.uid -->
  1859. <if test="adminId != null">
  1860. LEFT JOIN user u on a.owner_id = u.id
  1861. </if>
  1862. <if test="hot != null and hot == 1"><!-- 在首页 -->
  1863. inner join marketing_management mm on a.id = mm.product_id
  1864. </if>
  1865. <if test="hot == null"> <!-- 无首页参数 -->
  1866. left join marketing_management mm on a.id = mm.product_id
  1867. </if>
  1868. where a.deleted_sign = 0
  1869. <if test="ownerType != null">
  1870. and a.owner_type = #{ownerType,jdbcType=VARCHAR}
  1871. </if>
  1872. <if test="techBrokerId != null">
  1873. and a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
  1874. </if>
  1875. <if test="ownerName != null">
  1876. and a.owner_name like CONCAT(#{ownerName,jdbcType=VARCHAR},'%')
  1877. </if>
  1878. <!-- <if test="unitName != null">
  1879. and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
  1880. </if> -->
  1881. <if test="ownerId != null">
  1882. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1883. </if>
  1884. <if test="serialNumber != null">
  1885. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  1886. </if>
  1887. <if test="auditStatus != null">
  1888. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  1889. </if>
  1890. <if test="name != null">
  1891. and a.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1892. </if>
  1893. <if test="keyword != null">
  1894. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1895. </if>
  1896. <if test="category != null">
  1897. and a.category = #{category,jdbcType=INTEGER}
  1898. </if>
  1899. <if test="status != null">
  1900. and a.status = #{status,jdbcType=INTEGER}
  1901. </if>
  1902. <if test="rStart != null">
  1903. and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  1904. </if>
  1905. <if test="rEnd != null">
  1906. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  1907. </if>
  1908. <if test="cStart != null">
  1909. and a.create_time <![CDATA[ >= ]]> #{cStart,jdbcType=TIMESTAMP}
  1910. </if>
  1911. <if test="cEnd != null">
  1912. and a.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  1913. </if>
  1914. <if test="releaseStatus != null">
  1915. and a.release_status = #{releaseStatus,jdbcType=INTEGER}
  1916. </if>
  1917. <if test="boutique != null">
  1918. and a.boutique = #{boutique,jdbcType=INTEGER}
  1919. </if>
  1920. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  1921. and a.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  1922. </if>
  1923. <if test="hot != null and hot == 1"><!-- 在首页 -->
  1924. and mm.effective = 1
  1925. </if>
  1926. </select>
  1927. <select id="findManageAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
  1928. select
  1929. a.id, a.serial_number as serialNumber, a.data_category as dataCategory,
  1930. a.name, a.keyword, a.category, a.owner_name as ownerName, a.owner_type as ownerType,
  1931. <!-- oi.unit_name as username, -->a.owner_id as ownerId, a.org_id as orgId,a.create_time as createTime,
  1932. a.release_date as releaseDate, a.audit_status as auditStatus, ad.name as techBrokerId,a.boutique
  1933. <if test="hot != null and hot == 1"><!-- 在首页 -->
  1934. ,1 as hot
  1935. </if>
  1936. <if test="hot != null and hot == 0"><!-- 无首页参数 -->
  1937. ,0 as hot
  1938. </if>
  1939. <if test="hot==null"><!-- 在首页 -->
  1940. ,ifnull(mm.effective,0) as hot
  1941. </if>
  1942. from achievement a
  1943. LEFT JOIN admin ad on ad.id = a.tech_broker_id
  1944. LEFT JOIN department_management dm on dm.id = ad.department_id
  1945. <!-- LEFT JOIN organization_identity oi on a.owner_id = oi.uid -->
  1946. <if test="adminId != null">
  1947. LEFT JOIN user u on a.owner_id = u.id
  1948. </if>
  1949. <if test="hot != null and hot == 1"> <!-- 在首页 -->
  1950. inner join marketing_management mm on a.id = mm.product_id
  1951. </if>
  1952. <if test="hot == null"> <!-- 无首页参数 -->
  1953. left join marketing_management mm on a.id = mm.product_id
  1954. </if>
  1955. where a.deleted_sign = 0
  1956. <if test="recordPerson != null">
  1957. and ad.name = #{recordPerson,jdbcType=VARCHAR}
  1958. </if>
  1959. <if test="ownerType != null">
  1960. and a.owner_type = #{ownerType,jdbcType=VARCHAR}
  1961. </if>
  1962. <if test="techBrokerId != null">
  1963. and (a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR} or ad.department_id=(select department_id from admin where id=#{techBrokerId,jdbcType=VARCHAR}))
  1964. </if>
  1965. <if test="ownerName != null">
  1966. and a.owner_name like CONCAT(#{ownerName,jdbcType=VARCHAR},'%')
  1967. </if>
  1968. <!-- <if test="unitName != null">
  1969. and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
  1970. </if> -->
  1971. <if test="ownerId != null">
  1972. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1973. </if>
  1974. <if test="serialNumber != null">
  1975. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  1976. </if>
  1977. <if test="auditStatus != null">
  1978. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  1979. </if>
  1980. <if test="name != null">
  1981. and a.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1982. </if>
  1983. <if test="keyword != null">
  1984. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1985. </if>
  1986. <if test="category != null">
  1987. and a.category = #{category,jdbcType=INTEGER}
  1988. </if>
  1989. <if test="status != null">
  1990. and a.status = #{status,jdbcType=INTEGER}
  1991. </if>
  1992. <if test="rStart != null">
  1993. and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  1994. </if>
  1995. <if test="rEnd != null">
  1996. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  1997. </if>
  1998. <if test="cStart != null">
  1999. and a.create_time <![CDATA[ >= ]]> #{cStart,jdbcType=TIMESTAMP}
  2000. </if>
  2001. <if test="cEnd != null">
  2002. and a.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  2003. </if>
  2004. <if test="releaseStatus != null">
  2005. and a.release_status = #{releaseStatus,jdbcType=INTEGER}
  2006. </if>
  2007. <if test="boutique != null">
  2008. and a.boutique = #{boutique,jdbcType=INTEGER}
  2009. </if>
  2010. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  2011. and a.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  2012. </if>
  2013. <if test="hot != null and hot == 1"><!-- 在首页 -->
  2014. and mm.effective = 1
  2015. </if>
  2016. order by serial_number desc
  2017. <if test="page_sql!=null">
  2018. ${page_sql}
  2019. </if>
  2020. </select>
  2021. <select id="findManageAchievementCount" parameterType="String" resultType="java.lang.Integer">
  2022. select
  2023. count(1)
  2024. from achievement a
  2025. LEFT JOIN admin ad on ad.id = a.tech_broker_id
  2026. LEFT JOIN department_management dm on dm.id = ad.department_id
  2027. <!-- LEFT JOIN organization_identity oi on a.owner_id = oi.uid -->
  2028. <if test="adminId != null">
  2029. LEFT JOIN user u on a.owner_id = u.id
  2030. </if>
  2031. <if test="hot != null and hot == 1"><!-- 在首页 -->
  2032. inner join marketing_management mm on a.id = mm.product_id
  2033. </if>
  2034. <if test="hot == null"> <!-- 无首页参数 -->
  2035. left join marketing_management mm on a.id = mm.product_id
  2036. </if>
  2037. where a.deleted_sign = 0
  2038. <if test="recordPerson != null">
  2039. and ad.name = #{recordPerson,jdbcType=VARCHAR}
  2040. </if>
  2041. <if test="ownerType != null">
  2042. and a.owner_type = #{ownerType,jdbcType=VARCHAR}
  2043. </if>
  2044. <if test="techBrokerId != null">
  2045. and (a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR} or ad.department_id=(select department_id from admin where id=#{techBrokerId,jdbcType=VARCHAR}))
  2046. </if>
  2047. <if test="ownerName != null">
  2048. and a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%')
  2049. </if>
  2050. <!-- <if test="unitName != null">
  2051. and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
  2052. </if> -->
  2053. <if test="ownerId != null">
  2054. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  2055. </if>
  2056. <if test="serialNumber != null">
  2057. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  2058. </if>
  2059. <if test="auditStatus != null">
  2060. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  2061. </if>
  2062. <if test="name != null">
  2063. and a.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  2064. </if>
  2065. <if test="keyword != null">
  2066. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  2067. </if>
  2068. <if test="category != null">
  2069. and a.category = #{category,jdbcType=INTEGER}
  2070. </if>
  2071. <if test="status != null">
  2072. and a.status = #{status,jdbcType=INTEGER}
  2073. </if>
  2074. <if test="rStart != null">
  2075. and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  2076. </if>
  2077. <if test="rEnd != null">
  2078. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  2079. </if>
  2080. <if test="cStart != null">
  2081. and a.create_time <![CDATA[ >= ]]> #{cStart,jdbcType=TIMESTAMP}
  2082. </if>
  2083. <if test="cEnd != null">
  2084. and a.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  2085. </if>
  2086. <if test="releaseStatus != null">
  2087. and a.release_status = #{releaseStatus,jdbcType=INTEGER}
  2088. </if>
  2089. <if test="boutique != null">
  2090. and a.boutique = #{boutique,jdbcType=INTEGER}
  2091. </if>
  2092. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  2093. and a.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  2094. </if>
  2095. <if test="hot != null and hot == 1"><!-- 在首页 -->
  2096. and mm.effective = 1
  2097. </if>
  2098. </select>
  2099. <select id="getAppHomeAchievement" resultType="com.goafanti.app.bo.HomeAchievemend">
  2100. select ap.achievement_id as id ,a.name as name ,a.technical_picture_url as img,
  2101. ap.if_top,ap.top_number,ap.show_number
  2102. from achievement_publish ap
  2103. left join achievement a on ap.achievement_id=a.id
  2104. where ap.publish_client='1'
  2105. and ap.publish_page='W03'
  2106. order by ap.if_top,ap.top_number,ap.show_number asc
  2107. limit 0,4
  2108. </select>
  2109. <select id="getAppHomeRecommended" resultType="com.goafanti.achievement.bo.AchievementRecommended">
  2110. select ap.achievement_id as id,a.name,a.introduction,a.technical_picture_url as technicalpictureUrl,
  2111. a.field_a,a.field_b,f1.name as fieldA,f2.name as fieldB,a.boutique
  2112. from achievement_publish ap
  2113. left join achievement a on ap.achievement_id = a.id
  2114. left join field_glossory f1 on a.field_a=f1.id
  2115. left join field_glossory f2 on a.field_b=f2.id
  2116. where
  2117. ap.publish_client = '1'
  2118. and ap.publish_page = 'W01'
  2119. order by
  2120. ap.if_top,
  2121. ap.top_number,
  2122. ap.show_number asc limit 0,
  2123. 6
  2124. </select>
  2125. <select id="getRecentAchievements" resultType="com.goafanti.portal.bo.AchievementObject">
  2126. select d.name,d.id ,data_category as dataCategory,release_date as releaseDate,category,d.audit_status
  2127. ,fg.name as industryCategory1,fgg.name as industryCategory2,d.technical_picture_url as technicalPictureUrl
  2128. from achievement d
  2129. left join aft.field_glossory fg on fg.id=d.field_a
  2130. left join aft.field_glossory fgg on fgg.id=d.field_b
  2131. left join branch_information branchInfo on INSTR(branchInfo.domain_name,#{1})>0
  2132. left join achievement_publish dp on dp.achievement_id=d.id and dp.publish_platform=branchInfo.id
  2133. where audit_status=2 and dp.achievement_id=d.id and dp.publish_platform=branchInfo.id and instr(dp.publish_page,#{2})>0
  2134. order by release_date desc limit #{0}
  2135. </select>
  2136. <select id="getHotAchievements" resultType="com.goafanti.portal.bo.AchievementObject">
  2137. select
  2138. a.name as name ,
  2139. a.id as id,
  2140. a.technical_picture_url as technicalPictureUrl,
  2141. b.ct as interestCount,
  2142. a.category
  2143. from achievement a
  2144. left join branch_information branchInfo
  2145. on INSTR(branchInfo.domain_name,#{1})>0
  2146. left join achievement_publish ap
  2147. on ap.achievement_id=a.id
  2148. left join
  2149. (select
  2150. count(0) as ct,
  2151. achievement_id as interest_aid
  2152. from achievement_interest
  2153. group by
  2154. achievement_id
  2155. ) b
  2156. on b.interest_aid=a.id
  2157. where a.audit_status=2
  2158. and ap.achievement_id=a.id
  2159. and branchInfo.id = ap.publish_platform
  2160. and instr(ap.publish_page,#{2})>0
  2161. and is_hot=1
  2162. order by ct desc limit #{0}
  2163. </select>
  2164. </mapper>