CopyrightInfoMapper.xml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419
  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.CopyrightInfoMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.CopyrightInfo">
  5. <id column="id" jdbcType="VARCHAR" property="id" />
  6. <result column="uid" jdbcType="VARCHAR" property="uid" />
  7. <result column="serial_number" jdbcType="INTEGER" property="serialNumber" />
  8. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  9. <result column="accept_time" jdbcType="TIMESTAMP" property="acceptTime" />
  10. <result column="principal" jdbcType="VARCHAR" property="principal" />
  11. <result column="contact" jdbcType="INTEGER" property="contact" />
  12. <result column="copyright_info" jdbcType="VARCHAR" property="copyrightInfo" />
  13. <result column="copyright_name" jdbcType="VARCHAR" property="copyrightName" />
  14. <result column="status" jdbcType="INTEGER" property="status" />
  15. <result column="work_issue" jdbcType="VARCHAR" property="workIssue" />
  16. <result column="comment" jdbcType="VARCHAR" property="comment" />
  17. <result column="outsource" jdbcType="VARCHAR" property="outsource" />
  18. <result column="in_urgent" jdbcType="INTEGER" property="inUrgent" />
  19. <result column="authorized_date" jdbcType="TIMESTAMP" property="authorizedDate" />
  20. <result column="certificate_url" jdbcType="VARCHAR" property="certificateUrl" />
  21. <result column="copyright_number" jdbcType="VARCHAR" property="copyrightNumber" />
  22. <result column="application_url" jdbcType="VARCHAR" property="applicationUrl" />
  23. <result column="delete_sign" jdbcType="INTEGER" property="deleteSign" />
  24. <result column="founder" jdbcType="VARCHAR" property="founder" />
  25. </resultMap>
  26. <sql id="Base_Column_List">
  27. id, uid, serial_number, create_time, accept_time, principal, contact, copyright_info,
  28. copyright_name, status, work_issue, comment, outsource, in_urgent, authorized_date,
  29. certificate_url, application_url, delete_sign, copyright_number, founder
  30. </sql>
  31. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  32. select
  33. <include refid="Base_Column_List" />
  34. from copyright_info
  35. where id = #{id,jdbcType=VARCHAR}
  36. </select>
  37. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  38. delete from copyright_info
  39. where id = #{id,jdbcType=VARCHAR}
  40. </delete>
  41. <insert id="insert" parameterType="com.goafanti.common.model.CopyrightInfo">
  42. insert into copyright_info (id, uid, serial_number,
  43. create_time, accept_time, principal,
  44. contact, copyright_info, copyright_name,
  45. status, work_issue, comment,
  46. outsource, in_urgent, authorized_date,
  47. certificate_url, copyright_number, application_url, delete_sign, founder
  48. )
  49. values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{serialNumber,jdbcType=INTEGER},
  50. #{createTime,jdbcType=TIMESTAMP}, #{acceptTime,jdbcType=TIMESTAMP}, #{principal,jdbcType=VARCHAR},
  51. #{contact,jdbcType=INTEGER}, #{copyrightInfo,jdbcType=VARCHAR}, #{copyrightName,jdbcType=VARCHAR},
  52. #{status,jdbcType=INTEGER}, #{workIssue,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR},
  53. #{outsource,jdbcType=VARCHAR}, #{inUrgent,jdbcType=INTEGER}, #{authorizedDate,jdbcType=TIMESTAMP},
  54. #{certificateUrl,jdbcType=VARCHAR},
  55. #{copyrightNumber,jdbcType=VARCHAR},
  56. #{applicationUrl,jdbcType=VARCHAR}, #{deleteSign,jdbcType=INTEGER}, #{founder,jdbcType=VARCHAR}
  57. )
  58. </insert>
  59. <insert id="insertSelective" parameterType="com.goafanti.common.model.CopyrightInfo">
  60. insert into copyright_info
  61. <trim prefix="(" suffix=")" suffixOverrides=",">
  62. <if test="id != null">
  63. id,
  64. </if>
  65. <if test="uid != null">
  66. uid,
  67. </if>
  68. <if test="serialNumber != null">
  69. serial_number,
  70. </if>
  71. <if test="createTime != null">
  72. create_time,
  73. </if>
  74. <if test="acceptTime != null">
  75. accept_time,
  76. </if>
  77. <if test="principal != null">
  78. principal,
  79. </if>
  80. <if test="contact != null">
  81. contact,
  82. </if>
  83. <if test="copyrightInfo != null">
  84. copyright_info,
  85. </if>
  86. <if test="copyrightName != null">
  87. copyright_name,
  88. </if>
  89. <if test="status != null">
  90. status,
  91. </if>
  92. <if test="workIssue != null">
  93. work_issue,
  94. </if>
  95. <if test="comment != null">
  96. comment,
  97. </if>
  98. <if test="outsource != null">
  99. outsource,
  100. </if>
  101. <if test="inUrgent != null">
  102. in_urgent,
  103. </if>
  104. <if test="authorizedDate != null">
  105. authorized_date,
  106. </if>
  107. <if test="certificateUrl != null">
  108. certificate_url,
  109. </if>
  110. <if test="copyrightNumber != null">
  111. copyright_number,
  112. </if>
  113. <if test="applicationUrl != null">
  114. application_url,
  115. </if>
  116. <if test="deleteSign != null">
  117. delete_sign,
  118. </if>
  119. <if test="founder != null">
  120. founder,
  121. </if>
  122. </trim>
  123. <trim prefix="values (" suffix=")" suffixOverrides=",">
  124. <if test="id != null">
  125. #{id,jdbcType=VARCHAR},
  126. </if>
  127. <if test="uid != null">
  128. #{uid,jdbcType=VARCHAR},
  129. </if>
  130. <if test="serialNumber != null">
  131. #{serialNumber,jdbcType=INTEGER},
  132. </if>
  133. <if test="createTime != null">
  134. #{createTime,jdbcType=TIMESTAMP},
  135. </if>
  136. <if test="acceptTime != null">
  137. #{acceptTime,jdbcType=TIMESTAMP},
  138. </if>
  139. <if test="principal != null">
  140. #{principal,jdbcType=VARCHAR},
  141. </if>
  142. <if test="contact != null">
  143. #{contact,jdbcType=INTEGER},
  144. </if>
  145. <if test="copyrightInfo != null">
  146. #{copyrightInfo,jdbcType=VARCHAR},
  147. </if>
  148. <if test="copyrightName != null">
  149. #{copyrightName,jdbcType=VARCHAR},
  150. </if>
  151. <if test="status != null">
  152. #{status,jdbcType=INTEGER},
  153. </if>
  154. <if test="workIssue != null">
  155. #{workIssue,jdbcType=VARCHAR},
  156. </if>
  157. <if test="comment != null">
  158. #{comment,jdbcType=VARCHAR},
  159. </if>
  160. <if test="outsource != null">
  161. #{outsource,jdbcType=VARCHAR},
  162. </if>
  163. <if test="inUrgent != null">
  164. #{inUrgent,jdbcType=INTEGER},
  165. </if>
  166. <if test="authorizedDate != null">
  167. #{authorizedDate,jdbcType=TIMESTAMP},
  168. </if>
  169. <if test="certificateUrl != null">
  170. #{certificateUrl,jdbcType=VARCHAR},
  171. </if>
  172. <if test="copyrightNumber != null">
  173. #{copyrightNumber,jdbcType=VARCHAR},
  174. </if>
  175. <if test="applicationUrl != null">
  176. #{applicationUrl,jdbcType=VARCHAR},
  177. </if>
  178. <if test="deleteSign != null">
  179. #{deleteSign,jdbcType=INTEGER},
  180. </if>
  181. <if test="founder != null">
  182. #{founder,jdbcType=VARCHAR},
  183. </if>
  184. </trim>
  185. </insert>
  186. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.CopyrightInfo">
  187. update copyright_info
  188. <set>
  189. <if test="uid != null">
  190. uid = #{uid,jdbcType=VARCHAR},
  191. </if>
  192. <if test="serialNumber != null">
  193. serial_number = #{serialNumber,jdbcType=INTEGER},
  194. </if>
  195. <if test="createTime != null">
  196. create_time = #{createTime,jdbcType=TIMESTAMP},
  197. </if>
  198. <if test="acceptTime != null">
  199. accept_time = #{acceptTime,jdbcType=TIMESTAMP},
  200. </if>
  201. <if test="principal != null">
  202. principal = #{principal,jdbcType=VARCHAR},
  203. </if>
  204. <if test="contact != null">
  205. contact = #{contact,jdbcType=INTEGER},
  206. </if>
  207. <if test="copyrightInfo != null">
  208. copyright_info = #{copyrightInfo,jdbcType=VARCHAR},
  209. </if>
  210. <if test="copyrightName != null">
  211. copyright_name = #{copyrightName,jdbcType=VARCHAR},
  212. </if>
  213. <if test="status != null">
  214. status = #{status,jdbcType=INTEGER},
  215. </if>
  216. <if test="workIssue != null">
  217. work_issue = #{workIssue,jdbcType=VARCHAR},
  218. </if>
  219. <if test="comment != null">
  220. comment = #{comment,jdbcType=VARCHAR},
  221. </if>
  222. <if test="outsource != null">
  223. outsource = #{outsource,jdbcType=VARCHAR},
  224. </if>
  225. <if test="inUrgent != null">
  226. in_urgent = #{inUrgent,jdbcType=INTEGER},
  227. </if>
  228. <if test="authorizedDate != null">
  229. authorized_date = #{authorizedDate,jdbcType=TIMESTAMP},
  230. </if>
  231. <if test="certificateUrl != null">
  232. certificate_url = #{certificateUrl,jdbcType=VARCHAR},
  233. </if>
  234. <if test="copyrightNumber != null">
  235. copyright_number = #{copyrightNumber,jdbcType=VARCHAR},
  236. </if>
  237. <if test="applicationUrl != null">
  238. application_url = #{applicationUrl,jdbcType=VARCHAR},
  239. </if>
  240. <if test="deleteSign != null">
  241. delete_sign = #{deleteSign,jdbcType=INTEGER},
  242. </if>
  243. <if test="founder != null">
  244. founder = #{founder,jdbcType=VARCHAR},
  245. </if>
  246. </set>
  247. where id = #{id,jdbcType=VARCHAR}
  248. </update>
  249. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.CopyrightInfo">
  250. update copyright_info
  251. set uid = #{uid,jdbcType=VARCHAR},
  252. serial_number = #{serialNumber,jdbcType=INTEGER},
  253. create_time = #{createTime,jdbcType=TIMESTAMP},
  254. accept_time = #{acceptTime,jdbcType=TIMESTAMP},
  255. principal = #{principal,jdbcType=VARCHAR},
  256. contact = #{contact,jdbcType=INTEGER},
  257. copyright_info = #{copyrightInfo,jdbcType=VARCHAR},
  258. copyright_name = #{copyrightName,jdbcType=VARCHAR},
  259. status = #{status,jdbcType=INTEGER},
  260. work_issue = #{workIssue,jdbcType=VARCHAR},
  261. comment = #{comment,jdbcType=VARCHAR},
  262. outsource = #{outsource,jdbcType=VARCHAR},
  263. in_urgent = #{inUrgent,jdbcType=INTEGER},
  264. authorized_date = #{authorizedDate,jdbcType=TIMESTAMP},
  265. certificate_url = #{certificateUrl,jdbcType=VARCHAR},
  266. copyright_number = #{copyrightNumber,jdbcType=VARCHAR},
  267. application_url = #{applicationUrl,jdbcType=VARCHAR},
  268. delete_sign = #{deleteSign,jdbcType=INTEGER},
  269. founder = #{founder,jdbcType=VARCHAR}
  270. where id = #{id,jdbcType=VARCHAR}
  271. </update>
  272. <select id="findListByPage" resultType="com.goafanti.copyright.bo.CopyrightInfoSummary" parameterType="String">
  273. select ci.id,ci.uid,ci.serial_number as serialNumber, ci.create_time as createTime,
  274. ci.accept_time as acceptTime, ci.contact,
  275. ci.copyright_name as copyrightName, ci.status, ci.comment, ci.outsource, ci.in_urgent as inUrgent,
  276. ci.authorized_date as authorizedDate, ci.work_issue as workIssue, ci.copyright_number as copyrightNumber,
  277. oi.licence_province as province,oi.unit_name as unitName,
  278. concat(oi.first_contacts,' ', oi.first_mobile) as firstContact,
  279. concat(oi.second_contacts,' ', oi.second_mobile) as secondContact,
  280. concat(oi.third_contacts,' ', oi.third_mobile) as thirdContact,
  281. a.name as principal, ad.name as founder
  282. from copyright_info ci
  283. left join organization_identity oi on ci.uid = oi.uid
  284. left join admin a on ci.principal = a.id
  285. left join admin ad on ci.founder = ad.id
  286. <if test="principal != null">
  287. left join copyright_log cl on ci.id=cl.cid
  288. </if>
  289. where ci.delete_sign = 0
  290. <if test="principal != null">
  291. and cl.principal = #{principal,jdbcType=VARCHAR}
  292. </if>
  293. <if test="province != null">
  294. and oi.licence_province = #{province,jdbcType=VARCHAR}
  295. </if>
  296. <if test="status != null">
  297. and ci.status = #{status,jdbcType=INTEGER}
  298. </if>
  299. <if test="unitName != null">
  300. and oi.unit_name like CONCAT('%', #{unitName,jdbcType=VARCHAR}, '%')
  301. </if>
  302. <if test="unitId != null">
  303. and ci.uid = #{unitId,jdbcType=VARCHAR}
  304. </if>
  305. <if test="copyrightName != null">
  306. and ci.copyright_name like CONCAT('%', #{copyrightName,jdbcType=VARCHAR}, '%')
  307. </if>
  308. <if test="createStartTime != null">
  309. and ci.create_time <![CDATA[ >= ]]> #{createStartTime,jdbcType=TIMESTAMP}
  310. </if>
  311. <if test="createEndTime != null">
  312. and ci.create_time <![CDATA[ < ]]> #{createEndTime,jdbcType=TIMESTAMP}
  313. </if>
  314. <if test="acceptStartTime != null">
  315. and ci.accept_time <![CDATA[ >= ]]> #{acceptStartTime,jdbcType=TIMESTAMP}
  316. </if>
  317. <if test="acceptEndTime != null">
  318. and ci.accept_time <![CDATA[ < ]]> #{acceptEndTime,jdbcType=TIMESTAMP}
  319. </if>
  320. <if test="authStartTime != null">
  321. and ci.authorized_date <![CDATA[ >= ]]> #{authStartTime,jdbcType=TIMESTAMP}
  322. </if>
  323. <if test="authEndTime != null">
  324. and ci.authorized_date <![CDATA[ < ]]> #{authEndTime,jdbcType=TIMESTAMP}
  325. </if>
  326. <if test="principal != null">
  327. group by ci.id
  328. </if>
  329. order by ci.serial_number desc
  330. <if test="page_sql!=null">
  331. ${page_sql}
  332. </if>
  333. </select>
  334. <select id="findListCount" resultType="java.lang.Integer" parameterType="String">
  335. select count(*)
  336. from copyright_info ci
  337. left join organization_identity oi on ci.uid = oi.uid
  338. <if test="principal != null">
  339. left join copyright_log cl on ci.id=cl.cid
  340. </if>
  341. where ci.delete_sign = 0
  342. <if test="principal != null">
  343. and cl.principal = #{principal,jdbcType=VARCHAR}
  344. </if>
  345. <if test="province != null">
  346. and oi.licence_province = #{province,jdbcType=VARCHAR}
  347. </if>
  348. <if test="status != null">
  349. and ci.status = #{status,jdbcType=INTEGER}
  350. </if>
  351. <if test="unitName != null">
  352. and oi.unit_name like CONCAT('%', #{unitName,jdbcType=VARCHAR}, '%')
  353. </if>
  354. <if test="unitId != null">
  355. and ci.uid = #{unitId,jdbcType=VARCHAR}
  356. </if>
  357. <if test="copyrightName != null">
  358. and ci.copyright_name like CONCAT('%', #{copyrightName,jdbcType=VARCHAR}, '%')
  359. </if>
  360. <if test="createStartTime != null">
  361. and ci.create_time <![CDATA[ >= ]]> #{createStartTime,jdbcType=TIMESTAMP}
  362. </if>
  363. <if test="createEndTime != null">
  364. and ci.create_time <![CDATA[ < ]]> #{createEndTime,jdbcType=TIMESTAMP}
  365. </if>
  366. <if test="acceptStartTime != null">
  367. and ci.accept_time <![CDATA[ >= ]]> #{acceptStartTime,jdbcType=TIMESTAMP}
  368. </if>
  369. <if test="acceptEndTime != null">
  370. and ci.accept_time <![CDATA[ < ]]> #{acceptEndTime,jdbcType=TIMESTAMP}
  371. </if>
  372. <if test="authStartTime != null">
  373. and ci.authorized_date <![CDATA[ >= ]]> #{authStartTime,jdbcType=TIMESTAMP}
  374. </if>
  375. <if test="authEndTime != null">
  376. and ci.authorized_date <![CDATA[ < ]]> #{authEndTime,jdbcType=TIMESTAMP}
  377. </if>
  378. <if test="principal != null">
  379. group by ci.id
  380. </if>
  381. </select>
  382. <update id="deleteByPrimaryKeys" parameterType="java.util.List">
  383. update copyright_info set delete_sign = 1
  384. where id in
  385. <foreach item="item" index="index" collection="list" open="(" separator="," close=")">
  386. #{item}
  387. </foreach>
  388. </update>
  389. <select id="findByPrimaryKey" parameterType="java.lang.String" resultType="com.goafanti.copyright.bo.CopyrightInfoDetail">
  390. select ci.id,ci.uid,ci.serial_number as serialNumber, ci.create_time as createTime,
  391. ci.accept_time as acceptTime, ci.contact, ci.copyright_name as copyrightName, ci.copyright_info as copyrightInfo,
  392. ci.status, ci.comment, ci.outsource, ci.in_urgent as inUrgent, ci.authorized_date as authorizedDate, ci.copyright_number as copyrightNumber,
  393. ci.work_issue as workIssue,ci.application_url as applicationUrl,ci.certificate_url as certificateUrl,
  394. oi.licence_province as province, oi.licence_city as city,oi.licence_area as area, oi.postal_address as postalAddress, oi.postcode,
  395. oi.unit_name as unitName, oi.org_code as orgCode,
  396. concat(oi.first_contacts,' ', oi.first_mobile) as firstContact,
  397. concat(oi.second_contacts,' ', oi.second_mobile) as secondContact,
  398. concat(oi.third_contacts,' ', oi.third_mobile) as thirdContact,
  399. a.name as principal
  400. from copyright_info ci
  401. left join organization_identity oi on ci.uid = oi.uid
  402. left join admin a on ci.principal = a.id
  403. where ci.id = #{id,jdbcType=VARCHAR}
  404. </select>
  405. <select id="selectByPrimaryKeys" parameterType="java.lang.String" resultMap="BaseResultMap">
  406. select
  407. <include refid="Base_Column_List" />
  408. from copyright_info where id in
  409. <foreach item="item" index="index" collection="list" open="("
  410. separator="," close=")">
  411. #{item}
  412. </foreach>
  413. </select>
  414. </mapper>