AchievementMapper.xml 79 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133
  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="ownerType != null">
  875. and a.owner_type = #{ownerType,jdbcType=VARCHAR}
  876. </if>
  877. <if test="ownerName != null">
  878. and a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%')
  879. </if>
  880. <if test="ownerId != null">
  881. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  882. </if>
  883. <if test="serialNumber != null">
  884. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  885. </if>
  886. <if test="auditStatus != null">
  887. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  888. </if>
  889. <if test="name != null">
  890. and a.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  891. </if>
  892. <if test="keyword != null">
  893. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  894. </if>
  895. <if test="category != null">
  896. and a.category = #{category,jdbcType=INTEGER}
  897. </if>
  898. <if test="status != null">
  899. and a.status = #{status,jdbcType=INTEGER}
  900. </if>
  901. <if test="rStart != null">
  902. and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  903. </if>
  904. <if test="rEnd != null">
  905. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  906. </if>
  907. <if test="cStart != null">
  908. and a.create_time <![CDATA[ >= ]]> #{cStart,jdbcType=TIMESTAMP}
  909. </if>
  910. <if test="cEnd != null">
  911. and a.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  912. </if>
  913. <if test="releaseStatus != null">
  914. and a.release_status = #{releaseStatus,jdbcType=INTEGER}
  915. </if>
  916. <if test="boutique != null">
  917. and a.boutique = #{boutique,jdbcType=INTEGER}
  918. </if>
  919. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  920. and a.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  921. </if>
  922. <if test="hot != null and hot == 1"><!-- 在首页 -->
  923. and mm.effective = 1
  924. </if>
  925. order by serial_number desc
  926. <if test="page_sql!=null">
  927. ${page_sql}
  928. </if>
  929. </select>
  930. <select id="findOrgOwnerAchievementCount" parameterType="String" resultType="java.lang.Integer">
  931. select
  932. count(1)
  933. from achievement a
  934. LEFT JOIN admin ad on ad.id = a.tech_broker_id
  935. <if test="hot != null and hot == 1"><!-- 在首页 -->
  936. inner join marketing_management mm on a.id = mm.product_id
  937. </if>
  938. <if test="hot == null"> <!-- 无首页参数 -->
  939. left join marketing_management mm on a.id = mm.product_id
  940. </if>
  941. where a.deleted_sign = 0
  942. <if test="ownerType != null">
  943. and a.owner_type = #{ownerType,jdbcType=VARCHAR}
  944. </if>
  945. <if test="ownerName != null">
  946. and a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%')
  947. </if>
  948. <if test="ownerId != null">
  949. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  950. </if>
  951. <if test="serialNumber != null">
  952. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  953. </if>
  954. <if test="auditStatus != null">
  955. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  956. </if>
  957. <if test="name != null">
  958. and a.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  959. </if>
  960. <if test="keyword != null">
  961. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  962. </if>
  963. <if test="category != null">
  964. and a.category = #{category,jdbcType=INTEGER}
  965. </if>
  966. <if test="status != null">
  967. and a.status = #{status,jdbcType=INTEGER}
  968. </if>
  969. <if test="rStart != null">
  970. and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  971. </if>
  972. <if test="rEnd != null">
  973. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  974. </if>
  975. <if test="cStart != null">
  976. and a.create_time <![CDATA[ >= ]]> #{cStart,jdbcType=TIMESTAMP}
  977. </if>
  978. <if test="cEnd != null">
  979. and a.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  980. </if>
  981. <if test="releaseStatus != null">
  982. and a.release_status = #{releaseStatus,jdbcType=INTEGER}
  983. </if>
  984. <if test="boutique != null">
  985. and a.boutique = #{boutique,jdbcType=INTEGER}
  986. </if>
  987. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  988. and a.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  989. </if>
  990. <if test="hot != null and hot == 1"><!-- 在首页 -->
  991. and mm.effective = 1
  992. </if>
  993. </select>
  994. <update id="updateReleaseDate" parameterType="java.lang.String">
  995. update achievement set release_date = null
  996. where id = #{id,jdbcType=VARCHAR}
  997. </update>
  998. <update id="batchDeleteByPrimaryKey" parameterType="java.util.List">
  999. update achievement set deleted_sign = 1
  1000. where id in
  1001. <foreach item="item" collection="list" open="(" separator="," close=")">
  1002. #{item}
  1003. </foreach>
  1004. </update>
  1005. <select id="findAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
  1006. select
  1007. a.id, a.serial_number as serialNumber, a.data_category as dataCategory, a.boutique,
  1008. a.name, a.keyword, a.category, a.introduction,owner_postal_address as ownerPostalAddress,
  1009. 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,
  1010. 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
  1011. from achievement a
  1012. left join (
  1013. select count(0) as countInterest,achievement_id from achievement_interest group by achievement_id
  1014. )b on a.id = b.achievement_id
  1015. left join field_glossory f on a.field_a=f.id
  1016. left join field_glossory f2 on a.field_b=f2.id
  1017. where deleted_sign = 0
  1018. <if test="ownerId != null">
  1019. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1020. </if>
  1021. <if test="serialNumber != null">
  1022. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  1023. </if>
  1024. <if test="auditStatus != null">
  1025. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  1026. </if>
  1027. <if test="name != null">
  1028. and a.name = #{name,jdbcType=VARCHAR}
  1029. </if>
  1030. <if test="keyword != null">
  1031. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1032. </if>
  1033. <if test="dataCategory != null and dataCategory != ''">
  1034. and a.data_category = #{dataCategory,jdbcType=INTEGER}
  1035. </if>
  1036. <if test="category != null">
  1037. and a.category = #{category,jdbcType=INTEGER}
  1038. </if>
  1039. <if test="ownerType != null">
  1040. and a.owner_type = #{ownerType,jdbcType=INTEGER}
  1041. </if>
  1042. <if test="fieldA != null">
  1043. and a.field_a = #{fieldA,jdbcType=VARCHAR}
  1044. </if>
  1045. <if test="status != null">
  1046. and a.status = #{status,jdbcType=INTEGER}
  1047. </if>
  1048. <if test="rStart != null">
  1049. and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  1050. </if>
  1051. <if test="rEnd != null">
  1052. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  1053. </if>
  1054. <if test="releaseStatus != null">
  1055. and a.release_status = #{releaseStatus,jdbcType=INTEGER}
  1056. </if>
  1057. order by serial_number desc
  1058. <if test="page_sql!=null">
  1059. ${page_sql}
  1060. </if>
  1061. </select>
  1062. <select id="findAchievementCount" parameterType="String" resultType="java.lang.Integer">
  1063. select
  1064. count(1)
  1065. from achievement a
  1066. left join field_glossory f on a.field_a=f.id
  1067. left join field_glossory f2 on a.field_b=f2.id
  1068. where deleted_sign = 0
  1069. <if test="ownerId != null">
  1070. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1071. </if>
  1072. <if test="serialNumber != null">
  1073. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  1074. </if>
  1075. <if test="auditStatus != null">
  1076. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  1077. </if>
  1078. <if test="name != null">
  1079. and a.name = #{name,jdbcType=VARCHAR}
  1080. </if>
  1081. </select>
  1082. <select id="findAppAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
  1083. select
  1084. a.id, a.serial_number as serialNumber, a.data_category as dataCategory, a.boutique,
  1085. a.name, a.keyword, a.category, a.introduction,owner_postal_address as ownerPostalAddress,
  1086. 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,
  1087. 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
  1088. from achievement a
  1089. left join (
  1090. select count(0) as countInterest,achievement_id from achievement_interest group by achievement_id
  1091. )b on a.id = b.achievement_id
  1092. left join field_glossory f on a.field_a=f.id
  1093. left join field_glossory f2 on a.field_b=f2.id
  1094. where deleted_sign = 0
  1095. and audit_status = 3
  1096. <if test="ownerId != null">
  1097. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1098. </if>
  1099. <if test="serialNumber != null">
  1100. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  1101. </if>
  1102. <if test="auditStatus != null">
  1103. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  1104. </if>
  1105. <if test="name != null">
  1106. and a.name = #{name,jdbcType=VARCHAR}
  1107. </if>
  1108. <if test="keyword != null">
  1109. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1110. </if>
  1111. <if test="dataCategory != null and dataCategory != ''">
  1112. and a.data_category = #{dataCategory,jdbcType=INTEGER}
  1113. </if>
  1114. <if test="category != null">
  1115. and a.category = #{category,jdbcType=INTEGER}
  1116. </if>
  1117. <if test="ownerType != null">
  1118. and a.owner_type = #{ownerType,jdbcType=INTEGER}
  1119. </if>
  1120. <if test="fieldA != null">
  1121. and a.field_a = #{fieldA,jdbcType=VARCHAR}
  1122. </if>
  1123. <if test="status != null">
  1124. and a.status = #{status,jdbcType=INTEGER}
  1125. </if>
  1126. <if test="rStart != null">
  1127. and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  1128. </if>
  1129. <if test="rEnd != null">
  1130. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  1131. </if>
  1132. <if test="releaseStatus != null">
  1133. and a.release_status = #{releaseStatus,jdbcType=INTEGER}
  1134. </if>
  1135. order by a.boutique desc
  1136. <if test="page_sql!=null">
  1137. ${page_sql}
  1138. </if>
  1139. </select>
  1140. <select id="findAppAchievementCount" parameterType="String" resultType="java.lang.Integer">
  1141. select
  1142. count(1)
  1143. from achievement a
  1144. left join field_glossory f on a.field_a=f.id
  1145. left join field_glossory f2 on a.field_b=f2.id
  1146. where deleted_sign = 0
  1147. and audit_status = 3
  1148. <if test="ownerId != null">
  1149. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1150. </if>
  1151. <if test="serialNumber != null">
  1152. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  1153. </if>
  1154. <if test="auditStatus != null">
  1155. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  1156. </if>
  1157. <if test="name != null">
  1158. and a.name = #{name,jdbcType=VARCHAR}
  1159. </if>
  1160. <if test="keyword != null">
  1161. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1162. </if>
  1163. <if test="dataCategory != null and dataCategory != ''">
  1164. and a.data_category = #{dataCategory,jdbcType=INTEGER}
  1165. </if>
  1166. <if test="category != null">
  1167. and a.category = #{category,jdbcType=INTEGER}
  1168. </if>
  1169. <if test="ownerType != null">
  1170. and a.owner_type = #{ownerType,jdbcType=INTEGER}
  1171. </if>
  1172. <if test="fieldA != null">
  1173. and a.field_a = #{fieldA,jdbcType=VARCHAR}
  1174. </if>
  1175. <if test="status != null">
  1176. and a.status = #{status,jdbcType=INTEGER}
  1177. </if>
  1178. <if test="rStart != null">
  1179. and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  1180. </if>
  1181. <if test="rEnd != null">
  1182. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  1183. </if>
  1184. <if test="releaseStatus != null">
  1185. and a.release_status = #{releaseStatus,jdbcType=INTEGER}
  1186. </if>
  1187. </select>
  1188. <select id="selectUserOwnerDetail" parameterType="java.lang.String" resultType="com.goafanti.achievement.bo.AchievementUserOwnerDetailBo">
  1189. select
  1190. a.id, a.serial_number as serialNumber, a.data_category as dataCategory,
  1191. a.name, a.keyword, a.category,
  1192. a.summary, a.introduction, a.technical_picture_url as technicalPictureUrl,
  1193. a.field_a as fieldA, a.field_b as fieldB, a.field_c as fieldC, f.name as field1, f2.name as field2,
  1194. a.maturity, a.maturity_picture_url as maturityPictureUrl, a.maturity_text_file_url as maturityTextFileUrl,
  1195. a.maturity_video_url as maturityVideoUrl, a.innovation, a.owner_id as ownerId,
  1196. a.owner_name as ownerName, a.owner_type as ownerType, a.owner_id_number as ownerIdNumber,
  1197. a.owner_mobile as ownerMobile, a.owner_email as ownerEmail, a.owner_postal_address as ownerPostalAddress,
  1198. a.cooperation_mode as cooperationMode, a.transfer_mode as transferMode, a.bargaining_mode as bargainingMode,
  1199. a.transfer_price as transferPrice, a.technical_scene as technicalScene, a.breakthrough,
  1200. a.patent_case as patentCase, a.awards, a.team_des as teamDes,
  1201. a.parameter, a.tech_plan_url as techPlanUrl, a.business_plan_url as businessPlanUrl,
  1202. a.contacts, a.manager_id as managerId, a.salesman_id as salesmanId,
  1203. a.create_time as createTime, a.release_status as releaseStatus,
  1204. a.release_date as releaseDate, a.audit_status as auditStatus, a.tech_broker_id as techBrokerId,
  1205. ui.username as iOwnerName, ui.province, ui.city, ui.area, u.email as iOwnerEmail,
  1206. ui.id_number as iOwnerIdNumber, u.mobile as iOwnerMobile,j.easemob_name as easemobName,a.remark,
  1207. ifnull(t.x,0) as orderIntentionCount ,ifnull(t2.x,0) as orderCount,ifnull(mm.effective,0) hot,a.boutique,
  1208. a.international_flag as internationalFlag
  1209. from achievement a
  1210. left join user_identity ui on a.owner_id = ui.uid
  1211. left join field_glossory f on a.field_a=f.id
  1212. left join field_glossory f2 on a.field_b=f2.id
  1213. left join (select count(0) as x,tl.commodity_id from t_order tr
  1214. left join t_order_detail tl on tl.order_no=tr.order_no
  1215. where order_status != 4
  1216. group by tl.commodity_id ) t on a.id=t.commodity_id
  1217. left join (select count(0) as x,tl.commodity_id from t_order tr
  1218. left join t_order_detail tl on tl.order_no=tr.order_no
  1219. where tr.order_status != 4 and tr.order_status != 0
  1220. group by tl.commodity_id) t2 on a.id=t2.commodity_id
  1221. left join jpush_easemob_account j on a.owner_id=j.uid
  1222. left join user u on u.id = a.owner_id
  1223. left join marketing_management mm on a.id = mm.product_id
  1224. where a.id =#{id,jdbcType=VARCHAR}
  1225. </select>
  1226. <select id="selectOrgOwnerDetail" parameterType="java.lang.String" resultType="com.goafanti.achievement.bo.AchievementOrgOwnerDetailBo">
  1227. select
  1228. a.id, a.serial_number as serialNumber, a.data_category as dataCategory,
  1229. a.name, a.keyword, a.category,
  1230. a.summary, a.introduction, a.technical_picture_url as technicalPictureUrl,
  1231. a.field_a as fieldA, a.field_b as fieldB, a.field_c as fieldC,
  1232. a.maturity, a.maturity_picture_url as maturityPictureUrl, a.maturity_text_file_url as maturityTextFileUrl,
  1233. a.maturity_video_url as maturityVideoUrl, a.innovation, a.owner_id as ownerId,
  1234. a.owner_name as ownerName, a.owner_type as ownerType, a.owner_id_number as ownerIdNumber,
  1235. a.owner_mobile as ownerMobile, a.owner_email as ownerEmail, a.owner_postal_address as ownerPostalAddress,
  1236. a.cooperation_mode as cooperationMode, a.transfer_mode as transferMode, a.bargaining_mode as bargainingMode,
  1237. a.transfer_price as transferPrice, a.technical_scene as technicalScene, a.breakthrough,
  1238. a.patent_case as patentCase, a.awards, a.team_des as teamDes,
  1239. a.parameter, a.tech_plan_url as techPlanUrl, a.business_plan_url as businessPlanUrl,
  1240. a.contacts, a.manager_id as managerId, a.salesman_id as salesmanId, a.international_flag as internationalFlag,
  1241. a.create_time as createTime, a.release_status as releaseStatus,
  1242. a.release_date as releaseDate, a.audit_status as auditStatus, a.tech_broker_id as techBrokerId,
  1243. oi.unit_name as iOwnerName, oi.postal_address as iOwnerPostalAddress, u.email as iOwnerEmail,
  1244. oi.org_code as iOwnerIdNumber, u.mobile as iOwnerMobile,a.boutique,ifnull(mm.effective,0) hot,mm.cover_img as coverImg,a.remark
  1245. from achievement a
  1246. left join organization_identity oi on a.owner_id = oi.uid
  1247. left join user u on u.id = a.owner_id
  1248. left join marketing_management mm on a.id = mm.product_id
  1249. where a.id = #{id,jdbcType=VARCHAR}
  1250. </select>
  1251. <insert id="insertBatch" parameterType="com.goafanti.common.model.Achievement">
  1252. insert into achievement
  1253. (id, deleted_sign, audit_status,
  1254. create_time, release_status, data_category,
  1255. name, keyword, category,
  1256. owner_name, owner_type, owner_id_number,
  1257. owner_mobile, owner_email, owner_postal_address,
  1258. cooperation_mode, introduction, tech_broker_id,international_flag
  1259. )
  1260. values
  1261. <foreach item="item" index="index" collection="list" separator=",">
  1262. (
  1263. #{item.id,jdbcType=VARCHAR}, #{item.deletedSign,jdbcType=INTEGER}, #{item.auditStatus,jdbcType=INTEGER},
  1264. #{item.createTime,jdbcType=TIMESTAMP}, #{item.releaseStatus,jdbcType=INTEGER}, #{item.dataCategory,jdbcType=INTEGER},
  1265. #{item.name,jdbcType=VARCHAR}, #{item.keyword,jdbcType=VARCHAR}, #{item.category,jdbcType=INTEGER},
  1266. #{item.ownerName,jdbcType=VARCHAR}, #{item.ownerType,jdbcType=VARCHAR}, #{item.ownerIdNumber,jdbcType=VARCHAR},
  1267. #{item.ownerMobile,jdbcType=VARCHAR}, #{item.ownerEmail,jdbcType=VARCHAR}, #{item.ownerPostalAddress,jdbcType=VARCHAR},
  1268. #{item.cooperationMode,jdbcType=INTEGER}, #{item.introduction,jdbcType=LONGVARCHAR},#{item.techBrokerId,jdbcType=VARCHAR},
  1269. #{item.internationalFlag,jdbcType=INTEGER}
  1270. )
  1271. </foreach>
  1272. </insert>
  1273. <select id="findSearchAchievementListByPage" parameterType="String" resultType="com.goafanti.portal.bo.AchievementSearchListBo">
  1274. select
  1275. a.id, a.name, a.keyword,a.introduction,a.category,
  1276. a.serial_number as serialNumber,
  1277. a.data_category as dataCategory,
  1278. a.owner_type as ownerType,
  1279. a.owner_name as ownerName,
  1280. a.field_a as fieldA,
  1281. a.field_b as fieldB,
  1282. a.transfer_price as transferPrice,
  1283. a.maturity,
  1284. a.introduction,a.boutique,
  1285. a.transfer_mode as transferMode,
  1286. a.technical_picture_url as technicalPictureUrl,
  1287. b.name as fieldAs
  1288. from achievement a
  1289. left join field_glossory b on a.field_a = b.id
  1290. where a.deleted_sign = 0
  1291. <if test="dataCategory != null and dataCategory != ''">
  1292. and a.data_category = #{dataCategory,jdbcType=INTEGER}
  1293. </if>
  1294. <if test="category != null and category != ''">
  1295. and a.category = #{category,jdbcType=INTEGER}
  1296. </if>
  1297. <if test="fieldA != null and fieldA != ''">
  1298. and a.field_a = #{fieldA,jdbcType=INTEGER}
  1299. </if>
  1300. <if test="keyword != null and keyword != ''">
  1301. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1302. </if>
  1303. <if test="transferMode != null">
  1304. and a.transfer_mode = #{transferMode,jdbcType=INTEGER}
  1305. </if>
  1306. <if test="upperPrice != null and upperPrice != ''">
  1307. and a.transfer_price &lt; #{upperPrice,jdbcType=VARCHAR}
  1308. </if>
  1309. <if test="lowerPrice != null and lowerPrice != ''">
  1310. and a.transfer_price &gt; #{lowerPrice,jdbcType=VARCHAR}
  1311. </if>
  1312. <if test="internationalFlag != null ">
  1313. and a.international_flag = #{internationalFlag,jdbcType=INTEGER}
  1314. </if>
  1315. and a.release_status = 1
  1316. and a.audit_status = 3
  1317. <if test="dateSort == 0">
  1318. order by a.release_date asc
  1319. </if>
  1320. <if test="dateSort == 1">
  1321. order by a.release_date desc
  1322. </if>
  1323. <if test="page_sql != null">
  1324. ${page_sql}
  1325. </if>
  1326. </select>
  1327. <select id="findSearchAchievementCount" parameterType="String" resultType="java.lang.Integer">
  1328. select
  1329. count(1)
  1330. from achievement a
  1331. where a.deleted_sign = 0
  1332. <if test="dataCategory != null and dataCategory != ''">
  1333. and a.data_category = #{dataCategory,jdbcType=INTEGER}
  1334. </if>
  1335. <if test="category != null and category != ''">
  1336. and a.category = #{category,jdbcType=INTEGER}
  1337. </if>
  1338. <if test="fieldA != null and fieldA != ''">
  1339. and a.field_a = #{fieldA,jdbcType=INTEGER}
  1340. </if>
  1341. <if test="keyword != null and keyword != ''">
  1342. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1343. </if>
  1344. <if test="transferMode != null">
  1345. and a.transfer_mode = #{transferMode,jdbcType=INTEGER}
  1346. </if>
  1347. <if test="upperPrice != null and upperPrice != ''">
  1348. and a.transfer_price &lt; #{upperPrice,jdbcType=VARCHAR}
  1349. </if>
  1350. <if test="lowerPrice != null and lowerPrice != ''">
  1351. and a.transfer_price &gt; #{lowerPrice,jdbcType=VARCHAR}
  1352. </if>
  1353. <if test="internationalFlag != null ">
  1354. and a.international_flag = #{internationalFlag,jdbcType=INTEGER}
  1355. </if>
  1356. and a.release_status = 1
  1357. and a.audit_status = 3
  1358. <if test="dateSort == 0">
  1359. order by a.release_date asc
  1360. </if>
  1361. <if test="dateSort == 1">
  1362. order by a.release_date desc
  1363. </if>
  1364. </select>
  1365. <select id="selectAchievementSearchDetail" resultType="com.goafanti.portal.bo.AchievementDetailBo">
  1366. select
  1367. a.id,
  1368. a.owner_name as ownerName,
  1369. a.serial_number as serialNumber,
  1370. a.keyword,
  1371. a.name,
  1372. a.data_category as dataCategory,
  1373. a.category,
  1374. ui.username,
  1375. oi.unit_name as unitName,
  1376. a.release_date as releaseDate,
  1377. a.owner_type as ownerType,
  1378. a.field_a as fieldA,
  1379. a.field_b as fieldB,
  1380. a.transfer_price as transferPrice,
  1381. a.maturity,
  1382. a.transfer_mode as transferMode,
  1383. a.bargaining_mode as bargainingMode,
  1384. a.summary,
  1385. a.introduction,
  1386. a.technical_picture_url as technicalPictureUrl,
  1387. a.maturity_picture_url as maturityPictureUrl,
  1388. a.maturity_text_file_url as maturityTextFileUrl,
  1389. a.maturity_video_url as maturityVideoUrl,
  1390. a.innovation,
  1391. a.cooperation_mode as cooperationMode,
  1392. a.bargaining_mode as bargainingMode,
  1393. a.technical_scene as technicalScene,
  1394. a.breakthrough,
  1395. a.patent_case as patentCase,
  1396. a.awards,
  1397. a.team_des as teamDes,
  1398. a.parameter,
  1399. a.tech_plan_url as techPlanUrl,
  1400. a.business_plan_url as businessPlanUrl,
  1401. ai.id as achievementInterestId,
  1402. ao.id as achievementOrderId,
  1403. ao.status as orderStatus
  1404. from achievement a
  1405. left join user_identity ui on ui.uid = a.owner_id
  1406. left join organization_identity oi on oi.uid = a.owner_id
  1407. left join achievement_interest ai on ai.achievement_id = a.id and ai.uid = #{0}
  1408. left join achievement_order ao on ao.achievement_id = a.id and ao.uid = #{0} and ao.status <![CDATA[ <> ]]> 6
  1409. where a.id = #{1}
  1410. </select>
  1411. <select id="findAchievementNumByUid" parameterType="java.lang.String" resultType="java.lang.Integer">
  1412. select
  1413. count(1)
  1414. from achievement
  1415. where
  1416. deleted_sign = 0
  1417. and release_status = 1
  1418. and audit_status = 3
  1419. and owner_id = #{uid,jdbcType=VARCHAR}
  1420. </select>
  1421. <select id="findPartnerAchievementListByPage" parameterType="java.lang.String" resultType="com.goafanti.achievement.bo.AchievementPartnerListBo">
  1422. SELECT
  1423. id,
  1424. serial_number AS serialNumber,
  1425. data_category AS dataCategory,
  1426. NAME,
  1427. keyword,
  1428. category,
  1429. owner_type as ownerType,
  1430. release_date AS releaseDate,
  1431. field_a as fieldA,
  1432. maturity,
  1433. introduction,
  1434. technical_picture_url as technicalPictureUrl,
  1435. bargaining_mode as bargainingMode,
  1436. transfer_price as transferPrice
  1437. FROM
  1438. achievement
  1439. WHERE
  1440. audit_status = 3
  1441. AND release_status = 1
  1442. AND deleted_sign = 0
  1443. AND owner_id = #{ownerId,jdbcType=VARCHAR}
  1444. </select>
  1445. <select id="findPartnerAchievementCount" parameterType="java.lang.String" resultType="java.lang.Integer">
  1446. SELECT
  1447. count(1)
  1448. FROM
  1449. achievement
  1450. WHERE
  1451. audit_status = 3
  1452. AND release_status = 1
  1453. AND deleted_sign = 0
  1454. AND owner_id = #{ownerId,jdbcType=VARCHAR}
  1455. </select>
  1456. <select id="findUserPortalAchievementDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.AchievementPortalDetailBo">
  1457. SELECT
  1458. a.id,
  1459. a.name,
  1460. a.keyword,
  1461. a.category,
  1462. a.introduction,
  1463. a.maturity,
  1464. a.transfer_price AS transferPrice,
  1465. a.patent_case AS patentCase,
  1466. a.field_a as fieldA,
  1467. fg.name AS fieldAS,
  1468. fgg.name AS fieldBS,
  1469. a.release_date AS releaseDate,
  1470. dg.name as province,
  1471. dgg.name as city,
  1472. a.technical_picture_url AS technicalPictureUrl,
  1473. a.transfer_mode as transferMode,
  1474. interest.id as interestId,
  1475. u.lvl as level,
  1476. a.owner_name as ownerName,
  1477. a.owner_mobile as ownerMobile,
  1478. a.bargaining_mode as bargainingMode,
  1479. ui.city as location
  1480. FROM
  1481. achievement a
  1482. LEFT JOIN <![CDATA[ user ]]> u on u.id = a.owner_id
  1483. LEFT JOIN user_identity ui on ui.uid = a.owner_id
  1484. LEFT JOIN district_glossory dg on dg.id = ui.province
  1485. LEFT JOIN district_glossory dgg on dgg.id = ui.city
  1486. LEFT JOIN field_glossory fg on fg.id = a.field_a
  1487. LEFT JOIN field_glossory fgg on fgg.id = a.field_b
  1488. LEFT JOIN achievement_interest interest on interest.achievement_id = a.id and interest.uid = #{uid,jdbcType=VARCHAR}
  1489. WHERE
  1490. a.id = #{id,jdbcType=VARCHAR}
  1491. </select>
  1492. <select id="findOrgPortalAchievementDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.AchievementPortalDetailBo">
  1493. SELECT
  1494. a.id,
  1495. a.name,
  1496. a.keyword,
  1497. a.category,
  1498. a.introduction,
  1499. a.maturity,
  1500. a.transfer_price AS transferPrice,
  1501. a.patent_case AS patentCase,
  1502. a.field_a as fieldA,
  1503. fg.name AS fieldAS,
  1504. fgg.name AS fieldBS,
  1505. a.release_date AS releaseDate,
  1506. dg.name as province,
  1507. dgg.name as city,
  1508. a.technical_picture_url AS technicalPictureUrl,
  1509. a.transfer_mode as transferMode,
  1510. interest.id as interestId,
  1511. u.lvl as level,
  1512. a.owner_name as ownerName,
  1513. a.bargaining_mode as bargainingMode
  1514. FROM
  1515. achievement a
  1516. LEFT JOIN <![CDATA[ user ]]> u on u.id = a.owner_id
  1517. LEFT JOIN organization_identity oi on oi.uid = a.owner_id
  1518. LEFT JOIN district_glossory dg on dg.id = oi.licence_province
  1519. LEFT JOIN district_glossory dgg on dgg.id = oi.licence_city
  1520. LEFT JOIN field_glossory fg on fg.id = a.field_a
  1521. LEFT JOIN field_glossory fgg on fgg.id = a.field_b
  1522. LEFT JOIN achievement_interest interest on interest.achievement_id = a.id and interest.uid = #{uid,jdbcType=VARCHAR}
  1523. WHERE
  1524. a.id = #{id,jdbcType=VARCHAR}
  1525. </select>
  1526. <select id="findUserPortalSimilarByFieldA" resultType="com.goafanti.portal.bo.AchievementPortalSimilarListBo">
  1527. SELECT
  1528. a.id,
  1529. a.name,
  1530. a.maturity,
  1531. dg.name as uprovince,
  1532. dgg.name as ucity,
  1533. dggg.name as oprovince,
  1534. dgggg.name as ocity,
  1535. a.transfer_price as transferPrice,
  1536. a.bargaining_mode as bargainingMode
  1537. FROM
  1538. achievement a
  1539. LEFT JOIN user_identity ui ON ui.uid = a.owner_id
  1540. LEFT JOIN organization_identity oi on oi.uid = a.owner_id
  1541. LEFT JOIN district_glossory dg on dg.id = ui.province
  1542. LEFT JOIN district_glossory dgg on dgg.id = ui.city
  1543. LEFT JOIN district_glossory dggg on dggg.id = oi.licence_province
  1544. LEFT JOIN district_glossory dgggg on dgggg.id = oi.licence_city
  1545. WHERE
  1546. a.audit_status = 3
  1547. AND a.deleted_sign = 0
  1548. AND a.release_status = 1
  1549. AND a.field_a = #{fieldA,jdbcType=INTEGER}
  1550. AND a.id <![CDATA[ <> ]]> #{id,jdbcType=VARCHAR}
  1551. order by a.serial_number desc
  1552. limit 5
  1553. </select>
  1554. <select id="findOrgPortalSimilarByFieldA" resultType="com.goafanti.portal.bo.AchievementPortalSimilarListBo">
  1555. SELECT
  1556. a.id,
  1557. a.name,
  1558. a.maturity,
  1559. dg.name as oprovince,
  1560. dgg.name as ocity,
  1561. dggg.name as uprovince,
  1562. dgggg.name as ucity,
  1563. a.transfer_price as transferPrice,
  1564. a.bargaining_mode as bargainingMode
  1565. FROM
  1566. achievement a
  1567. LEFT JOIN organization_identity oi ON oi.uid = a.owner_id
  1568. LEFT JOIN user_identity ui ON ui.uid = a.owner_id
  1569. LEFT JOIN district_glossory dg on dg.id = oi.licence_province
  1570. LEFT JOIN district_glossory dgg on dgg.id = oi.licence_city
  1571. LEFT JOIN district_glossory dggg on dggg.id = ui.province
  1572. LEFT JOIN district_glossory dgggg on dgggg.id = ui.city
  1573. WHERE
  1574. a.audit_status = 3
  1575. AND a.deleted_sign = 0
  1576. AND a.release_status = 1
  1577. AND a.field_a = #{fieldA,jdbcType=INTEGER}
  1578. AND a.id <![CDATA[ <> ]]> #{id,jdbcType=VARCHAR}
  1579. order by a.serial_number desc
  1580. limit 5
  1581. </select>
  1582. <update id="updateOwnerId" parameterType="java.lang.String" >
  1583. update achievement
  1584. set owner_id = null
  1585. where id = #{id,jdbcType=VARCHAR}
  1586. </update>
  1587. <select id="selectInternationalAchievement" resultType="com.goafanti.portal.bo.InternationalListBo">
  1588. select
  1589. a.id as id,
  1590. a.name as techName,
  1591. a.introduction,
  1592. a.owner_name as ownerName,
  1593. a.owner_type as ownerType,
  1594. a.technical_picture_url as technicalPictureUrl,
  1595. a.country_name_zh as countryNameZh
  1596. from
  1597. achievement a
  1598. where
  1599. a.deleted_sign = 0 and a.data_category = 1
  1600. <!-- and a.release_status = 1 and nternational_flag = 1 -->
  1601. order by
  1602. a.release_date desc
  1603. limit 0,5
  1604. </select>
  1605. <select id="findBoutiqueListByPage" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.BoutiqueListBo">
  1606. select
  1607. a.id ,
  1608. a.name,
  1609. a.transfer_price as price,
  1610. a.summary as sketch,
  1611. a.technical_picture_url as pictureUrl,
  1612. a.owner_type as ownerType,
  1613. b.name as industryCatalog,
  1614. a.owner_name as personName
  1615. from
  1616. achievement a
  1617. left join
  1618. field_glossory b
  1619. on
  1620. a.field_a = b.id
  1621. where
  1622. a.boutique = 1 and a.audit_status = 3 and a.deleted_sign=0
  1623. <if test="fieldA != null and fieldA != ''">
  1624. and a.field_a = #{fieldA,jdbcType=INTEGER}
  1625. </if>
  1626. <if test="dataCategory != null and dataCategory != ''">
  1627. and data_category = #{dataCategory,jdbcType=INTEGER}
  1628. </if>
  1629. <if test="category != null and category != ''">
  1630. and category = #{category,jdbcType=INTEGER}
  1631. </if>
  1632. order by a.create_time desc
  1633. <if test="page_sql!=null">
  1634. ${page_sql}
  1635. </if>
  1636. </select>
  1637. <select id="findBoutiqueCount" parameterType="java.lang.String" resultType="java.lang.Integer">
  1638. select
  1639. count(0)
  1640. from
  1641. achievement a
  1642. left join
  1643. field_glossory b
  1644. on
  1645. a.field_a = b.id
  1646. where
  1647. a.boutique = 1 and a.audit_status = 3 and a.deleted_sign=0
  1648. <if test="fieldA != null and fieldA != ''">
  1649. and a.field_a = #{fieldA,jdbcType=INTEGER}
  1650. </if>
  1651. <if test="dataCategory != null and dataCategory != ''">
  1652. and data_category = #{dataCategory,jdbcType=INTEGER}
  1653. </if>
  1654. <if test="category != null and category != ''">
  1655. and category = #{category,jdbcType=INTEGER}
  1656. </if>
  1657. </select>
  1658. <select id="listAchievement" resultType="com.goafanti.achievement.bo.AchievementListBo">
  1659. select
  1660. a.id, a.name, a.keyword,a.introduction,a.category,
  1661. a.serial_number as serialNumber,
  1662. a.data_category as dataCategory,
  1663. a.owner_type as ownerType,
  1664. a.owner_name as ownerName,
  1665. a.field_a as fieldA,
  1666. a.transfer_price as transferPrice,
  1667. a.transfer_mode as transfermode,
  1668. a.maturity,
  1669. a.technical_picture_url as technicalpictureurl
  1670. from achievement a
  1671. where
  1672. a.deleted_sign = 0
  1673. and a.category = 0
  1674. and a.release_status = 1
  1675. and a.audit_status = 3
  1676. order by a.release_date desc limit 0,12
  1677. </select>
  1678. <!-- 查询猜你喜欢 -->
  1679. <select id="selectCsutomerLike" resultType="com.goafanti.achievement.bo.AchievementListBo">
  1680. select
  1681. a.id, a.name, a.keyword,a.introduction,a.category,
  1682. a.serial_number as serialNumber,
  1683. a.data_category as dataCategory,
  1684. a.owner_type as ownerType,
  1685. a.owner_name as ownerName,
  1686. a.field_a as fieldA,
  1687. a.field_b as fieldB,
  1688. a.transfer_price as transferPrice,
  1689. a.technical_picture_url as technicalpictureurl
  1690. from achievement a
  1691. LEFT JOIN aft.achievement_interest b on a.id = b.achievement_id
  1692. where
  1693. a.deleted_sign = 0
  1694. and category = 0
  1695. and a.release_status = 1
  1696. and a.audit_status = 3
  1697. <if test="boutique != null">
  1698. and a.boutique= #{boutique,jdbcType=INTEGER}
  1699. </if>
  1700. order by a.release_date desc limit 0,4
  1701. </select>
  1702. <select id="countInterest" resultType="Integer">
  1703. select count(0)
  1704. from achievement_interest
  1705. where achievement_id=#{achievementId,jdbcType=VARCHAR}
  1706. </select>
  1707. <select id="achievementInterest" resultType="com.goafanti.achievement.bo.AchievementInterestBo">
  1708. select
  1709. a.id,a.name,a.create_time as createTime
  1710. from achievement_interest ai
  1711. LEFT join achievement a on ai.achievement_id=a.id
  1712. where uid=#{uid,jdbcType=VARCHAR}
  1713. </select>
  1714. <select id="findMyAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
  1715. select
  1716. a.id, a.boutique,a.name,a.category, a.audit_status as auditStatus,ifnull(t.x,0) as buyIntention,
  1717. a.release_date as releaseDate,a.create_time as createTime,ifnull(i.y,0) as countInterest
  1718. from achievement a
  1719. left join (select count(0) as x, tl.commodity_id from t_order tr
  1720. left join t_order_detail tl on tr.order_no=tl.order_no
  1721. where tr.order_status != 4
  1722. group by tl.commodity_id ) t on a.id=t.commodity_id
  1723. left join (select count(0) as y,achievement_id from achievement_interest
  1724. group by achievement_id ) i on a.id=i.achievement_id
  1725. where a.deleted_sign = 0
  1726. <if test="ownerId != null">
  1727. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1728. </if>
  1729. order by a.create_time desc
  1730. <if test="page_sql!=null">
  1731. ${page_sql}
  1732. </if>
  1733. </select>
  1734. <select id="findMyAchievementCount" parameterType="String" resultType="java.lang.Integer">
  1735. select
  1736. count(1)
  1737. from achievement a
  1738. where a.deleted_sign = 0
  1739. <if test="ownerId != null">
  1740. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1741. </if>
  1742. </select>
  1743. <select id="findMyyAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
  1744. select
  1745. a.id, a.serial_number as serialNumber, a.data_category as dataCategory,
  1746. a.name, a.keyword, a.category, a.owner_name as ownerName, a.owner_type as ownerType,
  1747. <!-- oi.unit_name as username, -->a.owner_id as ownerId, a.org_id as orgId, a.contacts,a.create_time as createTime,
  1748. a.release_date as releaseDate, a.audit_status as auditStatus, ad.name as techBrokerId,a.boutique
  1749. <if test="hot != null and hot == 1"><!-- 在首页 -->
  1750. ,1 as hot
  1751. </if>
  1752. <if test="hot != null and hot == 0"><!-- 无首页参数 -->
  1753. ,0 as hot
  1754. </if>
  1755. <if test="hot==null"><!-- 在首页 -->
  1756. ,ifnull(mm.effective,0) as hot
  1757. </if>
  1758. from achievement a
  1759. LEFT JOIN admin ad on ad.id = a.tech_broker_id
  1760. <!-- LEFT JOIN organization_identity oi on a.owner_id = oi.uid -->
  1761. <if test="adminId != null">
  1762. LEFT JOIN user u on a.owner_id = u.id
  1763. </if>
  1764. <if test="hot != null and hot == 1"> <!-- 在首页 -->
  1765. inner join marketing_management mm on a.id = mm.product_id
  1766. </if>
  1767. <if test="hot == null"> <!-- 无首页参数 -->
  1768. left join marketing_management mm on a.id = mm.product_id
  1769. </if>
  1770. where a.deleted_sign = 0
  1771. <if test="ownerType != null">
  1772. and a.owner_type = #{ownerType,jdbcType=VARCHAR}
  1773. </if>
  1774. <if test="techBrokerId != null">
  1775. and a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
  1776. </if>
  1777. <if test="ownerName != null">
  1778. and a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%')
  1779. </if>
  1780. <!-- <if test="unitName != null">
  1781. and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
  1782. </if> -->
  1783. <if test="ownerId != null">
  1784. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1785. </if>
  1786. <if test="serialNumber != null">
  1787. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  1788. </if>
  1789. <if test="auditStatus != null">
  1790. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  1791. </if>
  1792. <if test="name != null">
  1793. and a.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1794. </if>
  1795. <if test="keyword != null">
  1796. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1797. </if>
  1798. <if test="category != null">
  1799. and a.category = #{category,jdbcType=INTEGER}
  1800. </if>
  1801. <if test="status != null">
  1802. and a.status = #{status,jdbcType=INTEGER}
  1803. </if>
  1804. <if test="rStart != null">
  1805. and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  1806. </if>
  1807. <if test="rEnd != null">
  1808. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  1809. </if>
  1810. <if test="cStart != null">
  1811. and a.create_time <![CDATA[ >= ]]> #{cStart,jdbcType=TIMESTAMP}
  1812. </if>
  1813. <if test="cEnd != null">
  1814. and a.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  1815. </if>
  1816. <if test="releaseStatus != null">
  1817. and a.release_status = #{releaseStatus,jdbcType=INTEGER}
  1818. </if>
  1819. <if test="boutique != null">
  1820. and a.boutique = #{boutique,jdbcType=INTEGER}
  1821. </if>
  1822. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  1823. and a.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  1824. </if>
  1825. <if test="hot != null and hot == 1"><!-- 在首页 -->
  1826. and mm.effective = 1
  1827. </if>
  1828. order by serial_number desc
  1829. <if test="page_sql!=null">
  1830. ${page_sql}
  1831. </if>
  1832. </select>
  1833. <select id="findMyyAchievementCount" parameterType="String" resultType="java.lang.Integer">
  1834. select
  1835. count(1)
  1836. from achievement a
  1837. LEFT JOIN admin ad on ad.id = a.tech_broker_id
  1838. <!-- LEFT JOIN organization_identity oi on a.owner_id = oi.uid -->
  1839. <if test="adminId != null">
  1840. LEFT JOIN user u on a.owner_id = u.id
  1841. </if>
  1842. <if test="hot != null and hot == 1"><!-- 在首页 -->
  1843. inner join marketing_management mm on a.id = mm.product_id
  1844. </if>
  1845. <if test="hot == null"> <!-- 无首页参数 -->
  1846. left join marketing_management mm on a.id = mm.product_id
  1847. </if>
  1848. where a.deleted_sign = 0
  1849. <if test="ownerType != null">
  1850. and a.owner_type = #{ownerType,jdbcType=VARCHAR}
  1851. </if>
  1852. <if test="techBrokerId != null">
  1853. and a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
  1854. </if>
  1855. <if test="ownerName != null">
  1856. and a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%')
  1857. </if>
  1858. <!-- <if test="unitName != null">
  1859. and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
  1860. </if> -->
  1861. <if test="ownerId != null">
  1862. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1863. </if>
  1864. <if test="serialNumber != null">
  1865. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  1866. </if>
  1867. <if test="auditStatus != null">
  1868. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  1869. </if>
  1870. <if test="name != null">
  1871. and a.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1872. </if>
  1873. <if test="keyword != null">
  1874. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1875. </if>
  1876. <if test="category != null">
  1877. and a.category = #{category,jdbcType=INTEGER}
  1878. </if>
  1879. <if test="status != null">
  1880. and a.status = #{status,jdbcType=INTEGER}
  1881. </if>
  1882. <if test="rStart != null">
  1883. and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  1884. </if>
  1885. <if test="rEnd != null">
  1886. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  1887. </if>
  1888. <if test="cStart != null">
  1889. and a.create_time <![CDATA[ >= ]]> #{cStart,jdbcType=TIMESTAMP}
  1890. </if>
  1891. <if test="cEnd != null">
  1892. and a.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  1893. </if>
  1894. <if test="releaseStatus != null">
  1895. and a.release_status = #{releaseStatus,jdbcType=INTEGER}
  1896. </if>
  1897. <if test="boutique != null">
  1898. and a.boutique = #{boutique,jdbcType=INTEGER}
  1899. </if>
  1900. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  1901. and a.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  1902. </if>
  1903. <if test="hot != null and hot == 1"><!-- 在首页 -->
  1904. and mm.effective = 1
  1905. </if>
  1906. </select>
  1907. <select id="findManageAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
  1908. select
  1909. a.id, a.serial_number as serialNumber, a.data_category as dataCategory,
  1910. a.name, a.keyword, a.category, a.owner_name as ownerName, a.owner_type as ownerType,
  1911. <!-- oi.unit_name as username, -->a.owner_id as ownerId, a.org_id as orgId, a.contacts,a.create_time as createTime,
  1912. a.release_date as releaseDate, a.audit_status as auditStatus, ad.name as techBrokerId,a.boutique
  1913. <if test="hot != null and hot == 1"><!-- 在首页 -->
  1914. ,1 as hot
  1915. </if>
  1916. <if test="hot != null and hot == 0"><!-- 无首页参数 -->
  1917. ,0 as hot
  1918. </if>
  1919. <if test="hot==null"><!-- 在首页 -->
  1920. ,ifnull(mm.effective,0) as hot
  1921. </if>
  1922. from achievement a
  1923. LEFT JOIN admin ad on ad.id = a.tech_broker_id
  1924. LEFT JOIN department_management dm on dm.id = ad.department_id
  1925. <!-- LEFT JOIN organization_identity oi on a.owner_id = oi.uid -->
  1926. <if test="adminId != null">
  1927. LEFT JOIN user u on a.owner_id = u.id
  1928. </if>
  1929. <if test="hot != null and hot == 1"> <!-- 在首页 -->
  1930. inner join marketing_management mm on a.id = mm.product_id
  1931. </if>
  1932. <if test="hot == null"> <!-- 无首页参数 -->
  1933. left join marketing_management mm on a.id = mm.product_id
  1934. </if>
  1935. where a.deleted_sign = 0
  1936. <if test="ownerType != null">
  1937. and a.owner_type = #{ownerType,jdbcType=VARCHAR}
  1938. </if>
  1939. <if test="techBrokerId != null">
  1940. and (a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR} or ad.department_id=(select department_id from admin where id=#{techBrokerId,jdbcType=VARCHAR}))
  1941. </if>
  1942. <if test="ownerName != null">
  1943. and a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%')
  1944. </if>
  1945. <!-- <if test="unitName != null">
  1946. and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
  1947. </if> -->
  1948. <if test="ownerId != null">
  1949. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  1950. </if>
  1951. <if test="serialNumber != null">
  1952. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  1953. </if>
  1954. <if test="auditStatus != null">
  1955. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  1956. </if>
  1957. <if test="name != null">
  1958. and a.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1959. </if>
  1960. <if test="keyword != null">
  1961. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1962. </if>
  1963. <if test="category != null">
  1964. and a.category = #{category,jdbcType=INTEGER}
  1965. </if>
  1966. <if test="status != null">
  1967. and a.status = #{status,jdbcType=INTEGER}
  1968. </if>
  1969. <if test="rStart != null">
  1970. and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  1971. </if>
  1972. <if test="rEnd != null">
  1973. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  1974. </if>
  1975. <if test="cStart != null">
  1976. and a.create_time <![CDATA[ >= ]]> #{cStart,jdbcType=TIMESTAMP}
  1977. </if>
  1978. <if test="cEnd != null">
  1979. and a.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  1980. </if>
  1981. <if test="releaseStatus != null">
  1982. and a.release_status = #{releaseStatus,jdbcType=INTEGER}
  1983. </if>
  1984. <if test="boutique != null">
  1985. and a.boutique = #{boutique,jdbcType=INTEGER}
  1986. </if>
  1987. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  1988. and a.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  1989. </if>
  1990. <if test="hot != null and hot == 1"><!-- 在首页 -->
  1991. and mm.effective = 1
  1992. </if>
  1993. order by serial_number desc
  1994. <if test="page_sql!=null">
  1995. ${page_sql}
  1996. </if>
  1997. </select>
  1998. <select id="findManageAchievementCount" parameterType="String" resultType="java.lang.Integer">
  1999. select
  2000. count(1)
  2001. from achievement a
  2002. LEFT JOIN admin ad on ad.id = a.tech_broker_id
  2003. LEFT JOIN department_management dm on dm.id = ad.department_id
  2004. <!-- LEFT JOIN organization_identity oi on a.owner_id = oi.uid -->
  2005. <if test="adminId != null">
  2006. LEFT JOIN user u on a.owner_id = u.id
  2007. </if>
  2008. <if test="hot != null and hot == 1"><!-- 在首页 -->
  2009. inner join marketing_management mm on a.id = mm.product_id
  2010. </if>
  2011. <if test="hot == null"> <!-- 无首页参数 -->
  2012. left join marketing_management mm on a.id = mm.product_id
  2013. </if>
  2014. where a.deleted_sign = 0
  2015. <if test="ownerType != null">
  2016. and a.owner_type = #{ownerType,jdbcType=VARCHAR}
  2017. </if>
  2018. <if test="techBrokerId != null">
  2019. and (a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR} or ad.department_id=(select department_id from admin where id=#{techBrokerId,jdbcType=VARCHAR}))
  2020. </if>
  2021. <if test="ownerName != null">
  2022. and a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%')
  2023. </if>
  2024. <!-- <if test="unitName != null">
  2025. and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
  2026. </if> -->
  2027. <if test="ownerId != null">
  2028. and a.owner_id = #{ownerId,jdbcType=VARCHAR}
  2029. </if>
  2030. <if test="serialNumber != null">
  2031. and a.serial_number = #{serialNumber,jdbcType=INTEGER}
  2032. </if>
  2033. <if test="auditStatus != null">
  2034. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  2035. </if>
  2036. <if test="name != null">
  2037. and a.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  2038. </if>
  2039. <if test="keyword != null">
  2040. and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  2041. </if>
  2042. <if test="category != null">
  2043. and a.category = #{category,jdbcType=INTEGER}
  2044. </if>
  2045. <if test="status != null">
  2046. and a.status = #{status,jdbcType=INTEGER}
  2047. </if>
  2048. <if test="rStart != null">
  2049. and a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  2050. </if>
  2051. <if test="rEnd != null">
  2052. and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  2053. </if>
  2054. <if test="cStart != null">
  2055. and a.create_time <![CDATA[ >= ]]> #{cStart,jdbcType=TIMESTAMP}
  2056. </if>
  2057. <if test="cEnd != null">
  2058. and a.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  2059. </if>
  2060. <if test="releaseStatus != null">
  2061. and a.release_status = #{releaseStatus,jdbcType=INTEGER}
  2062. </if>
  2063. <if test="boutique != null">
  2064. and a.boutique = #{boutique,jdbcType=INTEGER}
  2065. </if>
  2066. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  2067. and a.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  2068. </if>
  2069. <if test="hot != null and hot == 1"><!-- 在首页 -->
  2070. and mm.effective = 1
  2071. </if>
  2072. </select>
  2073. </mapper>