AchievementMapper.xml 81 KB

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