PatentInfoMapper.xml 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747
  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.PatentInfoMapper" >
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.PatentInfo" >
  5. <id column="id" property="id" jdbcType="VARCHAR" />
  6. <result column="uid" property="uid" jdbcType="VARCHAR" />
  7. <result column="serial_number" property="serialNumber" jdbcType="INTEGER" />
  8. <result column="patent_number" property="patentNumber" jdbcType="VARCHAR" />
  9. <result column="patent_name" property="patentName" jdbcType="VARCHAR" />
  10. <result column="patent_catagory" property="patentCatagory" jdbcType="INTEGER" />
  11. <result column="patent_state" property="patentState" jdbcType="INTEGER" />
  12. <result column="patent_field" property="patentField" jdbcType="INTEGER" />
  13. <result column="patent_des" property="patentDes" jdbcType="VARCHAR" />
  14. <result column="patent_prory_statement_url" property="patentProryStatementUrl" jdbcType="VARCHAR" />
  15. <result column="patent_writing_url" property="patentWritingUrl" jdbcType="VARCHAR" />
  16. <result column="authorization_notice_url" property="authorizationNoticeUrl" jdbcType="VARCHAR" />
  17. <result column="patent_certificate_url" property="patentCertificateUrl" jdbcType="VARCHAR" />
  18. <result column="patent_application_date" property="patentApplicationDate" jdbcType="TIMESTAMP" />
  19. <result column="first_inventor_name" property="firstInventorName" jdbcType="VARCHAR" />
  20. <result column="first_inventor_nationality" property="firstInventorNationality" jdbcType="VARCHAR" />
  21. <result column="first_inventor_id_number" property="firstInventorIdNumber" jdbcType="VARCHAR" />
  22. <result column="first_inventor_is_publish" property="firstInventorIsPublish" jdbcType="INTEGER" />
  23. <result column="second_inventor_name" property="secondInventorName" jdbcType="VARCHAR" />
  24. <result column="second_inventor_nationality" property="secondInventorNationality" jdbcType="VARCHAR" />
  25. <result column="second_inventor_is_publish" property="secondInventorIsPublish" jdbcType="INTEGER" />
  26. <result column="third_inventor_name" property="thirdInventorName" jdbcType="VARCHAR" />
  27. <result column="third_inventor_nationality" property="thirdInventorNationality" jdbcType="VARCHAR" />
  28. <result column="third_inventor_is_publish" property="thirdInventorIsPublish" jdbcType="INTEGER" />
  29. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  30. <result column="author" property="author" jdbcType="VARCHAR" />
  31. <result column="authorized_date" property="authorizedDate" jdbcType="TIMESTAMP" />
  32. <result column="office" property="office" jdbcType="VARCHAR" />
  33. <result column="principal" property="principal" jdbcType="VARCHAR" />
  34. <result column="confirm_state" property="confirmState" jdbcType="INTEGER" />
  35. <result column="record_time" property="recordTime" jdbcType="TIMESTAMP" />
  36. <result column="deleted_sign" property="deletedSign" jdbcType="INTEGER" />
  37. </resultMap>
  38. <sql id="Base_Column_List" >
  39. id, uid, serial_number, patent_number, patent_name, patent_catagory, patent_state,
  40. patent_field, patent_des, patent_prory_statement_url, patent_writing_url, authorization_notice_url,
  41. patent_certificate_url, patent_application_date, first_inventor_name, first_inventor_nationality,
  42. first_inventor_id_number, first_inventor_is_publish, second_inventor_name, second_inventor_nationality,
  43. second_inventor_is_publish, third_inventor_name, third_inventor_nationality, third_inventor_is_publish,
  44. create_time, author, authorized_date,office, principal ,confirm_state, record_time, deleted_sign
  45. </sql>
  46. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
  47. select
  48. <include refid="Base_Column_List" />
  49. from patent_info
  50. where id = #{id,jdbcType=VARCHAR}
  51. </select>
  52. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
  53. delete from patent_info
  54. where id = #{id,jdbcType=VARCHAR}
  55. </delete>
  56. <insert id="insert" parameterType="com.goafanti.common.model.PatentInfo" >
  57. insert into patent_info (id, uid, serial_number,
  58. patent_number, patent_name, patent_catagory,
  59. patent_state, patent_field, patent_des,
  60. patent_prory_statement_url, patent_writing_url,
  61. authorization_notice_url, patent_certificate_url,
  62. patent_application_date, first_inventor_name,
  63. first_inventor_nationality, first_inventor_id_number,
  64. first_inventor_is_publish, second_inventor_name,
  65. second_inventor_nationality, second_inventor_is_publish,
  66. third_inventor_name, third_inventor_nationality,
  67. third_inventor_is_publish, create_time, author, authorized_date,
  68. office, principal, confirm_state, record_time, deleted_sign)
  69. values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{serialNumber,jdbcType=INTEGER},
  70. #{patentNumber,jdbcType=VARCHAR}, #{patentName,jdbcType=VARCHAR}, #{patentCatagory,jdbcType=INTEGER},
  71. #{patentState,jdbcType=INTEGER}, #{patentField,jdbcType=INTEGER}, #{patentDes,jdbcType=VARCHAR},
  72. #{patentProryStatementUrl,jdbcType=VARCHAR}, #{patentWritingUrl,jdbcType=VARCHAR},
  73. #{authorizationNoticeUrl,jdbcType=VARCHAR}, #{patentCertificateUrl,jdbcType=VARCHAR},
  74. #{patentApplicationDate,jdbcType=TIMESTAMP}, #{firstInventorName,jdbcType=VARCHAR},
  75. #{firstInventorNationality,jdbcType=VARCHAR}, #{firstInventorIdNumber,jdbcType=VARCHAR},
  76. #{firstInventorIsPublish,jdbcType=INTEGER}, #{secondInventorName,jdbcType=VARCHAR},
  77. #{secondInventorNationality,jdbcType=VARCHAR}, #{secondInventorIsPublish,jdbcType=INTEGER},
  78. #{thirdInventorName,jdbcType=VARCHAR}, #{thirdInventorNationality,jdbcType=VARCHAR},
  79. #{thirdInventorIsPublish,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{author,jdbcType=VARCHAR},
  80. #{authorizedDate,jdbcType=TIMESTAMP},
  81. #{office,jdbcType=VARCHAR}, #{principal,jdbcType=VARCHAR}, #{recordTime,jdbcType=TIMESTAMP},
  82. #{confirmState,jdbcType=INTEGER}, #{deletedSign,jdbcType=INTEGER})
  83. </insert>
  84. <insert id="insertSelective" parameterType="com.goafanti.common.model.PatentInfo" >
  85. insert into patent_info
  86. <trim prefix="(" suffix=")" suffixOverrides="," >
  87. <if test="id != null" >
  88. id,
  89. </if>
  90. <if test="uid != null" >
  91. uid,
  92. </if>
  93. <if test="serialNumber != null" >
  94. serial_number,
  95. </if>
  96. <if test="patentNumber != null" >
  97. patent_number,
  98. </if>
  99. <if test="patentName != null" >
  100. patent_name,
  101. </if>
  102. <if test="patentCatagory != null" >
  103. patent_catagory,
  104. </if>
  105. <if test="patentState != null" >
  106. patent_state,
  107. </if>
  108. <if test="patentField != null" >
  109. patent_field,
  110. </if>
  111. <if test="patentDes != null" >
  112. patent_des,
  113. </if>
  114. <if test="patentProryStatementUrl != null" >
  115. patent_prory_statement_url,
  116. </if>
  117. <if test="patentWritingUrl != null" >
  118. patent_writing_url,
  119. </if>
  120. <if test="authorizationNoticeUrl != null" >
  121. authorization_notice_url,
  122. </if>
  123. <if test="patentCertificateUrl != null" >
  124. patent_certificate_url,
  125. </if>
  126. <if test="patentApplicationDate != null" >
  127. patent_application_date,
  128. </if>
  129. <if test="firstInventorName != null" >
  130. first_inventor_name,
  131. </if>
  132. <if test="firstInventorNationality != null" >
  133. first_inventor_nationality,
  134. </if>
  135. <if test="firstInventorIdNumber != null" >
  136. first_inventor_id_number,
  137. </if>
  138. <if test="firstInventorIsPublish != null" >
  139. first_inventor_is_publish,
  140. </if>
  141. <if test="secondInventorName != null" >
  142. second_inventor_name,
  143. </if>
  144. <if test="secondInventorNationality != null" >
  145. second_inventor_nationality,
  146. </if>
  147. <if test="secondInventorIsPublish != null" >
  148. second_inventor_is_publish,
  149. </if>
  150. <if test="thirdInventorName != null" >
  151. third_inventor_name,
  152. </if>
  153. <if test="thirdInventorNationality != null" >
  154. third_inventor_nationality,
  155. </if>
  156. <if test="thirdInventorIsPublish != null" >
  157. third_inventor_is_publish,
  158. </if>
  159. <if test="createTime != null" >
  160. create_time,
  161. </if>
  162. <if test="author != null" >
  163. author,
  164. </if>
  165. <if test="authorizedDate != null" >
  166. authorized_date,
  167. </if>
  168. <if test="office != null" >
  169. office,
  170. </if>
  171. <if test="principal != null" >
  172. principal,
  173. </if>
  174. <if test="confirmState != null">
  175. confirm_state,
  176. </if>
  177. <if test="recordTime != null">
  178. record_time,
  179. </if>
  180. <if test="deletedSign != null">
  181. deleted_sign,
  182. </if>
  183. </trim>
  184. <trim prefix="values (" suffix=")" suffixOverrides="," >
  185. <if test="id != null" >
  186. #{id,jdbcType=VARCHAR},
  187. </if>
  188. <if test="uid != null" >
  189. #{uid,jdbcType=VARCHAR},
  190. </if>
  191. <if test="serialNumber != null" >
  192. #{serialNumber,jdbcType=INTEGER},
  193. </if>
  194. <if test="patentNumber != null" >
  195. #{patentNumber,jdbcType=VARCHAR},
  196. </if>
  197. <if test="patentName != null" >
  198. #{patentName,jdbcType=VARCHAR},
  199. </if>
  200. <if test="patentCatagory != null" >
  201. #{patentCatagory,jdbcType=INTEGER},
  202. </if>
  203. <if test="patentState != null" >
  204. #{patentState,jdbcType=INTEGER},
  205. </if>
  206. <if test="patentField != null" >
  207. #{patentField,jdbcType=INTEGER},
  208. </if>
  209. <if test="patentDes != null" >
  210. #{patentDes,jdbcType=VARCHAR},
  211. </if>
  212. <if test="patentProryStatementUrl != null" >
  213. #{patentProryStatementUrl,jdbcType=VARCHAR},
  214. </if>
  215. <if test="patentWritingUrl != null" >
  216. #{patentWritingUrl,jdbcType=VARCHAR},
  217. </if>
  218. <if test="authorizationNoticeUrl != null" >
  219. #{authorizationNoticeUrl,jdbcType=VARCHAR},
  220. </if>
  221. <if test="patentCertificateUrl != null" >
  222. #{patentCertificateUrl,jdbcType=VARCHAR},
  223. </if>
  224. <if test="patentApplicationDate != null" >
  225. #{patentApplicationDate,jdbcType=TIMESTAMP},
  226. </if>
  227. <if test="firstInventorName != null" >
  228. #{firstInventorName,jdbcType=VARCHAR},
  229. </if>
  230. <if test="firstInventorNationality != null" >
  231. #{firstInventorNationality,jdbcType=VARCHAR},
  232. </if>
  233. <if test="firstInventorIdNumber != null" >
  234. #{firstInventorIdNumber,jdbcType=VARCHAR},
  235. </if>
  236. <if test="firstInventorIsPublish != null" >
  237. #{firstInventorIsPublish,jdbcType=INTEGER},
  238. </if>
  239. <if test="secondInventorName != null" >
  240. #{secondInventorName,jdbcType=VARCHAR},
  241. </if>
  242. <if test="secondInventorNationality != null" >
  243. #{secondInventorNationality,jdbcType=VARCHAR},
  244. </if>
  245. <if test="secondInventorIsPublish != null" >
  246. #{secondInventorIsPublish,jdbcType=INTEGER},
  247. </if>
  248. <if test="thirdInventorName != null" >
  249. #{thirdInventorName,jdbcType=VARCHAR},
  250. </if>
  251. <if test="thirdInventorNationality != null" >
  252. #{thirdInventorNationality,jdbcType=VARCHAR},
  253. </if>
  254. <if test="thirdInventorIsPublish != null" >
  255. #{thirdInventorIsPublish,jdbcType=INTEGER},
  256. </if>
  257. <if test="createTime != null" >
  258. #{createTime,jdbcType=TIMESTAMP},
  259. </if>
  260. <if test="author != null" >
  261. #{author,jdbcType=VARCHAR},
  262. </if>
  263. <if test="authorizedDate != null" >
  264. #{authorizedDate,jdbcType=TIMESTAMP},
  265. </if>
  266. <if test="office != null" >
  267. #{office,jdbcType=VARCHAR},
  268. </if>
  269. <if test="principal != null" >
  270. #{principal,jdbcType=VARCHAR},
  271. </if>
  272. <if test="confirmState != null">
  273. #{confirmState,jdbcType=INTEGER},
  274. </if>
  275. <if test="recordTime != null" >
  276. #{recordTime,jdbcType=TIMESTAMP},
  277. </if>
  278. <if test="deletedSign != null">
  279. #{deletedSign,jdbcType=INTEGER},
  280. </if>
  281. </trim>
  282. </insert>
  283. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PatentInfo" >
  284. update patent_info
  285. <set >
  286. <if test="uid != null" >
  287. uid = #{uid,jdbcType=VARCHAR},
  288. </if>
  289. <if test="serialNumber != null" >
  290. serial_number = #{serialNumber,jdbcType=INTEGER},
  291. </if>
  292. <if test="patentNumber != null" >
  293. patent_number = #{patentNumber,jdbcType=VARCHAR},
  294. </if>
  295. <if test="patentName != null" >
  296. patent_name = #{patentName,jdbcType=VARCHAR},
  297. </if>
  298. <if test="patentCatagory != null" >
  299. patent_catagory = #{patentCatagory,jdbcType=INTEGER},
  300. </if>
  301. <if test="patentState != null" >
  302. patent_state = #{patentState,jdbcType=INTEGER},
  303. </if>
  304. <if test="patentField != null" >
  305. patent_field = #{patentField,jdbcType=INTEGER},
  306. </if>
  307. <if test="patentDes != null" >
  308. patent_des = #{patentDes,jdbcType=VARCHAR},
  309. </if>
  310. <if test="patentProryStatementUrl != null" >
  311. patent_prory_statement_url = #{patentProryStatementUrl,jdbcType=VARCHAR},
  312. </if>
  313. <if test="patentWritingUrl != null" >
  314. patent_writing_url = #{patentWritingUrl,jdbcType=VARCHAR},
  315. </if>
  316. <if test="authorizationNoticeUrl != null" >
  317. authorization_notice_url = #{authorizationNoticeUrl,jdbcType=VARCHAR},
  318. </if>
  319. <if test="patentCertificateUrl != null" >
  320. patent_certificate_url = #{patentCertificateUrl,jdbcType=VARCHAR},
  321. </if>
  322. <if test="patentApplicationDate != null" >
  323. patent_application_date = #{patentApplicationDate,jdbcType=TIMESTAMP},
  324. </if>
  325. <if test="firstInventorName != null" >
  326. first_inventor_name = #{firstInventorName,jdbcType=VARCHAR},
  327. </if>
  328. <if test="firstInventorNationality != null" >
  329. first_inventor_nationality = #{firstInventorNationality,jdbcType=VARCHAR},
  330. </if>
  331. <if test="firstInventorIdNumber != null" >
  332. first_inventor_id_number = #{firstInventorIdNumber,jdbcType=VARCHAR},
  333. </if>
  334. <if test="firstInventorIsPublish != null" >
  335. first_inventor_is_publish = #{firstInventorIsPublish,jdbcType=INTEGER},
  336. </if>
  337. <if test="secondInventorName != null" >
  338. second_inventor_name = #{secondInventorName,jdbcType=VARCHAR},
  339. </if>
  340. <if test="secondInventorNationality != null" >
  341. second_inventor_nationality = #{secondInventorNationality,jdbcType=VARCHAR},
  342. </if>
  343. <if test="secondInventorIsPublish != null" >
  344. second_inventor_is_publish = #{secondInventorIsPublish,jdbcType=INTEGER},
  345. </if>
  346. <if test="thirdInventorName != null" >
  347. third_inventor_name = #{thirdInventorName,jdbcType=VARCHAR},
  348. </if>
  349. <if test="thirdInventorNationality != null" >
  350. third_inventor_nationality = #{thirdInventorNationality,jdbcType=VARCHAR},
  351. </if>
  352. <if test="thirdInventorIsPublish != null" >
  353. third_inventor_is_publish = #{thirdInventorIsPublish,jdbcType=INTEGER},
  354. </if>
  355. <if test="createTime != null" >
  356. create_time = #{createTime,jdbcType=TIMESTAMP},
  357. </if>
  358. <if test="author != null" >
  359. author = #{author,jdbcType=VARCHAR},
  360. </if>
  361. <if test="authorizedDate != null" >
  362. authorized_date = #{authorizedDate,jdbcType=TIMESTAMP},
  363. </if>
  364. <if test="office != null" >
  365. office = #{office,jdbcType=VARCHAR},
  366. </if>
  367. <if test="principal != null" >
  368. principal = #{principal,jdbcType=VARCHAR},
  369. </if>
  370. <if test="confirmState != null">
  371. confirm_state = #{confirmState,jdbcType=INTEGER},
  372. </if>
  373. <if test="recordTime != null" >
  374. record_time = #{recordTime,jdbcType=TIMESTAMP},
  375. </if>
  376. <if test="deletedSign != null">
  377. deleted_sign = #{deletedSign,jdbcType=INTEGER},
  378. </if>
  379. </set>
  380. where id = #{id,jdbcType=VARCHAR}
  381. </update>
  382. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.PatentInfo" >
  383. update patent_info
  384. set uid = #{uid,jdbcType=VARCHAR},
  385. serial_number = #{serialNumber,jdbcType=INTEGER},
  386. patent_number = #{patentNumber,jdbcType=VARCHAR},
  387. patent_name = #{patentName,jdbcType=VARCHAR},
  388. patent_catagory = #{patentCatagory,jdbcType=INTEGER},
  389. patent_state = #{patentState,jdbcType=INTEGER},
  390. patent_field = #{patentField,jdbcType=INTEGER},
  391. patent_des = #{patentDes,jdbcType=VARCHAR},
  392. patent_prory_statement_url = #{patentProryStatementUrl,jdbcType=VARCHAR},
  393. patent_writing_url = #{patentWritingUrl,jdbcType=VARCHAR},
  394. authorization_notice_url = #{authorizationNoticeUrl,jdbcType=VARCHAR},
  395. patent_certificate_url = #{patentCertificateUrl,jdbcType=VARCHAR},
  396. patent_application_date = #{patentApplicationDate,jdbcType=TIMESTAMP},
  397. first_inventor_name = #{firstInventorName,jdbcType=VARCHAR},
  398. first_inventor_nationality = #{firstInventorNationality,jdbcType=VARCHAR},
  399. first_inventor_id_number = #{firstInventorIdNumber,jdbcType=VARCHAR},
  400. first_inventor_is_publish = #{firstInventorIsPublish,jdbcType=INTEGER},
  401. second_inventor_name = #{secondInventorName,jdbcType=VARCHAR},
  402. second_inventor_nationality = #{secondInventorNationality,jdbcType=VARCHAR},
  403. second_inventor_is_publish = #{secondInventorIsPublish,jdbcType=INTEGER},
  404. third_inventor_name = #{thirdInventorName,jdbcType=VARCHAR},
  405. third_inventor_nationality = #{thirdInventorNationality,jdbcType=VARCHAR},
  406. third_inventor_is_publish = #{thirdInventorIsPublish,jdbcType=INTEGER},
  407. create_time = #{createTime,jdbcType=TIMESTAMP},
  408. author = #{author,jdbcType=VARCHAR},
  409. authorized_date = #{authorizedDate,jdbcType=TIMESTAMP},
  410. office = #{office,jdbcType=VARCHAR},
  411. principal = #{principal,jdbcType=VARCHAR},
  412. confirm_state = #{confirmState,jdbcType=INTEGER},
  413. record_time = #{recordTime,jdbcType=TIMESTAMP},
  414. deleted_sign = #{deletedSign,jdbcType=INTEGER}
  415. where id = #{id,jdbcType=VARCHAR}
  416. </update>
  417. <select id="selectPatentInfoByUserId" parameterType="java.lang.String" resultMap="BaseResultMap">
  418. select
  419. <include refid="Base_Column_List" />
  420. from patent_info
  421. where uid = #{uid,jdbcType=VARCHAR} and deleted_sign = 0
  422. </select>
  423. <select id="findClientApplyListByPage" resultMap="BaseResultMap" parameterType="String">
  424. select
  425. <include refid="Base_Column_List" />
  426. from patent_info
  427. where deleted_sign = 0
  428. <if test ="uid != null">
  429. and uid = #{uid,jdbcType=VARCHAR}
  430. </if>
  431. <if test = "patentNumber != null" >
  432. and patent_number = #{patentNumber,jdbcType=VARCHAR}
  433. </if>
  434. <if test = "patentName != null">
  435. and patent_name like "%"#{patentName,jdbcType=VARCHAR}"%"
  436. </if>
  437. <if test = "patentCatagory != null">
  438. and patent_catagory = #{patentCatagory,jdbcType=INTEGER}
  439. </if>
  440. <if test = "patentState != nulll">
  441. and patent_state = #{patentState,jdbcType=INTEGER}
  442. </if>
  443. order by serial_number desc
  444. <if test="page_sql!=null">
  445. ${page_sql}
  446. </if>
  447. </select>
  448. <select id="findClentApplyCount" resultType="java.lang.Integer" parameterType="String">
  449. select count(1)
  450. from patent_info
  451. where deleted_sign = 0
  452. <if test ="uid != null">
  453. and uid = #{uid,jdbcType=VARCHAR}
  454. </if>
  455. <if test = "patentNumber != null" >
  456. and patent_number = #{patentNumber,jdbcType=VARCHAR}
  457. </if>
  458. <if test = "patentName != null">
  459. and patent_name like "%"#{patentName,jdbcType=VARCHAR}"%"
  460. </if>
  461. <if test = "patentCatagory != null">
  462. and patent_catagory = #{patentCatagory,jdbcType=INTEGER}
  463. </if>
  464. <if test = "patentState != nulll">
  465. and patent_state = #{patentState,jdbcType=INTEGER}
  466. </if>
  467. </select>
  468. <select id="findManagePatentListByPage" resultType="com.goafanti.techservice.patent.bo.PatentCompositeBo" parameterType="String">
  469. select a.name as author,x.uid ,
  470. x.oid ,x.pid ,
  471. x.serialNumber,x.patentNumber,
  472. x.office , x.unitName ,
  473. x.patentCatagory , x.patentName ,
  474. x.patentState , x.createTime ,
  475. x.patentApplicationDate,x.authorizedDate ,
  476. x.orgCode , x.locationProvince ,
  477. x.locationCity , x.locationArea ,
  478. x.contacts , x.patentField ,
  479. x.patentDes ,x.firstInventorName,
  480. x.firstInventorNationality , x.firstInventorIdNumber ,
  481. x.secondInventorName, x.secondInventorNationality ,
  482. x.thirdInventorName , x.thirdInventorNationality ,
  483. x.patentProryStatementUrl, x.lastYearTaxReportUrl ,
  484. x.patentWritingUrl, x.authorizationNoticeUrl,
  485. x.patentCertificateUrl from
  486. (select u.id as uid ,o.id as oid , p.id as pid , p.serial_number as serialNumber , p.patent_number as patentNumber , p.office ,
  487. o.unit_name as unitName,
  488. p.patent_catagory as patentCatagory,p.patent_name as patentName,p.patent_state as patentState,p.create_time as createTime,
  489. p.patent_application_date as patentApplicationDate,
  490. p.authorized_date as authorizedDate, p.author, o.org_code as orgCode, o.location_province as locationProvince,
  491. o.location_city as locationCity, o.location_area as locationArea,
  492. o.contacts, u.number, p.patent_field as patentField, p.patent_des as patentDes , p.first_inventor_name as firstInventorName,
  493. p.first_inventor_nationality as firstInventorNationality,
  494. p.first_inventor_id_number as firstInventorIdNumber, p.second_inventor_name as secondInventorName ,
  495. p.second_inventor_nationality as secondInventorNationality , p.third_inventor_name as thirdInventorName,
  496. p.third_inventor_nationality as thirdInventorNationality , p.patent_prory_statement_url as patentProryStatementUrl ,
  497. o.last_year_tax_report_url as lastYearTaxReportUrl, p.patent_writing_url as patentWritingUrl ,
  498. p.authorization_notice_url as authorizationNoticeUrl ,
  499. p.patent_certificate_url as patentCertificateUrl
  500. from user u
  501. LEFT JOIN organization_identity o
  502. on u.id = o.uid
  503. INNER JOIN patent_info p
  504. on u.id = p.uid
  505. where deleted_sign = 0
  506. <if test="serialNumber != null">
  507. and p.serial_number = #{serialNumber,jdbcType=INTEGER}
  508. </if>
  509. <if test="patentNumber != null">
  510. and p.patent_number = #{patentNumber,jdbcType=VARCHAR}
  511. </if>
  512. <if test="office != null">
  513. and p.office = #{office,jdbcType=VARCHAR}
  514. </if>
  515. <if test="unitName != null">
  516. and o.unit_name= #{unitName,jdbcType=VARCHAR}
  517. </if>
  518. <if test="patentCatagory != null">
  519. and p.patent_catagory= #{patentCatagory,jdbcType=INTEGER}
  520. </if>
  521. <if test="patentName != null">
  522. and p.patent_name= #{patentName,jdbcType=VARCHAR}
  523. </if>
  524. <if test="patentState != null">
  525. and p.patent_state= #{patentState,jdbcType=INTEGER}
  526. </if>
  527. <if test="cStart != null">
  528. and
  529. p.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
  530. </if>
  531. <if test="cEnd != null">
  532. and
  533. p.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  534. </if>
  535. <if test="pStart != null">
  536. and
  537. p.patent_application_date <![CDATA[ > ]]> #{pStart,jdbcType=TIMESTAMP}
  538. </if>
  539. <if test="pEnd != null">
  540. and
  541. p.patent_application_date <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
  542. </if>
  543. <if test="author != null">
  544. and p.author = #{author,jdbcType=VARCHAR}
  545. </if>
  546. <if test="locationProvince != null">
  547. and o.location_province = #{locationProvince,jdbcType=VARCHAR}
  548. </if>
  549. ) x
  550. LEFT JOIN admin a on a.id = x.author order by x.serialNumber desc
  551. <if test="page_sql!=null">
  552. ${page_sql}
  553. </if>
  554. </select>
  555. <select id="findManagePatentCount" resultType="java.lang.Integer" parameterType="String">
  556. select count(1) from
  557. (select p.author
  558. from user u
  559. LEFT JOIN organization_identity o
  560. on u.id = o.uid
  561. INNER JOIN patent_info p
  562. on u.id = p.uid
  563. where p.deleted_sign = 0
  564. <if test="serialNumber != null">
  565. and p.serial_number = #{serialNumber,jdbcType=INTEGER}
  566. </if>
  567. <if test="patentNumber != null">
  568. and p.patent_number = #{patentNumber,jdbcType=VARCHAR}
  569. </if>
  570. <if test="office != null">
  571. and p.office = #{office,jdbcType=VARCHAR}
  572. </if>
  573. <if test="unitName != null">
  574. and o.unit_name= #{unitName,jdbcType=VARCHAR}
  575. </if>
  576. <if test="patentCatagory != null">
  577. and p.patent_catagory= #{patentCatagory,jdbcType=INTEGER}
  578. </if>
  579. <if test="patentName != null">
  580. and p.patent_name= #{patentName,jdbcType=VARCHAR}
  581. </if>
  582. <if test="patentState != null">
  583. and p.patent_state= #{patentState,jdbcType=INTEGER}
  584. </if>
  585. <if test="cStart != null">
  586. and
  587. p.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
  588. </if>
  589. <if test="cEnd != null">
  590. and
  591. p.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  592. </if>
  593. <if test="pStart != null">
  594. and
  595. p.patent_application_date <![CDATA[ > ]]> #{pStart,jdbcType=TIMESTAMP}
  596. </if>
  597. <if test="pEnd != null">
  598. and
  599. p.patent_application_date <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
  600. </if>
  601. <if test="author != null">
  602. and p.author = #{author,jdbcType=VARCHAR}
  603. </if>
  604. <if test="locationProvince != null">
  605. and o.location_province=#{locationProvince,jdbcType=VARCHAR}
  606. </if>
  607. ) x
  608. LEFT JOIN admin a on a.id = x.author
  609. </select>
  610. <select id="findManagePendingPaymentListByPage" resultType="com.goafanti.techservice.patent.bo.PatentPendingBo" parameterType="String">
  611. select n.*,c.id as cid ,c.annual_fee_state as annualFeeState
  612. from patent_cost c INNER JOIN
  613. (select u.id as uid , p.id as pid ,o.id as oid , p.serial_number as serialNumber ,p.patent_number as patentNumber ,
  614. o.location_province as locationProvince , o.unit_name as unitName , p.patent_name as patentName,
  615. p.patent_catagory as patentCatagory ,p.patent_state as patentState , p.authorized_date as authorizedDate,
  616. p.record_time as recordTime
  617. from user u
  618. LEFT JOIN organization_identity o on o.uid = u.id
  619. INNER JOIN patent_info p on u.id =p.uid where p.deleted_sign = 0
  620. <if test="locationProvince != null">
  621. and o.location_province = #{locationProvince,jdbcType=VARCHAR}
  622. </if>
  623. ) n
  624. on n.pid= c.pid where c.annual_fee_state=0
  625. order by n.serialNumber DESC
  626. <if test="page_sql!=null">
  627. ${page_sql}
  628. </if>
  629. </select>
  630. <select id="findManagePendingPaymentCount" resultType="java.lang.Integer" parameterType="String">
  631. select count(1) from
  632. patent_cost c INNER JOIN
  633. (select p.id as pid
  634. from user u
  635. LEFT JOIN organization_identity o on o.uid = u.id
  636. INNER JOIN patent_info p on u.id = p.uid where p.deleted_sign = 0
  637. <if test="locationProvince != null">
  638. and o.location_province = #{locationProvince,jdbcType=VARCHAR}
  639. </if>
  640. ) n
  641. on n.pid= c.pid where c.annual_fee_state=0
  642. </select>
  643. <select id="findNoticeOfCorrectionListByPage" parameterType="String" resultType="com.goafanti.techservice.patent.bo.PatentNoticeOfCorrectionBo">
  644. select u.id as uid ,p.id as pid , o.id as oid , p.serial_number as serialNumber , p.patent_number as patentNumber ,
  645. p.patent_name as patentName , p.office ,
  646. o.location_province as locationProvince ,o.unit_name as unitName , p.patent_catagory as patentCatagory ,
  647. p.patent_state as patentState , p.author , p.authorized_date as authorizedDate
  648. FROM user u
  649. LEFT JOIN organization_identity o ON u.id = o.uid
  650. INNER JOIN patent_info p on u.id = p.uid
  651. where p.patent_state in (4,6) and p.deleted_sign = 0
  652. <if test="serialNumber != null">
  653. and p.serial_number = #{serialNumber,jdbcType=INTEGER}
  654. </if>
  655. <if test="patentNumber != null">
  656. and p.patent_number = #{patentNumber,jdbcType=VARCHAR}
  657. </if>
  658. <if test="office != null">
  659. and p.office = #{office,jdbcType=VARCHAR}
  660. </if>
  661. <if test="unitName != null">
  662. and o.unit_name= #{unitName,jdbcType=VARCHAR}
  663. </if>
  664. <if test="patentCatagory != null">
  665. and p.patent_catagory= #{patentCatagory,jdbcType=INTEGER}
  666. </if>
  667. <if test="patentName != null">
  668. and p.patent_name= #{patentName,jdbcType=VARCHAR}
  669. </if>
  670. <if test="patentState != null">
  671. and p.patent_state= #{patentState,jdbcType=INTEGER}
  672. </if>
  673. <if test="authorizedDate != null">
  674. and p.authorized_date = #{authorizedDate,jdbcType=TIMESTAMP}
  675. </if>
  676. <if test="author != null">
  677. and p.author = #{author,jdbcType=VARCHAR}
  678. </if>
  679. <if test="locationProvince != null">
  680. and o.location_province=#{locationProvince,jdbcType=VARCHAR}
  681. </if>
  682. order by p.serial_number DESC
  683. <if test="page_sql!=null">
  684. ${page_sql}
  685. </if>
  686. </select>
  687. <select id="findNoticeOfCorrectionCount" resultType="java.lang.Integer" parameterType="String">
  688. select count(1) from user u
  689. LEFT JOIN organization_identity o ON u.id = o.uid
  690. INNER JOIN patent_info p on u.id = p.uid
  691. where p.patent_state in (4,6) and p.deleted_sign = 0
  692. <if test="serialNumber != null">
  693. and p.serial_number = #{serialNumber,jdbcType=INTEGER}
  694. </if>
  695. <if test="patentNumber != null">
  696. and p.patent_number = #{patentNumber,jdbcType=VARCHAR}
  697. </if>
  698. <if test="office != null">
  699. and p.office = #{office,jdbcType=VARCHAR}
  700. </if>
  701. <if test="unitName != null">
  702. and o.unit_name= #{unitName,jdbcType=VARCHAR}
  703. </if>
  704. <if test="patentCatagory != null">
  705. and p.patent_catagory= #{patentCatagory,jdbcType=INTEGER}
  706. </if>
  707. <if test="patentName != null">
  708. and p.patent_name= #{patentName,jdbcType=VARCHAR}
  709. </if>
  710. <if test="patentState != null">
  711. and p.patent_state= #{patentState,jdbcType=INTEGER}
  712. </if>
  713. <if test="authorizedDate != null">
  714. and p.authorized_date = #{authorizedDate,jdbcType=TIMESTAMP}
  715. </if>
  716. <if test="author != null">
  717. and p.author = #{author,jdbcType=VARCHAR}
  718. </if>
  719. <if test="locationProvince != null">
  720. and o.location_province=#{locationProvince,jdbcType=VARCHAR}
  721. </if>
  722. </select>
  723. <update id="batchDeleteByPrimaryKey" parameterType="java.util.List">
  724. update patent_info set deleted_sign = 1
  725. where id in
  726. <foreach item="item" index="index" collection="list" open="(" separator="," close=")">
  727. #{item}
  728. </foreach>
  729. </update>
  730. </mapper>