CopyrightInfoMapper.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  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="application_url" jdbcType="VARCHAR" property="applicationUrl" />
  22. <result column="delete_sign" jdbcType="INTEGER" property="deleteSign" />
  23. </resultMap>
  24. <sql id="Base_Column_List">
  25. id, uid, serial_number, create_time, accept_time, principal, contact, copyright_info,
  26. copyright_name, status, work_issue, comment, outsource, in_urgent, authorized_date,
  27. certificate_url, application_url, delete_sign
  28. </sql>
  29. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  30. select
  31. <include refid="Base_Column_List" />
  32. from copyright_info
  33. where id = #{id,jdbcType=VARCHAR}
  34. </select>
  35. <select id="findByPrimaryKey" parameterType="java.lang.String" resultType="com.goafanti.copyright.bo.CopyrightInfoDetail">
  36. select ci.id,ci.uid,ci.serial_number as serialNumber, ci.create_time as createTime,
  37. ci.accept_time as acceptTime, ci.contact, ci.copyright_name as copyrightName,
  38. ci.status, ci.comment, ci.outsource, ci.in_urgent as inUrgent, ci.authorized_date as authorizedDate,
  39. ci.work_issue as workIssue,ci.application_url as applicationUrl,ci.certificate_url as certificateUrl,
  40. oi.location_province as province, oi.location_city as city,oi.location_area as area, oi.postcode,
  41. oi.unit_name as unitName,
  42. concat(oi.first_contacts,' ', oi.first_mobile) as firstContact,
  43. concat(oi.second_contacts,' ', oi.second_mobile) as secondContact,
  44. concat(oi.third_contacts,' ', oi.third_mobile) as thirdContact,
  45. a.name as principal
  46. from copyright_info ci
  47. left join organization_identity oi on ci.uid = oi.uid
  48. left join admin a on ci.principal = a.id
  49. where ci.id = #{id,jdbcType=VARCHAR}
  50. </select>
  51. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  52. delete from copyright_info
  53. where id = #{id,jdbcType=VARCHAR}
  54. </delete>
  55. <insert id="insert" parameterType="com.goafanti.common.model.CopyrightInfo">
  56. insert into copyright_info (id, uid, serial_number,
  57. create_time, accept_time, principal,
  58. contact, copyright_info, copyright_name,
  59. status, work_issue, comment,
  60. outsource, in_urgent, authorized_date,
  61. certificate_url, application_url, delete_sign
  62. )
  63. values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{serialNumber,jdbcType=INTEGER},
  64. #{createTime,jdbcType=TIMESTAMP}, #{acceptTime,jdbcType=TIMESTAMP}, #{principal,jdbcType=VARCHAR},
  65. #{contact,jdbcType=INTEGER}, #{copyrightInfo,jdbcType=VARCHAR}, #{copyrightName,jdbcType=VARCHAR},
  66. #{status,jdbcType=INTEGER}, #{workIssue,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR},
  67. #{outsource,jdbcType=VARCHAR}, #{inUrgent,jdbcType=INTEGER}, #{authorizedDate,jdbcType=TIMESTAMP},
  68. #{certificateUrl,jdbcType=VARCHAR}, #{applicationUrl,jdbcType=VARCHAR}, #{deleteSign,jdbcType=INTEGER}
  69. )
  70. </insert>
  71. <insert id="insertSelective" parameterType="com.goafanti.common.model.CopyrightInfo">
  72. insert into copyright_info
  73. <trim prefix="(" suffix=")" suffixOverrides=",">
  74. <if test="id != null">
  75. id,
  76. </if>
  77. <if test="uid != null">
  78. uid,
  79. </if>
  80. <if test="serialNumber != null">
  81. serial_number,
  82. </if>
  83. <if test="createTime != null">
  84. create_time,
  85. </if>
  86. <if test="acceptTime != null">
  87. accept_time,
  88. </if>
  89. <if test="principal != null">
  90. principal,
  91. </if>
  92. <if test="contact != null">
  93. contact,
  94. </if>
  95. <if test="copyrightInfo != null">
  96. copyright_info,
  97. </if>
  98. <if test="copyrightName != null">
  99. copyright_name,
  100. </if>
  101. <if test="status != null">
  102. status,
  103. </if>
  104. <if test="workIssue != null">
  105. work_issue,
  106. </if>
  107. <if test="comment != null">
  108. comment,
  109. </if>
  110. <if test="outsource != null">
  111. outsource,
  112. </if>
  113. <if test="inUrgent != null">
  114. in_urgent,
  115. </if>
  116. <if test="authorizedDate != null">
  117. authorized_date,
  118. </if>
  119. <if test="certificateUrl != null">
  120. certificate_url,
  121. </if>
  122. <if test="applicationUrl != null">
  123. application_url,
  124. </if>
  125. <if test="deleteSign != null">
  126. delete_sign,
  127. </if>
  128. </trim>
  129. <trim prefix="values (" suffix=")" suffixOverrides=",">
  130. <if test="id != null">
  131. #{id,jdbcType=VARCHAR},
  132. </if>
  133. <if test="uid != null">
  134. #{uid,jdbcType=VARCHAR},
  135. </if>
  136. <if test="serialNumber != null">
  137. #{serialNumber,jdbcType=INTEGER},
  138. </if>
  139. <if test="createTime != null">
  140. #{createTime,jdbcType=TIMESTAMP},
  141. </if>
  142. <if test="acceptTime != null">
  143. #{acceptTime,jdbcType=TIMESTAMP},
  144. </if>
  145. <if test="principal != null">
  146. #{principal,jdbcType=VARCHAR},
  147. </if>
  148. <if test="contact != null">
  149. #{contact,jdbcType=INTEGER},
  150. </if>
  151. <if test="copyrightInfo != null">
  152. #{copyrightInfo,jdbcType=VARCHAR},
  153. </if>
  154. <if test="copyrightName != null">
  155. #{copyrightName,jdbcType=VARCHAR},
  156. </if>
  157. <if test="status != null">
  158. #{status,jdbcType=INTEGER},
  159. </if>
  160. <if test="workIssue != null">
  161. #{workIssue,jdbcType=VARCHAR},
  162. </if>
  163. <if test="comment != null">
  164. #{comment,jdbcType=VARCHAR},
  165. </if>
  166. <if test="outsource != null">
  167. #{outsource,jdbcType=VARCHAR},
  168. </if>
  169. <if test="inUrgent != null">
  170. #{inUrgent,jdbcType=INTEGER},
  171. </if>
  172. <if test="authorizedDate != null">
  173. #{authorizedDate,jdbcType=TIMESTAMP},
  174. </if>
  175. <if test="certificateUrl != null">
  176. #{certificateUrl,jdbcType=VARCHAR},
  177. </if>
  178. <if test="applicationUrl != null">
  179. #{applicationUrl,jdbcType=VARCHAR},
  180. </if>
  181. <if test="deleteSign != null">
  182. #{deleteSign,jdbcType=INTEGER},
  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="applicationUrl != null">
  235. application_url = #{applicationUrl,jdbcType=VARCHAR},
  236. </if>
  237. <if test="deleteSign != null">
  238. delete_sign = #{deleteSign,jdbcType=INTEGER},
  239. </if>
  240. </set>
  241. where id = #{id,jdbcType=VARCHAR}
  242. </update>
  243. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.CopyrightInfo">
  244. update copyright_info
  245. set uid = #{uid,jdbcType=VARCHAR},
  246. serial_number = #{serialNumber,jdbcType=INTEGER},
  247. create_time = #{createTime,jdbcType=TIMESTAMP},
  248. accept_time = #{acceptTime,jdbcType=TIMESTAMP},
  249. principal = #{principal,jdbcType=VARCHAR},
  250. contact = #{contact,jdbcType=INTEGER},
  251. copyright_info = #{copyrightInfo,jdbcType=VARCHAR},
  252. copyright_name = #{copyrightName,jdbcType=VARCHAR},
  253. status = #{status,jdbcType=INTEGER},
  254. work_issue = #{workIssue,jdbcType=VARCHAR},
  255. comment = #{comment,jdbcType=VARCHAR},
  256. outsource = #{outsource,jdbcType=VARCHAR},
  257. in_urgent = #{inUrgent,jdbcType=INTEGER},
  258. authorized_date = #{authorizedDate,jdbcType=TIMESTAMP},
  259. certificate_url = #{certificateUrl,jdbcType=VARCHAR},
  260. application_url = #{applicationUrl,jdbcType=VARCHAR},
  261. delete_sign = #{deleteSign,jdbcType=INTEGER}
  262. where id = #{id,jdbcType=VARCHAR}
  263. </update>
  264. <select id="findListByPage" resultType="com.goafanti.copyright.bo.CopyrightInfoSummary" parameterType="String">
  265. select ci.id,ci.uid,ci.serial_number as serialNumber, ci.create_time as createTime,
  266. ci.accept_time as acceptTime, ci.contact,
  267. ci.copyright_name as copyrightName, ci.status, ci.comment, ci.outsource, ci.in_urgent as inUrgent,
  268. ci.authorized_date as authorizedDate, ci.work_issue as workIssue,
  269. oi.location_province as province,oi.unit_name as unitName,
  270. concat(oi.first_contacts,' ', oi.first_mobile) as firstContact,
  271. concat(oi.second_contacts,' ', oi.second_mobile) as secondContact,
  272. concat(oi.third_contacts,' ', oi.third_mobile) as thirdContact,
  273. a.name as principal
  274. from copyright_info ci
  275. left join organization_identity oi on ci.uid = oi.uid
  276. left join admin a on ci.principal = a.id
  277. where ci.delete_sign = 0
  278. <if test="province != null">
  279. and oi.location_province = #{province,jdbcType=VARCHAR}
  280. </if>
  281. <if test="status != null">
  282. and ci.status = #{status,jdbcType=INTEGER}
  283. </if>
  284. <if test="unitName != null">
  285. and oi.unit_name like CONCAT('%', #{unitName,jdbcType=VARCHAR}, '%')
  286. </if>
  287. <if test="copyrightName != null">
  288. and ci.copyright_name like CONCAT('%', #{copyrightName,jdbcType=VARCHAR}, '%')
  289. </if>
  290. <if test="createStartTime != null">
  291. and ci.create_time <![CDATA[ >= ]]> #{createStartTime,jdbcType=TIMESTAMP}
  292. </if>
  293. <if test="createEndTime != null">
  294. and ci.create_time <![CDATA[ < ]]> #{createEndTime,jdbcType=TIMESTAMP}
  295. </if>
  296. <if test="acceptStartTime != null">
  297. and ci.accept_time <![CDATA[ >= ]]> #{acceptStartTime,jdbcType=TIMESTAMP}
  298. </if>
  299. <if test="acceptEndTime != null">
  300. and ci.accept_time <![CDATA[ < ]]> #{acceptEndTime,jdbcType=TIMESTAMP}
  301. </if>
  302. <if test="authStartTime != null">
  303. and ci.authorized_date <![CDATA[ >= ]]> #{authStartTime,jdbcType=TIMESTAMP}
  304. </if>
  305. <if test="authEndTime != null">
  306. and ci.authorized_date <![CDATA[ < ]]> #{authEndTime,jdbcType=TIMESTAMP}
  307. </if>
  308. order by ci.serial_number desc
  309. <if test="page_sql!=null">
  310. ${page_sql}
  311. </if>
  312. </select>
  313. <select id="findListCount" resultType="java.lang.Integer" parameterType="String">
  314. select count(*)
  315. from copyright_info ci
  316. left join organization_identity oi on ci.uid = oi.uid
  317. where ci.delete_sign = 0
  318. <if test="province != null">
  319. and oi.location_province = #{province,jdbcType=VARCHAR}
  320. </if>
  321. <if test="status != null">
  322. and ci.status = #{status,jdbcType=INTEGER}
  323. </if>
  324. <if test="unitName != null">
  325. and oi.unit_name like CONCAT('%', #{unitName,jdbcType=VARCHAR}, '%')
  326. </if>
  327. <if test="copyrightName != null">
  328. and ci.copyright_name like CONCAT('%', #{copyrightName,jdbcType=VARCHAR}, '%')
  329. </if>
  330. <if test="createStartTime != null">
  331. and ci.create_time <![CDATA[ >= ]]> #{createStartTime,jdbcType=TIMESTAMP}
  332. </if>
  333. <if test="createEndTime != null">
  334. and ci.create_time <![CDATA[ < ]]> #{createEndTime,jdbcType=TIMESTAMP}
  335. </if>
  336. <if test="acceptStartTime != null">
  337. and ci.accept_time <![CDATA[ >= ]]> #{acceptStartTime,jdbcType=TIMESTAMP}
  338. </if>
  339. <if test="acceptEndTime != null">
  340. and ci.accept_time <![CDATA[ < ]]> #{acceptEndTime,jdbcType=TIMESTAMP}
  341. </if>
  342. <if test="authStartTime != null">
  343. and ci.authorized_date <![CDATA[ >= ]]> #{authStartTime,jdbcType=TIMESTAMP}
  344. </if>
  345. <if test="authEndTime != null">
  346. and ci.authorized_date <![CDATA[ < ]]> #{authEndTime,jdbcType=TIMESTAMP}
  347. </if>
  348. </select>
  349. </mapper>