| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.goafanti.common.dao.CopyrightInfoMapper">
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.CopyrightInfo">
- <id column="id" jdbcType="VARCHAR" property="id" />
- <result column="uid" jdbcType="VARCHAR" property="uid" />
- <result column="serial_number" jdbcType="INTEGER" property="serialNumber" />
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
- <result column="accept_time" jdbcType="TIMESTAMP" property="acceptTime" />
- <result column="principal" jdbcType="VARCHAR" property="principal" />
- <result column="contact" jdbcType="INTEGER" property="contact" />
- <result column="copyright_info" jdbcType="VARCHAR" property="copyrightInfo" />
- <result column="copyright_name" jdbcType="VARCHAR" property="copyrightName" />
- <result column="status" jdbcType="INTEGER" property="status" />
- <result column="work_issue" jdbcType="VARCHAR" property="workIssue" />
- <result column="comment" jdbcType="VARCHAR" property="comment" />
- <result column="outsource" jdbcType="VARCHAR" property="outsource" />
- <result column="in_urgent" jdbcType="INTEGER" property="inUrgent" />
- <result column="authorized_date" jdbcType="TIMESTAMP" property="authorizedDate" />
- <result column="certificate_url" jdbcType="VARCHAR" property="certificateUrl" />
- <result column="copyright_number" jdbcType="VARCHAR" property="copyrightNumber" />
- <result column="application_url" jdbcType="VARCHAR" property="applicationUrl" />
- <result column="delete_sign" jdbcType="INTEGER" property="deleteSign" />
- <result column="founder" jdbcType="VARCHAR" property="founder" />
- <result column="contract_id" jdbcType="VARCHAR" property="contractId" />
- </resultMap>
- <sql id="Base_Column_List">
- id, uid, serial_number, create_time, accept_time, principal, contact, copyright_info,
- copyright_name, status, work_issue, comment, outsource, in_urgent, authorized_date,
- certificate_url, application_url, delete_sign, copyright_number, founder, contract_id
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from copyright_info
- where id = #{id,jdbcType=VARCHAR}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
- delete from copyright_info
- where id = #{id,jdbcType=VARCHAR}
- </delete>
- <insert id="insert" parameterType="com.goafanti.common.model.CopyrightInfo">
- insert into copyright_info (id, uid, serial_number,
- create_time, accept_time, principal,
- contact, copyright_info, copyright_name,
- status, work_issue, comment,
- outsource, in_urgent, authorized_date,
- certificate_url, copyright_number, application_url, delete_sign, founder, contract_id
- )
- values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{serialNumber,jdbcType=INTEGER},
- #{createTime,jdbcType=TIMESTAMP}, #{acceptTime,jdbcType=TIMESTAMP}, #{principal,jdbcType=VARCHAR},
- #{contact,jdbcType=INTEGER}, #{copyrightInfo,jdbcType=VARCHAR}, #{copyrightName,jdbcType=VARCHAR},
- #{status,jdbcType=INTEGER}, #{workIssue,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR},
- #{outsource,jdbcType=VARCHAR}, #{inUrgent,jdbcType=INTEGER}, #{authorizedDate,jdbcType=TIMESTAMP},
- #{certificateUrl,jdbcType=VARCHAR},
- #{copyrightNumber,jdbcType=VARCHAR},
- #{applicationUrl,jdbcType=VARCHAR}, #{deleteSign,jdbcType=INTEGER}, #{founder,jdbcType=VARCHAR},
- #{contractId,jdbcType=VARCHAR}
- )
- </insert>
- <insert id="insertSelective" parameterType="com.goafanti.common.model.CopyrightInfo">
- insert into copyright_info
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="uid != null">
- uid,
- </if>
- <if test="serialNumber != null">
- serial_number,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="acceptTime != null">
- accept_time,
- </if>
- <if test="principal != null">
- principal,
- </if>
- <if test="contact != null">
- contact,
- </if>
- <if test="copyrightInfo != null">
- copyright_info,
- </if>
- <if test="copyrightName != null">
- copyright_name,
- </if>
- <if test="status != null">
- status,
- </if>
- <if test="workIssue != null">
- work_issue,
- </if>
- <if test="comment != null">
- comment,
- </if>
- <if test="outsource != null">
- outsource,
- </if>
- <if test="inUrgent != null">
- in_urgent,
- </if>
- <if test="authorizedDate != null">
- authorized_date,
- </if>
- <if test="certificateUrl != null">
- certificate_url,
- </if>
- <if test="copyrightNumber != null">
- copyright_number,
- </if>
- <if test="applicationUrl != null">
- application_url,
- </if>
- <if test="deleteSign != null">
- delete_sign,
- </if>
- <if test="founder != null">
- founder,
- </if>
- <if test="contractId != null">
- contract_id,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=VARCHAR},
- </if>
- <if test="uid != null">
- #{uid,jdbcType=VARCHAR},
- </if>
- <if test="serialNumber != null">
- #{serialNumber,jdbcType=INTEGER},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="acceptTime != null">
- #{acceptTime,jdbcType=TIMESTAMP},
- </if>
- <if test="principal != null">
- #{principal,jdbcType=VARCHAR},
- </if>
- <if test="contact != null">
- #{contact,jdbcType=INTEGER},
- </if>
- <if test="copyrightInfo != null">
- #{copyrightInfo,jdbcType=VARCHAR},
- </if>
- <if test="copyrightName != null">
- #{copyrightName,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- #{status,jdbcType=INTEGER},
- </if>
- <if test="workIssue != null">
- #{workIssue,jdbcType=VARCHAR},
- </if>
- <if test="comment != null">
- #{comment,jdbcType=VARCHAR},
- </if>
- <if test="outsource != null">
- #{outsource,jdbcType=VARCHAR},
- </if>
- <if test="inUrgent != null">
- #{inUrgent,jdbcType=INTEGER},
- </if>
- <if test="authorizedDate != null">
- #{authorizedDate,jdbcType=TIMESTAMP},
- </if>
- <if test="certificateUrl != null">
- #{certificateUrl,jdbcType=VARCHAR},
- </if>
- <if test="copyrightNumber != null">
- #{copyrightNumber,jdbcType=VARCHAR},
- </if>
- <if test="applicationUrl != null">
- #{applicationUrl,jdbcType=VARCHAR},
- </if>
- <if test="deleteSign != null">
- #{deleteSign,jdbcType=INTEGER},
- </if>
- <if test="founder != null">
- #{founder,jdbcType=VARCHAR},
- </if>
- <if test="contractId != null">
- #{contractId,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.CopyrightInfo">
- update copyright_info
- <set>
- <if test="uid != null">
- uid = #{uid,jdbcType=VARCHAR},
- </if>
- <if test="serialNumber != null">
- serial_number = #{serialNumber,jdbcType=INTEGER},
- </if>
- <if test="createTime != null">
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="acceptTime != null">
- accept_time = #{acceptTime,jdbcType=TIMESTAMP},
- </if>
- <if test="principal != null">
- principal = #{principal,jdbcType=VARCHAR},
- </if>
- <if test="contact != null">
- contact = #{contact,jdbcType=INTEGER},
- </if>
- <if test="copyrightInfo != null">
- copyright_info = #{copyrightInfo,jdbcType=VARCHAR},
- </if>
- <if test="copyrightName != null">
- copyright_name = #{copyrightName,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- status = #{status,jdbcType=INTEGER},
- </if>
- <if test="workIssue != null">
- work_issue = #{workIssue,jdbcType=VARCHAR},
- </if>
- <if test="comment != null">
- comment = #{comment,jdbcType=VARCHAR},
- </if>
- <if test="outsource != null">
- outsource = #{outsource,jdbcType=VARCHAR},
- </if>
- <if test="inUrgent != null">
- in_urgent = #{inUrgent,jdbcType=INTEGER},
- </if>
- <if test="authorizedDate != null">
- authorized_date = #{authorizedDate,jdbcType=TIMESTAMP},
- </if>
- <if test="certificateUrl != null">
- certificate_url = #{certificateUrl,jdbcType=VARCHAR},
- </if>
- <if test="copyrightNumber != null">
- copyright_number = #{copyrightNumber,jdbcType=VARCHAR},
- </if>
- <if test="applicationUrl != null">
- application_url = #{applicationUrl,jdbcType=VARCHAR},
- </if>
- <if test="deleteSign != null">
- delete_sign = #{deleteSign,jdbcType=INTEGER},
- </if>
- <if test="founder != null">
- founder = #{founder,jdbcType=VARCHAR},
- </if>
- <if test="contractId != null">
- contract_id = #{contractId,jdbcType=VARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.CopyrightInfo">
- update copyright_info
- set uid = #{uid,jdbcType=VARCHAR},
- serial_number = #{serialNumber,jdbcType=INTEGER},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- accept_time = #{acceptTime,jdbcType=TIMESTAMP},
- principal = #{principal,jdbcType=VARCHAR},
- contact = #{contact,jdbcType=INTEGER},
- copyright_info = #{copyrightInfo,jdbcType=VARCHAR},
- copyright_name = #{copyrightName,jdbcType=VARCHAR},
- status = #{status,jdbcType=INTEGER},
- work_issue = #{workIssue,jdbcType=VARCHAR},
- comment = #{comment,jdbcType=VARCHAR},
- outsource = #{outsource,jdbcType=VARCHAR},
- in_urgent = #{inUrgent,jdbcType=INTEGER},
- authorized_date = #{authorizedDate,jdbcType=TIMESTAMP},
- certificate_url = #{certificateUrl,jdbcType=VARCHAR},
- copyright_number = #{copyrightNumber,jdbcType=VARCHAR},
- application_url = #{applicationUrl,jdbcType=VARCHAR},
- delete_sign = #{deleteSign,jdbcType=INTEGER},
- founder = #{founder,jdbcType=VARCHAR},
- contract_id = #{contractId,jdbcType=VARCHAR}
- where id = #{id,jdbcType=VARCHAR}
- </update>
-
- <select id="findListByPage" resultType="com.goafanti.copyright.bo.CopyrightInfoSummary" parameterType="String">
- select ci.id,ci.uid,ci.serial_number as serialNumber, ci.create_time as createTime,
- ci.accept_time as acceptTime, ci.contact,
- ci.copyright_name as copyrightName, ci.status, ci.comment, ci.outsource, ci.in_urgent as inUrgent,
- ci.authorized_date as authorizedDate, ci.work_issue as workIssue, ci.copyright_number as copyrightNumber,
- oi.licence_province as province,oi.unit_name as unitName,
- concat(oi.first_contacts,' ', oi.first_mobile) as firstContact,
- concat(oi.second_contacts,' ', oi.second_mobile) as secondContact,
- concat(oi.third_contacts,' ', oi.third_mobile) as thirdContact,
- a.name as principal, ad.name as founder, c.serial_number as contractNumber
- from copyright_info ci
- left join organization_identity oi on ci.uid = oi.uid
- left join admin a on ci.principal = a.id
- left join admin ad on ci.founder = ad.id
- left join contract c on c.id = ci.contract_id
- <if test="principal != null">
- left join contract_log cl on ci.contract_id=cl.cid
- </if>
- where ci.delete_sign = 0
- <if test="principal != null">
- and cl.principal = #{principal,jdbcType=VARCHAR}
- </if>
- <if test="province != null">
- and oi.licence_province = #{province,jdbcType=INTEGER}
- </if>
- <if test="status != null">
- and ci.status = #{status,jdbcType=INTEGER}
- </if>
- <if test="contractId != null">
- and ci.contract_id = #{contractId,jdbcType=INTEGER}
- </if>
- <if test="unitName != null">
- and oi.unit_name like CONCAT('%', #{unitName,jdbcType=VARCHAR}, '%')
- </if>
- <if test="unitId != null">
- and ci.uid = #{unitId,jdbcType=VARCHAR}
- </if>
- <if test="copyrightName != null">
- and ci.copyright_name like CONCAT('%', #{copyrightName,jdbcType=VARCHAR}, '%')
- </if>
- <if test="createStartTime != null">
- and ci.create_time <![CDATA[ >= ]]> #{createStartTime,jdbcType=TIMESTAMP}
- </if>
- <if test="createEndTime != null">
- and ci.create_time <![CDATA[ < ]]> #{createEndTime,jdbcType=TIMESTAMP}
- </if>
- <if test="acceptStartTime != null">
- and ci.accept_time <![CDATA[ >= ]]> #{acceptStartTime,jdbcType=TIMESTAMP}
- </if>
- <if test="acceptEndTime != null">
- and ci.accept_time <![CDATA[ < ]]> #{acceptEndTime,jdbcType=TIMESTAMP}
- </if>
- <if test="authStartTime != null">
- and ci.authorized_date <![CDATA[ >= ]]> #{authStartTime,jdbcType=TIMESTAMP}
- </if>
- <if test="authEndTime != null">
- and ci.authorized_date <![CDATA[ < ]]> #{authEndTime,jdbcType=TIMESTAMP}
- </if>
- <if test="principal != null">
- group by ci.id
- </if>
- order by ci.serial_number desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id="findListCount" resultType="java.lang.Integer" parameterType="String">
- select count(*)
- from copyright_info ci
- left join organization_identity oi on ci.uid = oi.uid
- <if test="principal != null">
- left join contract_log cl on ci.contract_id=cl.cid
- </if>
- where ci.delete_sign = 0
- <if test="principal != null">
- and cl.principal = #{principal,jdbcType=VARCHAR}
- </if>
- <if test="province != null">
- and oi.licence_province = #{province,jdbcType=INTEGER}
- </if>
- <if test="contractId != null">
- and ci.contract_id = #{contractId,jdbcType=INTEGER}
- </if>
- <if test="status != null">
- and ci.status = #{status,jdbcType=INTEGER}
- </if>
- <if test="unitName != null">
- and oi.unit_name like CONCAT('%', #{unitName,jdbcType=VARCHAR}, '%')
- </if>
- <if test="unitId != null">
- and ci.uid = #{unitId,jdbcType=VARCHAR}
- </if>
- <if test="copyrightName != null">
- and ci.copyright_name like CONCAT('%', #{copyrightName,jdbcType=VARCHAR}, '%')
- </if>
- <if test="createStartTime != null">
- and ci.create_time <![CDATA[ >= ]]> #{createStartTime,jdbcType=TIMESTAMP}
- </if>
- <if test="createEndTime != null">
- and ci.create_time <![CDATA[ < ]]> #{createEndTime,jdbcType=TIMESTAMP}
- </if>
- <if test="acceptStartTime != null">
- and ci.accept_time <![CDATA[ >= ]]> #{acceptStartTime,jdbcType=TIMESTAMP}
- </if>
- <if test="acceptEndTime != null">
- and ci.accept_time <![CDATA[ < ]]> #{acceptEndTime,jdbcType=TIMESTAMP}
- </if>
- <if test="authStartTime != null">
- and ci.authorized_date <![CDATA[ >= ]]> #{authStartTime,jdbcType=TIMESTAMP}
- </if>
- <if test="authEndTime != null">
- and ci.authorized_date <![CDATA[ < ]]> #{authEndTime,jdbcType=TIMESTAMP}
- </if>
- <if test="principal != null">
- group by ci.id
- </if>
- </select>
-
- <update id="deleteByPrimaryKeys" parameterType="java.util.List">
- update copyright_info set delete_sign = 1
- where id in
- <foreach item="item" index="index" collection="list" open="(" separator="," close=")">
- #{item}
- </foreach>
- </update>
- <select id="findByPrimaryKey" parameterType="java.lang.String" resultType="com.goafanti.copyright.bo.CopyrightInfoDetail">
- select ci.id,ci.uid,ci.serial_number as serialNumber, ci.create_time as createTime,
- ci.accept_time as acceptTime, ci.contact, ci.copyright_name as copyrightName, ci.copyright_info as copyrightInfo,
- ci.status, ci.comment, ci.outsource, ci.in_urgent as inUrgent, ci.authorized_date as authorizedDate, ci.copyright_number as copyrightNumber,
- ci.work_issue as workIssue,ci.application_url as applicationUrl,ci.certificate_url as certificateUrl,
- oi.licence_province as province, oi.licence_city as city,oi.licence_area as area, oi.postal_address as postalAddress, oi.postcode,
- oi.unit_name as unitName, oi.org_code as orgCode,
- concat(oi.first_contacts,' ', oi.first_mobile) as firstContact,
- concat(oi.second_contacts,' ', oi.second_mobile) as secondContact,
- concat(oi.third_contacts,' ', oi.third_mobile) as thirdContact,
- a.name as principal
- from copyright_info ci
- left join organization_identity oi on ci.uid = oi.uid
- left join admin a on ci.principal = a.id
- where ci.id = #{id,jdbcType=VARCHAR}
- </select>
-
- <select id="selectByPrimaryKeys" parameterType="java.lang.String" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from copyright_info where id in
- <foreach item="item" index="index" collection="list" open="("
- separator="," close=")">
- #{item}
- </foreach>
- </select>
-
- <select id="countCopyrightDone" parameterType="java.lang.String" resultType="java.lang.Integer">
- select count(1) from copyright_info
- where uid = #{uid,jdbcType=VARCHAR}
- and delete_sign = 0 and status in (8,9)
- </select>
-
- <select id="countCopyrightUndone" parameterType="java.lang.String" resultType="java.lang.Integer">
- select count(1) from copyright_info
- where uid = #{uid,jdbcType=VARCHAR}
- and delete_sign = 0 and status <![CDATA[ < ]]> 8
- </select>
-
- <select id="listContractCopyrightByContractId" parameterType="java.lang.String" resultType="com.goafanti.copyright.bo.CopyrightContractListBo">
- select
- ci.id, ci.uid, ci.contract_id as contractId,
- ci.serial_number as serialNumber, ci.copyright_name as copyrightName, ci.status,
- ci.in_urgent as inUrgent, a.name as principal
- from copyright_info ci
- left join admin a on a.id = ci.principal
- where ci.contract_id = #{contractId,jdbcType=VARCHAR}
- </select>
-
- <insert id="batchInsert" parameterType="com.goafanti.common.model.CopyrightInfo">
- insert into copyright_info (id, uid, serial_number,
- create_time, accept_time, principal,
- contact, copyright_info, copyright_name,
- status, work_issue, comment,
- outsource, in_urgent, authorized_date,
- certificate_url, copyright_number, application_url, delete_sign, founder, contract_id
- )
- values
- <foreach item="item" index="index" collection="list" separator=",">
- (
- #{item.id,jdbcType=VARCHAR}, #{item.uid,jdbcType=VARCHAR}, #{item.serialNumber,jdbcType=INTEGER},
- #{item.createTime,jdbcType=TIMESTAMP}, #{item.acceptTime,jdbcType=TIMESTAMP}, #{item.principal,jdbcType=VARCHAR},
- #{item.contact,jdbcType=INTEGER}, #{item.copyrightInfo,jdbcType=VARCHAR}, #{item.copyrightName,jdbcType=VARCHAR},
- #{item.status,jdbcType=INTEGER}, #{item.workIssue,jdbcType=VARCHAR}, #{item.comment,jdbcType=VARCHAR},
- #{item.outsource,jdbcType=VARCHAR}, #{item.inUrgent,jdbcType=INTEGER}, #{item.authorizedDate,jdbcType=TIMESTAMP},
- #{item.certificateUrl,jdbcType=VARCHAR},
- #{item.copyrightNumber,jdbcType=VARCHAR},
- #{item.applicationUrl,jdbcType=VARCHAR}, #{item.deleteSign,jdbcType=INTEGER}, #{item.founder,jdbcType=VARCHAR},
- #{item.contractId,jdbcType=VARCHAR}
- )
- </foreach>
- </insert>
-
- <update id="batchDeleteByContractId" parameterType="java.util.List">
- update copyright_info set delete_sign = 1
- where contract_id in
- <foreach item="item" index="index" collection="list" open="(" separator="," close=")">
- #{item}
- </foreach>
- </update>
-
- <select id="findCopyrightInfoNumByUid" parameterType="java.lang.String" resultType="java.lang.Integer">
- select
- count(1)
- from copyright_info
- where
- delete_sign = 0
- and uid = #{uid,jdbcType=VARCHAR}
- </select>
- </mapper>
|