PatentNewMapper.xml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683
  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.PatentNewMapper">
  4. <resultMap id="BaseResultMap"
  5. type="com.goafanti.common.model.PatentNew">
  6. <!-- WARNING - @mbg.generated This element is automatically generated by
  7. MyBatis Generator, do not modify. This element was generated on Mon Aug 09
  8. 14:41:21 CST 2021. -->
  9. <id column="id" jdbcType="INTEGER" property="id" />
  10. <result column="patent_no" jdbcType="VARCHAR"
  11. property="patentNo" />
  12. <result column="name" jdbcType="VARCHAR" property="name" />
  13. <result column="type" jdbcType="INTEGER" property="type" />
  14. <result column="status" jdbcType="INTEGER" property="status" />
  15. <result column="apply_date" jdbcType="DATE"
  16. property="applyDate" />
  17. <result column="authorization_date" jdbcType="DATE"
  18. property="authorizationDate" />
  19. <result column="patent_amount" jdbcType="DECIMAL"
  20. property="patentAmount" />
  21. <result column="applicant" jdbcType="VARCHAR"
  22. property="applicant" />
  23. <result column="province" jdbcType="INTEGER"
  24. property="province" />
  25. <result column="contact_mobile" jdbcType="VARCHAR"
  26. property="contactMobile" />
  27. <result column="email" jdbcType="VARCHAR" property="email" />
  28. <result column="certificate_url" jdbcType="VARCHAR"
  29. property="certificateUrl" />
  30. <result column="create_time" jdbcType="TIMESTAMP"
  31. property="createTime" />
  32. <result column="update_time" jdbcType="TIMESTAMP"
  33. property="updateTime" />
  34. <result column="aid" jdbcType="VARCHAR" property="aid" />
  35. <result column="years" jdbcType="INTEGER" property="years" />
  36. <result column="uid" jdbcType="VARCHAR" property="uid" />
  37. <result column="holders" jdbcType="VARCHAR" property="holders" />
  38. <result column="inventor" jdbcType="VARCHAR"
  39. property="inventor" />
  40. <result column="annual_fee_status" jdbcType="INTEGER"
  41. property="annualFeeStatus" />
  42. <result column="salesman_remind" jdbcType="INTEGER"
  43. property="salesmanRemind" />
  44. <result column="tid" jdbcType="INTEGER" property="tid" />
  45. <result column="new_type" jdbcType="INTEGER" property="newType" />
  46. <result column="delaying_amount" jdbcType="DECIMAL"
  47. property="delayingAmount" />
  48. <result column="recovery_amount" jdbcType="DECIMAL"
  49. property="recoveryAmount" />
  50. <result column="input_id" jdbcType="VARCHAR" property="inputId" />
  51. <result column="end_date" jdbcType="DATE" property="endDate" />
  52. </resultMap>
  53. <sql id="Base_Column_List">
  54. <!-- WARNING - @mbg.generated This element is automatically generated by
  55. MyBatis Generator, do not modify. This element was generated on Mon Aug 09
  56. 14:41:21 CST 2021. -->
  57. id, patent_no, `name`, `type`, `status`, apply_date,
  58. authorization_date, patent_amount,
  59. applicant, province, contact_mobile, email, certificate_url, create_time,
  60. update_time,
  61. aid, `years`, `uid`, holders, inventor, annual_fee_status,
  62. salesman_remind, tid,
  63. new_type, delaying_amount, recovery_amount, input_id, end_date
  64. </sql>
  65. <select id="selectByPrimaryKey"
  66. parameterType="java.lang.Integer" resultMap="BaseResultMap">
  67. <!-- WARNING - @mbg.generated This element is automatically generated by
  68. MyBatis Generator, do not modify. This element was generated on Mon Aug 09
  69. 14:41:21 CST 2021. -->
  70. select
  71. <include refid="Base_Column_List" />
  72. from patent_new
  73. where id = #{id,jdbcType=INTEGER}
  74. </select>
  75. <delete id="deleteByPrimaryKey"
  76. parameterType="java.lang.Integer">
  77. <!-- WARNING - @mbg.generated This element is automatically generated by
  78. MyBatis Generator, do not modify. This element was generated on Mon Aug 09
  79. 14:41:21 CST 2021. -->
  80. delete from patent_new
  81. where id = #{id,jdbcType=INTEGER}
  82. </delete>
  83. <insert id="insert"
  84. parameterType="com.goafanti.common.model.PatentNew">
  85. <!-- WARNING - @mbg.generated This element is automatically generated by
  86. MyBatis Generator, do not modify. This element was generated on Mon Aug 09
  87. 14:41:21 CST 2021. -->
  88. insert into patent_new (id, patent_no, `name`,
  89. `type`, `status`, apply_date,
  90. authorization_date, patent_amount, applicant,
  91. province, contact_mobile, email,
  92. certificate_url, create_time, update_time,
  93. aid, `years`, `uid`, holders,
  94. inventor, annual_fee_status, salesman_remind,
  95. tid, new_type, delaying_amount,
  96. recovery_amount, input_id, end_date
  97. )
  98. values (#{id,jdbcType=INTEGER}, #{patentNo,jdbcType=VARCHAR},
  99. #{name,jdbcType=VARCHAR},
  100. #{type,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{applyDate,jdbcType=DATE},
  101. #{authorizationDate,jdbcType=DATE}, #{patentAmount,jdbcType=DECIMAL},
  102. #{applicant,jdbcType=VARCHAR},
  103. #{province,jdbcType=INTEGER}, #{contactMobile,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR},
  104. #{certificateUrl,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
  105. #{updateTime,jdbcType=TIMESTAMP},
  106. #{aid,jdbcType=VARCHAR}, #{years,jdbcType=INTEGER}, #{uid,jdbcType=VARCHAR},
  107. #{holders,jdbcType=VARCHAR},
  108. #{inventor,jdbcType=VARCHAR}, #{annualFeeStatus,jdbcType=INTEGER},
  109. #{salesmanRemind,jdbcType=INTEGER},
  110. #{tid,jdbcType=INTEGER}, #{newType,jdbcType=INTEGER}, #{delayingAmount,jdbcType=DECIMAL},
  111. #{recoveryAmount,jdbcType=DECIMAL}, #{inputId,jdbcType=VARCHAR},
  112. #{endDate,jdbcType=DATE}
  113. )
  114. </insert>
  115. <insert id="insertSelective"
  116. parameterType="com.goafanti.common.model.PatentNew">
  117. <!-- WARNING - @mbg.generated This element is automatically generated by
  118. MyBatis Generator, do not modify. This element was generated on Mon Aug 09
  119. 14:41:21 CST 2021. -->
  120. insert into patent_new
  121. <trim prefix="(" suffix=")" suffixOverrides=",">
  122. <if test="id != null">
  123. id,
  124. </if>
  125. <if test="patentNo != null">
  126. patent_no,
  127. </if>
  128. <if test="name != null">
  129. `name`,
  130. </if>
  131. <if test="type != null">
  132. `type`,
  133. </if>
  134. <if test="status != null">
  135. `status`,
  136. </if>
  137. <if test="applyDate != null">
  138. apply_date,
  139. </if>
  140. <if test="authorizationDate != null">
  141. authorization_date,
  142. </if>
  143. <if test="patentAmount != null">
  144. patent_amount,
  145. </if>
  146. <if test="applicant != null">
  147. applicant,
  148. </if>
  149. <if test="province != null">
  150. province,
  151. </if>
  152. <if test="contactMobile != null">
  153. contact_mobile,
  154. </if>
  155. <if test="email != null">
  156. email,
  157. </if>
  158. <if test="certificateUrl != null">
  159. certificate_url,
  160. </if>
  161. <if test="createTime != null">
  162. create_time,
  163. </if>
  164. <if test="updateTime != null">
  165. update_time,
  166. </if>
  167. <if test="aid != null">
  168. aid,
  169. </if>
  170. <if test="years != null">
  171. `years`,
  172. </if>
  173. <if test="uid != null">
  174. `uid`,
  175. </if>
  176. <if test="holders != null">
  177. holders,
  178. </if>
  179. <if test="inventor != null">
  180. inventor,
  181. </if>
  182. <if test="annualFeeStatus != null">
  183. annual_fee_status,
  184. </if>
  185. <if test="salesmanRemind != null">
  186. salesman_remind,
  187. </if>
  188. <if test="tid != null">
  189. tid,
  190. </if>
  191. <if test="newType != null">
  192. new_type,
  193. </if>
  194. <if test="delayingAmount != null">
  195. delaying_amount,
  196. </if>
  197. <if test="recoveryAmount != null">
  198. recovery_amount,
  199. </if>
  200. <if test="inputId != null">
  201. input_id,
  202. </if>
  203. <if test="endDate != null">
  204. end_date,
  205. </if>
  206. </trim>
  207. <trim prefix="values (" suffix=")" suffixOverrides=",">
  208. <if test="id != null">
  209. #{id,jdbcType=INTEGER},
  210. </if>
  211. <if test="patentNo != null">
  212. #{patentNo,jdbcType=VARCHAR},
  213. </if>
  214. <if test="name != null">
  215. #{name,jdbcType=VARCHAR},
  216. </if>
  217. <if test="type != null">
  218. #{type,jdbcType=INTEGER},
  219. </if>
  220. <if test="status != null">
  221. #{status,jdbcType=INTEGER},
  222. </if>
  223. <if test="applyDate != null">
  224. #{applyDate,jdbcType=DATE},
  225. </if>
  226. <if test="authorizationDate != null">
  227. #{authorizationDate,jdbcType=DATE},
  228. </if>
  229. <if test="patentAmount != null">
  230. #{patentAmount,jdbcType=DECIMAL},
  231. </if>
  232. <if test="applicant != null">
  233. #{applicant,jdbcType=VARCHAR},
  234. </if>
  235. <if test="province != null">
  236. #{province,jdbcType=INTEGER},
  237. </if>
  238. <if test="contactMobile != null">
  239. #{contactMobile,jdbcType=VARCHAR},
  240. </if>
  241. <if test="email != null">
  242. #{email,jdbcType=VARCHAR},
  243. </if>
  244. <if test="certificateUrl != null">
  245. #{certificateUrl,jdbcType=VARCHAR},
  246. </if>
  247. <if test="createTime != null">
  248. #{createTime,jdbcType=TIMESTAMP},
  249. </if>
  250. <if test="updateTime != null">
  251. #{updateTime,jdbcType=TIMESTAMP},
  252. </if>
  253. <if test="aid != null">
  254. #{aid,jdbcType=VARCHAR},
  255. </if>
  256. <if test="years != null">
  257. #{years,jdbcType=INTEGER},
  258. </if>
  259. <if test="uid != null">
  260. #{uid,jdbcType=VARCHAR},
  261. </if>
  262. <if test="holders != null">
  263. #{holders,jdbcType=VARCHAR},
  264. </if>
  265. <if test="inventor != null">
  266. #{inventor,jdbcType=VARCHAR},
  267. </if>
  268. <if test="annualFeeStatus != null">
  269. #{annualFeeStatus,jdbcType=INTEGER},
  270. </if>
  271. <if test="salesmanRemind != null">
  272. #{salesmanRemind,jdbcType=INTEGER},
  273. </if>
  274. <if test="tid != null">
  275. #{tid,jdbcType=INTEGER},
  276. </if>
  277. <if test="newType != null">
  278. #{newType,jdbcType=INTEGER},
  279. </if>
  280. <if test="delayingAmount != null">
  281. #{delayingAmount,jdbcType=DECIMAL},
  282. </if>
  283. <if test="recoveryAmount != null">
  284. #{recoveryAmount,jdbcType=DECIMAL},
  285. </if>
  286. <if test="inputId != null">
  287. #{inputId,jdbcType=VARCHAR},
  288. </if>
  289. <if test="endDate != null">
  290. #{endDate,jdbcType=DATE},
  291. </if>
  292. </trim>
  293. </insert>
  294. <update id="updateByPrimaryKeySelective"
  295. parameterType="com.goafanti.common.model.PatentNew">
  296. <!-- WARNING - @mbg.generated This element is automatically generated by
  297. MyBatis Generator, do not modify. This element was generated on Mon Aug 09
  298. 14:41:21 CST 2021. -->
  299. update patent_new
  300. <set>
  301. <if test="patentNo != null">
  302. patent_no = #{patentNo,jdbcType=VARCHAR},
  303. </if>
  304. <if test="name != null">
  305. `name` = #{name,jdbcType=VARCHAR},
  306. </if>
  307. <if test="type != null">
  308. `type` = #{type,jdbcType=INTEGER},
  309. </if>
  310. <if test="status != null">
  311. `status` = #{status,jdbcType=INTEGER},
  312. </if>
  313. <if test="applyDate != null">
  314. apply_date = #{applyDate,jdbcType=DATE},
  315. </if>
  316. <if test="authorizationDate != null">
  317. authorization_date = #{authorizationDate,jdbcType=DATE},
  318. </if>
  319. <if test="patentAmount != null">
  320. patent_amount = #{patentAmount,jdbcType=DECIMAL},
  321. </if>
  322. <if test="applicant != null">
  323. applicant = #{applicant,jdbcType=VARCHAR},
  324. </if>
  325. <if test="province != null">
  326. province = #{province,jdbcType=INTEGER},
  327. </if>
  328. <if test="contactMobile != null">
  329. contact_mobile = #{contactMobile,jdbcType=VARCHAR},
  330. </if>
  331. <if test="email != null">
  332. email = #{email,jdbcType=VARCHAR},
  333. </if>
  334. <if test="certificateUrl != null">
  335. certificate_url = #{certificateUrl,jdbcType=VARCHAR},
  336. </if>
  337. <if test="createTime != null">
  338. create_time = #{createTime,jdbcType=TIMESTAMP},
  339. </if>
  340. <if test="updateTime != null">
  341. update_time = #{updateTime,jdbcType=TIMESTAMP},
  342. </if>
  343. <if test="aid != null">
  344. aid = #{aid,jdbcType=VARCHAR},
  345. </if>
  346. <if test="years != null">
  347. `years` = #{years,jdbcType=INTEGER},
  348. </if>
  349. <if test="uid != null">
  350. `uid` = #{uid,jdbcType=VARCHAR},
  351. </if>
  352. <if test="holders != null">
  353. holders = #{holders,jdbcType=VARCHAR},
  354. </if>
  355. <if test="inventor != null">
  356. inventor = #{inventor,jdbcType=VARCHAR},
  357. </if>
  358. <if test="annualFeeStatus != null">
  359. annual_fee_status = #{annualFeeStatus,jdbcType=INTEGER},
  360. </if>
  361. <if test="salesmanRemind != null">
  362. salesman_remind = #{salesmanRemind,jdbcType=INTEGER},
  363. </if>
  364. <if test="tid != null">
  365. tid = #{tid,jdbcType=INTEGER},
  366. </if>
  367. <if test="newType != null">
  368. new_type = #{newType,jdbcType=INTEGER},
  369. </if>
  370. <if test="delayingAmount != null">
  371. delaying_amount = #{delayingAmount,jdbcType=DECIMAL},
  372. </if>
  373. <if test="recoveryAmount != null">
  374. recovery_amount = #{recoveryAmount,jdbcType=DECIMAL},
  375. </if>
  376. <if test="inputId != null">
  377. input_id = #{inputId,jdbcType=VARCHAR},
  378. </if>
  379. <if test="endDate != null">
  380. end_date = #{endDate,jdbcType=DATE},
  381. </if>
  382. </set>
  383. where id = #{id,jdbcType=INTEGER}
  384. </update>
  385. <update id="updateByPrimaryKey"
  386. parameterType="com.goafanti.common.model.PatentNew">
  387. <!-- WARNING - @mbg.generated This element is automatically generated by
  388. MyBatis Generator, do not modify. This element was generated on Mon Aug 09
  389. 14:41:21 CST 2021. -->
  390. update patent_new
  391. set patent_no = #{patentNo,jdbcType=VARCHAR},
  392. `name` = #{name,jdbcType=VARCHAR},
  393. `type` = #{type,jdbcType=INTEGER},
  394. `status` = #{status,jdbcType=INTEGER},
  395. apply_date = #{applyDate,jdbcType=DATE},
  396. authorization_date = #{authorizationDate,jdbcType=DATE},
  397. patent_amount = #{patentAmount,jdbcType=DECIMAL},
  398. applicant = #{applicant,jdbcType=VARCHAR},
  399. province = #{province,jdbcType=INTEGER},
  400. contact_mobile = #{contactMobile,jdbcType=VARCHAR},
  401. email = #{email,jdbcType=VARCHAR},
  402. certificate_url = #{certificateUrl,jdbcType=VARCHAR},
  403. create_time = #{createTime,jdbcType=TIMESTAMP},
  404. update_time = #{updateTime,jdbcType=TIMESTAMP},
  405. aid = #{aid,jdbcType=VARCHAR},
  406. `years` = #{years,jdbcType=INTEGER},
  407. `uid` = #{uid,jdbcType=VARCHAR},
  408. holders = #{holders,jdbcType=VARCHAR},
  409. inventor = #{inventor,jdbcType=VARCHAR},
  410. annual_fee_status = #{annualFeeStatus,jdbcType=INTEGER},
  411. salesman_remind = #{salesmanRemind,jdbcType=INTEGER},
  412. tid = #{tid,jdbcType=INTEGER},
  413. new_type = #{newType,jdbcType=INTEGER},
  414. delaying_amount = #{delayingAmount,jdbcType=DECIMAL},
  415. recovery_amount = #{recoveryAmount,jdbcType=DECIMAL},
  416. input_id = #{inputId,jdbcType=VARCHAR},
  417. end_date = #{endDate,jdbcType=DATE}
  418. where id = #{id,jdbcType=INTEGER}
  419. </update>
  420. <select id="selectPatentNewList" resultType="com.goafanti.patent.bo.PatentNewBo">
  421. select a.id,a.patent_no as patentNo,a.name,a.type,a.status,a.holders,a.inventor,ifnull(c.cost_reduction,0) costReduction ,
  422. a.annual_fee_status annualFeeStatus,date_format(a.apply_date,'%Y-%m-%d') applyDates,
  423. a.uid,a.salesman_remind salesmanRemind,a.email,a.province,a.years ,a.certificate_url as certificateUrl,
  424. date_format(a.authorization_date ,'%Y-%m-%d ')authorizationDates,a.aid ,
  425. a.applicant,a.contact_mobile as contactMobile,date_format(a.end_date,'%Y-%m-%d') as endDates,
  426. date_format(a.create_time,'%Y-%m-%d %H:%I:%S') as createTimeS,a.apply_date as applyDate,
  427. date_format(a.update_time,'%Y-%m-%d %H:%I:%S') as updateTimeS,b.name as aname,tm.buyer_name userName,
  428. a.patent_amount as patentAmount,a.delaying_amount delayingAmount ,a.recovery_amount
  429. recoveryAmount, c.commodity_name projectName , c.id tid,tm.salesman_name salesmanName ,
  430. c.receiver_name techName, tm.dep_name depName,ia.name inputName
  431. from patent_new a left join admin b on a.aid=b.id
  432. left join t_order_task c on a.tid =c.id left join t_order_mid tm on c.order_no =tm.order_no
  433. left join admin ia on a.input_id =ia.id
  434. <if test="shiro ==1">
  435. left join admin e on e.department_id=c.id
  436. </if>
  437. where 1=1
  438. <if test="shiro ==0">
  439. <if test="isFollow ==1">
  440. and a.aid = #{aid,jdbcType=VARCHAR}
  441. </if>
  442. <if test="isFollow ==0">
  443. and a.input_id = #{aid,jdbcType=VARCHAR}
  444. </if>
  445. </if>
  446. <if test="shiro ==1">
  447. and e.id = #{aid,jdbcType=VARCHAR}
  448. </if>
  449. <if test="status != null">
  450. and a.status=#{status}
  451. </if>
  452. <if test="type != null">
  453. and a.type=#{type}
  454. </if>
  455. <if test="startDates != null and endDates != null">
  456. and a.apply_date between #{startDates} and #{endDates}
  457. </if>
  458. <if test="createStarts != null and createEnds != null">
  459. and a.create_time between #{createStarts} and #{createEnds}
  460. </if>
  461. <if test="name != null">
  462. and a.name like concat('%',#{name},'%')
  463. </if>
  464. <if test="patentNo != null">
  465. and a.patent_no like concat('%',#{patentNo},'%')
  466. </if>
  467. <if test="annualFeeStatus != null">
  468. and a.annual_fee_status = #{annualFeeStatus}
  469. </if>
  470. <if test="userName != null">
  471. and tm.buyer_name like concat('%',#{userName},'%')
  472. </if>
  473. <if test="aname != null">
  474. and b.name like concat('%',#{aname},'%')
  475. </if>
  476. <if test="depName != null">
  477. and tm.dep_name in
  478. <foreach close=")" collection="depName" item="deps" open="(" separator=",">
  479. #{deps}
  480. </foreach>
  481. </if>
  482. <if test="inputDep != null">
  483. and ia.department_id in
  484. <foreach close=")" collection="inputDep" item="deps" open="(" separator=",">
  485. #{deps}
  486. </foreach>
  487. </if>
  488. <if test="followDep != null">
  489. and b.department_id in
  490. <foreach close=")" collection="followDep" item="deps" open="(" separator=",">
  491. #{deps}
  492. </foreach>
  493. </if>
  494. <if test="salesmanRemind !=null">
  495. and a.salesman_remind= #{salesmanRemind}
  496. </if>
  497. order by a.status ,a.create_time
  498. <if test="page_sql!=null">
  499. ${page_sql}
  500. </if>
  501. </select>
  502. <select id="selectPatentNewCount" resultType="java.lang.Integer">
  503. select count(*)
  504. from patent_new a left join admin b on a.aid=b.id
  505. left join t_order_task c on a.tid =c.id left join t_order_mid tm on
  506. c.order_no =tm.order_no
  507. left join admin ia on a.input_id =ia.id
  508. <if test="shiro ==1">
  509. left join admin e on e.department_id=c.id
  510. </if>
  511. where 1=1
  512. <if test="shiro ==0">
  513. <if test="isFollow ==1">
  514. and a.aid = #{aid,jdbcType=VARCHAR}
  515. </if>
  516. <if test="isFollow ==0">
  517. and a.input_id = #{aid,jdbcType=VARCHAR}
  518. </if>
  519. </if>
  520. <if test="shiro ==1">
  521. and e.id = #{aid,jdbcType=VARCHAR}
  522. </if>
  523. <if test="status != null">
  524. and a.status=#{status}
  525. </if>
  526. <if test="type != null">
  527. and a.type=#{type}
  528. </if>
  529. <if test="startDates != null and endDates != null">
  530. and a.apply_date between #{startDates} and #{endDates}
  531. </if>
  532. <if test="createStarts != null and createEnds != null">
  533. and a.create_time between #{createStarts} and #{createEnds}
  534. </if>
  535. <if test="name != null">
  536. and a.name like concat('%',#{name},'%')
  537. </if>
  538. <if test="patentNo != null">
  539. and a.patent_no like concat('%',#{patentNo},'%')
  540. </if>
  541. <if test="annualFeeStatus != null">
  542. and a.annual_fee_status = #{annualFeeStatus}
  543. </if>
  544. <if test="userName != null">
  545. and tm.buyer_name like concat('%',#{userName},'%')
  546. </if>
  547. <if test="aname != null">
  548. and b.name like concat('%',#{aname},'%')
  549. </if>
  550. <if test="depName != null">
  551. and tm.dep_name in
  552. <foreach close=")" collection="depName" item="deps" open="(" separator=",">
  553. #{deps}
  554. </foreach>
  555. </if>
  556. <if test="inputDep != null">
  557. and ia.department_id in
  558. <foreach close=")" collection="inputDep" item="deps" open="(" separator=",">
  559. #{deps}
  560. </foreach>
  561. </if>
  562. <if test="followDep != null">
  563. and b.department_id in
  564. <foreach close=")" collection="followDep" item="deps" open="(" separator=",">
  565. #{deps}
  566. </foreach>
  567. </if>
  568. <if test="salesmanRemind !=null">
  569. and a.salesman_remind= #{salesmanRemind}
  570. </if>
  571. </select>
  572. <select id="AllselectStartPatentNew" resultType="com.goafanti.patent.bo.PatentNewBo">
  573. select
  574. a.id,a.patent_no patentNo,a.name ,a.aid ,a.email ,a.end_date endDate,a.status
  575. ,c.buyer_name userName,a.salesman_remind salesmanRemind
  576. from patent_new a left join t_order_task b on a.tid =b.id left join
  577. t_order_mid c on b.order_no=c.order_no where a.status &lt; 6
  578. </select>
  579. <select id="AllselectEndPatentNew" resultMap="BaseResultMap">
  580. select
  581. <include refid="Base_Column_List" />
  582. from patent_new where status =1
  583. </select>
  584. <update id="updateAdmin">
  585. update patent_new set aid= #{transferId}
  586. where aid= #{aid}
  587. </update>
  588. <insert id="insertBatch">
  589. insert into patent_new (id, patent_no, `name`,
  590. `type`, `status`, apply_date,
  591. authorization_date, patent_amount, applicant,
  592. province, contact_mobile, email,
  593. certificate_url, create_time, update_time,
  594. aid, `years`, `uid`, holders,
  595. inventor, end_date,
  596. tid, new_type,
  597. input_id)
  598. values
  599. <foreach collection="list" index="index" item="item"
  600. separator=",">
  601. (#{item.id,jdbcType=INTEGER}, #{item.patentNo,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR},
  602. #{item.type,jdbcType=INTEGER}, #{item.status,jdbcType=INTEGER},
  603. #{item.applyDate,jdbcType=DATE},
  604. #{item.authorizationDate,jdbcType=DATE},
  605. #{item.patentAmount,jdbcType=DECIMAL},
  606. #{item.applicant,jdbcType=VARCHAR},
  607. #{item.province,jdbcType=INTEGER},
  608. #{item.contactMobile,jdbcType=VARCHAR},
  609. #{item.email,jdbcType=VARCHAR},
  610. #{item.certificateUrl,jdbcType=VARCHAR},
  611. #{item.createTime,jdbcType=TIMESTAMP},
  612. #{item.updateTime,jdbcType=TIMESTAMP},
  613. #{item.aid,jdbcType=VARCHAR}, #{item.years,jdbcType=INTEGER}, #{item.uid,jdbcType=VARCHAR},
  614. #{item.holders,jdbcType=VARCHAR},
  615. #{item.inventor,jdbcType=VARCHAR}, #{item.endDate,jdbcType=DATE},
  616. #{item.tid,jdbcType=INTEGER}, #{item.newType,jdbcType=INTEGER},
  617. #{item.inputId,jdbcType=VARCHAR})
  618. </foreach>
  619. </insert>
  620. <select id="selectByPatenNo" resultType="java.lang.Integer">
  621. select count(*) from patent_new where patent_no = #{patenNo}
  622. </select>
  623. <select id="selectByYear" resultMap="BaseResultMap">
  624. select
  625. <include refid="Base_Column_List" />
  626. from patent_new where years = #{year}
  627. </select>
  628. <update id="updateBatch">
  629. update patent_new
  630. set salesman_remind=1
  631. where id in
  632. <foreach item="item" collection="list" open="(" separator=","
  633. close=")">
  634. #{item}
  635. </foreach>
  636. </update>
  637. <update id="updateBatchByid">
  638. update patent_new
  639. <set>
  640. <if test="status != null">
  641. status= #{status},
  642. </if>
  643. <if test="aid != null">
  644. aid= #{aid},
  645. </if>
  646. </set>
  647. where id in
  648. <foreach item="item" collection="list" open="(" separator=","
  649. close=")">
  650. #{item}
  651. </foreach>
  652. </update>
  653. <select id="selectByids" resultMap="BaseResultMap">
  654. select
  655. <include refid="Base_Column_List" />
  656. from patent_new
  657. where id in
  658. <foreach item="item" collection="list" open="(" separator=","
  659. close=")">
  660. #{item}
  661. </foreach>
  662. </select>
  663. <select id="selectByTid" resultMap="BaseResultMap">
  664. select
  665. <include refid="Base_Column_List" />
  666. from patent_new
  667. where tid = #{tid}
  668. </select>
  669. <select id="selectUserNameByTid" resultType="java.lang.String">
  670. select b.buyer_name userName from t_order_task a left join t_order_mid b on
  671. a.order_no =b.order_no
  672. where a.id = #{tid}
  673. </select>
  674. </mapper>