|
|
@@ -0,0 +1,367 @@
|
|
|
+<?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.ContractMapper" >
|
|
|
+ <resultMap id="BaseResultMap" type="com.goafanti.common.model.Contract" >
|
|
|
+ <id column="id" property="id" jdbcType="VARCHAR" />
|
|
|
+ <result column="uid" property="uid" jdbcType="VARCHAR" />
|
|
|
+ <result column="serial_number" property="serialNumber" jdbcType="INTEGER" />
|
|
|
+ <result column="name" property="name" jdbcType="VARCHAR" />
|
|
|
+ <result column="type" property="type" jdbcType="INTEGER" />
|
|
|
+ <result column="sign_date" property="signDate" jdbcType="TIMESTAMP" />
|
|
|
+ <result column="founder" property="founder" jdbcType="VARCHAR" />
|
|
|
+ <result column="describe" property="describe" jdbcType="VARCHAR" />
|
|
|
+ <result column="status" property="status" jdbcType="INTEGER" />
|
|
|
+ <result column="patent_num" property="patentNum" jdbcType="INTEGER" />
|
|
|
+ <result column="patent_status" property="patentStatus" jdbcType="INTEGER" />
|
|
|
+ <result column="copyright_num" property="copyrightNum" jdbcType="INTEGER" />
|
|
|
+ <result column="copyright_status" property="copyrightStatus" jdbcType="INTEGER" />
|
|
|
+ <result column="cognizance_year" property="cognizanceYear" jdbcType="INTEGER" />
|
|
|
+ <result column="cognizance_status" property="cognizanceStatus" jdbcType="INTEGER" />
|
|
|
+ <result column="tech_project_num" property="techProjectNum" jdbcType="INTEGER" />
|
|
|
+ <result column="tech_project_status" property="techProjectStatus" jdbcType="INTEGER" />
|
|
|
+ <result column="comment" property="comment" jdbcType="VARCHAR" />
|
|
|
+ <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
|
|
+ <result column="complete_date" property="completeDate" jdbcType="TIMESTAMP" />
|
|
|
+ <result column="deleted_sign" property="deletedSign" jdbcType="INTEGER" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List" >
|
|
|
+ id, uid, serial_number, name, type, sign_date, founder, describe, status, patent_num,
|
|
|
+ patent_status, copyright_num, copyright_status, cognizance_year, cognizance_status,
|
|
|
+ tech_project_num, tech_project_status, comment, create_time, complete_date, deleted_sign
|
|
|
+ </sql>
|
|
|
+ <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from contract
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
+ </select>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
|
|
|
+ delete from contract
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" parameterType="com.goafanti.common.model.Contract" >
|
|
|
+ insert into contract (id, uid, serial_number,
|
|
|
+ name, type, sign_date,
|
|
|
+ founder, describe, status,
|
|
|
+ patent_num, patent_status, copyright_num,
|
|
|
+ copyright_status, cognizance_year, cognizance_status,
|
|
|
+ tech_project_num, tech_project_status, comment,
|
|
|
+ create_time, complete_date, deleted_sign
|
|
|
+ )
|
|
|
+ values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{serialNumber,jdbcType=INTEGER},
|
|
|
+ #{name,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{signDate,jdbcType=TIMESTAMP},
|
|
|
+ #{founder,jdbcType=VARCHAR}, #{describe,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
|
|
|
+ #{patentNum,jdbcType=INTEGER}, #{patentStatus,jdbcType=INTEGER}, #{copyrightNum,jdbcType=INTEGER},
|
|
|
+ #{copyrightStatus,jdbcType=INTEGER}, #{cognizanceYear,jdbcType=INTEGER}, #{cognizanceStatus,jdbcType=INTEGER},
|
|
|
+ #{techProjectNum,jdbcType=INTEGER}, #{techProjectStatus,jdbcType=INTEGER}, #{comment,jdbcType=VARCHAR},
|
|
|
+ #{createTime,jdbcType=TIMESTAMP}, #{completeDate,jdbcType=TIMESTAMP}, #{deletedSign,jdbcType=INTEGER}
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" parameterType="com.goafanti.common.model.Contract" >
|
|
|
+ insert into contract
|
|
|
+ <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="name != null" >
|
|
|
+ name,
|
|
|
+ </if>
|
|
|
+ <if test="type != null" >
|
|
|
+ type,
|
|
|
+ </if>
|
|
|
+ <if test="signDate != null" >
|
|
|
+ sign_date,
|
|
|
+ </if>
|
|
|
+ <if test="founder != null" >
|
|
|
+ founder,
|
|
|
+ </if>
|
|
|
+ <if test="describe != null" >
|
|
|
+ describe,
|
|
|
+ </if>
|
|
|
+ <if test="status != null" >
|
|
|
+ status,
|
|
|
+ </if>
|
|
|
+ <if test="patentNum != null" >
|
|
|
+ patent_num,
|
|
|
+ </if>
|
|
|
+ <if test="patentStatus != null" >
|
|
|
+ patent_status,
|
|
|
+ </if>
|
|
|
+ <if test="copyrightNum != null" >
|
|
|
+ copyright_num,
|
|
|
+ </if>
|
|
|
+ <if test="copyrightStatus != null" >
|
|
|
+ copyright_status,
|
|
|
+ </if>
|
|
|
+ <if test="cognizanceYear != null" >
|
|
|
+ cognizance_year,
|
|
|
+ </if>
|
|
|
+ <if test="cognizanceStatus != null" >
|
|
|
+ cognizance_status,
|
|
|
+ </if>
|
|
|
+ <if test="techProjectNum != null" >
|
|
|
+ tech_project_num,
|
|
|
+ </if>
|
|
|
+ <if test="techProjectStatus != null" >
|
|
|
+ tech_project_status,
|
|
|
+ </if>
|
|
|
+ <if test="comment != null" >
|
|
|
+ comment,
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null" >
|
|
|
+ create_time,
|
|
|
+ </if>
|
|
|
+ <if test="completeDate != null" >
|
|
|
+ complete_date,
|
|
|
+ </if>
|
|
|
+ <if test="deletedSign != null" >
|
|
|
+ deleted_sign,
|
|
|
+ </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="name != null" >
|
|
|
+ #{name,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="type != null" >
|
|
|
+ #{type,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="signDate != null" >
|
|
|
+ #{signDate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="founder != null" >
|
|
|
+ #{founder,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="describe != null" >
|
|
|
+ #{describe,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="status != null" >
|
|
|
+ #{status,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="patentNum != null" >
|
|
|
+ #{patentNum,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="patentStatus != null" >
|
|
|
+ #{patentStatus,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="copyrightNum != null" >
|
|
|
+ #{copyrightNum,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="copyrightStatus != null" >
|
|
|
+ #{copyrightStatus,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="cognizanceYear != null" >
|
|
|
+ #{cognizanceYear,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="cognizanceStatus != null" >
|
|
|
+ #{cognizanceStatus,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="techProjectNum != null" >
|
|
|
+ #{techProjectNum,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="techProjectStatus != null" >
|
|
|
+ #{techProjectStatus,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="comment != null" >
|
|
|
+ #{comment,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null" >
|
|
|
+ #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="completeDate != null" >
|
|
|
+ #{completeDate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="deletedSign != null" >
|
|
|
+ #{deletedSign,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.Contract" >
|
|
|
+ update contract
|
|
|
+ <set >
|
|
|
+ <if test="uid != null" >
|
|
|
+ uid = #{uid,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="serialNumber != null" >
|
|
|
+ serial_number = #{serialNumber,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="name != null" >
|
|
|
+ name = #{name,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="type != null" >
|
|
|
+ type = #{type,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="signDate != null" >
|
|
|
+ sign_date = #{signDate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="founder != null" >
|
|
|
+ founder = #{founder,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="describe != null" >
|
|
|
+ describe = #{describe,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="status != null" >
|
|
|
+ status = #{status,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="patentNum != null" >
|
|
|
+ patent_num = #{patentNum,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="patentStatus != null" >
|
|
|
+ patent_status = #{patentStatus,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="copyrightNum != null" >
|
|
|
+ copyright_num = #{copyrightNum,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="copyrightStatus != null" >
|
|
|
+ copyright_status = #{copyrightStatus,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="cognizanceYear != null" >
|
|
|
+ cognizance_year = #{cognizanceYear,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="cognizanceStatus != null" >
|
|
|
+ cognizance_status = #{cognizanceStatus,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="techProjectNum != null" >
|
|
|
+ tech_project_num = #{techProjectNum,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="techProjectStatus != null" >
|
|
|
+ tech_project_status = #{techProjectStatus,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="comment != null" >
|
|
|
+ comment = #{comment,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null" >
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="completeDate != null" >
|
|
|
+ complete_date = #{completeDate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="deletedSign != null" >
|
|
|
+ deleted_sign = #{deletedSign,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.Contract" >
|
|
|
+ update contract
|
|
|
+ set uid = #{uid,jdbcType=VARCHAR},
|
|
|
+ serial_number = #{serialNumber,jdbcType=INTEGER},
|
|
|
+ name = #{name,jdbcType=VARCHAR},
|
|
|
+ type = #{type,jdbcType=INTEGER},
|
|
|
+ sign_date = #{signDate,jdbcType=TIMESTAMP},
|
|
|
+ founder = #{founder,jdbcType=VARCHAR},
|
|
|
+ describe = #{describe,jdbcType=VARCHAR},
|
|
|
+ status = #{status,jdbcType=INTEGER},
|
|
|
+ patent_num = #{patentNum,jdbcType=INTEGER},
|
|
|
+ patent_status = #{patentStatus,jdbcType=INTEGER},
|
|
|
+ copyright_num = #{copyrightNum,jdbcType=INTEGER},
|
|
|
+ copyright_status = #{copyrightStatus,jdbcType=INTEGER},
|
|
|
+ cognizance_year = #{cognizanceYear,jdbcType=INTEGER},
|
|
|
+ cognizance_status = #{cognizanceStatus,jdbcType=INTEGER},
|
|
|
+ tech_project_num = #{techProjectNum,jdbcType=INTEGER},
|
|
|
+ tech_project_status = #{techProjectStatus,jdbcType=INTEGER},
|
|
|
+ comment = #{comment,jdbcType=VARCHAR},
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ complete_date = #{completeDate,jdbcType=TIMESTAMP},
|
|
|
+ deleted_sign = #{deletedSign,jdbcType=INTEGER}
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <select id="findManageContractListByPage" parameterType="String" resultType="com.goafanti.contract.bo.ContractManageListBo">
|
|
|
+ select c.id, c.uid, oi.unit_name as unitName,
|
|
|
+ oi.licence_province as province, c.serial_number as serialNumber, c.type,
|
|
|
+ c.sign_date as signDate, a.name as founder,
|
|
|
+ c.describe, c.status, c.complete_date as completeDate
|
|
|
+ from contract c
|
|
|
+ LEFT JOIN organization_identity oi on oi.uid = c.uid
|
|
|
+ LEFT JOIN admin a on a.id = c.founder
|
|
|
+ <if test="principal != null">
|
|
|
+ LEFT JOIN contract_log cl on cl.cid = c.id
|
|
|
+ </if>
|
|
|
+ where c.deleted_sign = 0
|
|
|
+ <if test="principal != null">
|
|
|
+ and cl.principal = #{principal,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="serialNumber !=null">
|
|
|
+ and c.serialNumber = #{serialNumber,jdbcType=VARCAHR}
|
|
|
+ </if>
|
|
|
+ <if test="type !=null">
|
|
|
+ and c.type = #{type,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="status !=null">
|
|
|
+ and c.status= #{status ,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="cStart !=null">
|
|
|
+ and c.sign_date <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ <if test="cEnd !=null">
|
|
|
+ and c.sign_date <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ <if test="province !=null">
|
|
|
+ and oi.licence_province= #{province,jdbcType=VARCAHR}
|
|
|
+ </if>
|
|
|
+ <if test="unitName !=null">
|
|
|
+ and oi.unit_name= #{unitName,jdbcType=VARCAHR}
|
|
|
+ </if>
|
|
|
+ <if test="principal != null">
|
|
|
+ group by c.id
|
|
|
+ </if>
|
|
|
+ order by c.serial_number DESC
|
|
|
+ <if test="page_sql!=null">
|
|
|
+ ${page_sql}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="findManageContractCount" resultType="java.lang.Integer"
|
|
|
+ parameterType="String">
|
|
|
+ select count(1)
|
|
|
+ from contract c
|
|
|
+ LEFT JOIN organization_identity oi on oi.uid = c.uid
|
|
|
+ LEFT JOIN admin a on a.id = c.founder
|
|
|
+ <if test="principal != null">
|
|
|
+ LEFT JOIN contract_log cl on cl.cid = c.id
|
|
|
+ </if>
|
|
|
+ where c.deleted_sign = 0
|
|
|
+ <if test="principal != null">
|
|
|
+ and cl.principal = #{principal,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="serialNumber !=null">
|
|
|
+ and c.serialNumber = #{serialNumber,jdbcType=VARCAHR}
|
|
|
+ </if>
|
|
|
+ <if test="type !=null">
|
|
|
+ and c.type = #{type,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="status !=null">
|
|
|
+ and c.status= #{status ,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="cStart !=null">
|
|
|
+ and c.sign_date <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ <if test="cEnd !=null">
|
|
|
+ and c.sign_date <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ <if test="province !=null">
|
|
|
+ and oi.licence_province= #{province,jdbcType=VARCAHR}
|
|
|
+ </if>
|
|
|
+ <if test="unitName !=null">
|
|
|
+ and oi.unit_name= #{unitName,jdbcType=VARCAHR}
|
|
|
+ </if>
|
|
|
+ <if test="principal != null">
|
|
|
+ group by c.id
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+</mapper>
|