|
|
@@ -0,0 +1,301 @@
|
|
|
+<?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.OrgCognizanceMapper" >
|
|
|
+ <resultMap id="BaseResultMap" type="com.goafanti.common.model.OrgCognizance" >
|
|
|
+ <id column="id" property="id" jdbcType="VARCHAR" />
|
|
|
+ <result column="uid" property="uid" jdbcType="VARCHAR" />
|
|
|
+ <result column="serial_number" property="serialNumber" jdbcType="INTEGER" />
|
|
|
+ <result column="contacts" property="contacts" jdbcType="VARCHAR" />
|
|
|
+ <result column="comment" property="comment" jdbcType="VARCHAR" />
|
|
|
+ <result column="consultant" property="consultant" jdbcType="VARCHAR" />
|
|
|
+ <result column="technical_field1" property="technicalField1" jdbcType="INTEGER" />
|
|
|
+ <result column="technical_field2" property="technicalField2" jdbcType="INTEGER" />
|
|
|
+ <result column="technical_field3" property="technicalField3" jdbcType="INTEGER" />
|
|
|
+ <result column="basic_research_cost" property="basicResearchCost" jdbcType="INTEGER" />
|
|
|
+ <result column="accident" property="accident" jdbcType="INTEGER" />
|
|
|
+ <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
|
|
+ <result column="accept_date" property="acceptDate" jdbcType="TIMESTAMP" />
|
|
|
+ <result column="issuing_date" property="issuingDate" jdbcType="TIMESTAMP" />
|
|
|
+ <result column="certificate_number" property="certificateNumber" jdbcType="VARCHAR" />
|
|
|
+ <result column="certificate_url" property="certificateUrl" jdbcType="VARCHAR" />
|
|
|
+ <result column="state" property="state" jdbcType="INTEGER" />
|
|
|
+ <result column="deleted_sign" property="deletedSign" jdbcType="INTEGER" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List" >
|
|
|
+ id, uid, serial_number, contacts, comment, consultant, technical_field1, technical_field2,
|
|
|
+ technical_field3, basic_research_cost, accident, create_time, accept_date, issuing_date,
|
|
|
+ certificate_number, certificate_url, state, deleted_sign
|
|
|
+ </sql>
|
|
|
+ <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from org_cognizance
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
+ </select>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
|
|
|
+ delete from org_cognizance
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" parameterType="com.goafanti.common.model.OrgCognizance" >
|
|
|
+ insert into org_cognizance (id, uid, serial_number,
|
|
|
+ contacts, comment, consultant,
|
|
|
+ technical_field1, technical_field2, technical_field3,
|
|
|
+ basic_research_cost, accident, create_time,
|
|
|
+ accept_date, issuing_date, certificate_number,
|
|
|
+ certificate_url, state, deleted_sign
|
|
|
+ )
|
|
|
+ values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{serialNumber,jdbcType=INTEGER},
|
|
|
+ #{contacts,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR}, #{consultant,jdbcType=VARCHAR},
|
|
|
+ #{technicalField1,jdbcType=INTEGER}, #{technicalField2,jdbcType=INTEGER}, #{technicalField3,jdbcType=INTEGER},
|
|
|
+ #{basicResearchCost,jdbcType=INTEGER}, #{accident,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ #{acceptDate,jdbcType=TIMESTAMP}, #{issuingDate,jdbcType=TIMESTAMP}, #{certificateNumber,jdbcType=VARCHAR},
|
|
|
+ #{certificateUrl,jdbcType=VARCHAR}, #{state,jdbcType=INTEGER}, #{deletedSign,jdbcType=INTEGER}
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" parameterType="com.goafanti.common.model.OrgCognizance" >
|
|
|
+ insert into org_cognizance
|
|
|
+ <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="contacts != null" >
|
|
|
+ contacts,
|
|
|
+ </if>
|
|
|
+ <if test="comment != null" >
|
|
|
+ comment,
|
|
|
+ </if>
|
|
|
+ <if test="consultant != null" >
|
|
|
+ consultant,
|
|
|
+ </if>
|
|
|
+ <if test="technicalField1 != null" >
|
|
|
+ technical_field1,
|
|
|
+ </if>
|
|
|
+ <if test="technicalField2 != null" >
|
|
|
+ technical_field2,
|
|
|
+ </if>
|
|
|
+ <if test="technicalField3 != null" >
|
|
|
+ technical_field3,
|
|
|
+ </if>
|
|
|
+ <if test="basicResearchCost != null" >
|
|
|
+ basic_research_cost,
|
|
|
+ </if>
|
|
|
+ <if test="accident != null" >
|
|
|
+ accident,
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null" >
|
|
|
+ create_time,
|
|
|
+ </if>
|
|
|
+ <if test="acceptDate != null" >
|
|
|
+ accept_date,
|
|
|
+ </if>
|
|
|
+ <if test="issuingDate != null" >
|
|
|
+ issuing_date,
|
|
|
+ </if>
|
|
|
+ <if test="certificateNumber != null" >
|
|
|
+ certificate_number,
|
|
|
+ </if>
|
|
|
+ <if test="certificateUrl != null" >
|
|
|
+ certificate_url,
|
|
|
+ </if>
|
|
|
+ <if test="state != null" >
|
|
|
+ state,
|
|
|
+ </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="contacts != null" >
|
|
|
+ #{contacts,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="comment != null" >
|
|
|
+ #{comment,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="consultant != null" >
|
|
|
+ #{consultant,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="technicalField1 != null" >
|
|
|
+ #{technicalField1,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="technicalField2 != null" >
|
|
|
+ #{technicalField2,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="technicalField3 != null" >
|
|
|
+ #{technicalField3,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="basicResearchCost != null" >
|
|
|
+ #{basicResearchCost,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="accident != null" >
|
|
|
+ #{accident,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null" >
|
|
|
+ #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="acceptDate != null" >
|
|
|
+ #{acceptDate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="issuingDate != null" >
|
|
|
+ #{issuingDate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="certificateNumber != null" >
|
|
|
+ #{certificateNumber,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="certificateUrl != null" >
|
|
|
+ #{certificateUrl,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="state != null" >
|
|
|
+ #{state,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="deletedSign != null" >
|
|
|
+ #{deletedSign,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.OrgCognizance" >
|
|
|
+ update org_cognizance
|
|
|
+ <set >
|
|
|
+ <if test="uid != null" >
|
|
|
+ uid = #{uid,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="serialNumber != null" >
|
|
|
+ serial_number = #{serialNumber,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="contacts != null" >
|
|
|
+ contacts = #{contacts,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="comment != null" >
|
|
|
+ comment = #{comment,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="consultant != null" >
|
|
|
+ consultant = #{consultant,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="technicalField1 != null" >
|
|
|
+ technical_field1 = #{technicalField1,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="technicalField2 != null" >
|
|
|
+ technical_field2 = #{technicalField2,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="technicalField3 != null" >
|
|
|
+ technical_field3 = #{technicalField3,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="basicResearchCost != null" >
|
|
|
+ basic_research_cost = #{basicResearchCost,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="accident != null" >
|
|
|
+ accident = #{accident,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null" >
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="acceptDate != null" >
|
|
|
+ accept_date = #{acceptDate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="issuingDate != null" >
|
|
|
+ issuing_date = #{issuingDate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="certificateNumber != null" >
|
|
|
+ certificate_number = #{certificateNumber,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="certificateUrl != null" >
|
|
|
+ certificate_url = #{certificateUrl,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="state != null" >
|
|
|
+ state = #{state,jdbcType=INTEGER},
|
|
|
+ </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.OrgCognizance" >
|
|
|
+ update org_cognizance
|
|
|
+ set uid = #{uid,jdbcType=VARCHAR},
|
|
|
+ serial_number = #{serialNumber,jdbcType=INTEGER},
|
|
|
+ contacts = #{contacts,jdbcType=VARCHAR},
|
|
|
+ comment = #{comment,jdbcType=VARCHAR},
|
|
|
+ consultant = #{consultant,jdbcType=VARCHAR},
|
|
|
+ technical_field1 = #{technicalField1,jdbcType=INTEGER},
|
|
|
+ technical_field2 = #{technicalField2,jdbcType=INTEGER},
|
|
|
+ technical_field3 = #{technicalField3,jdbcType=INTEGER},
|
|
|
+ basic_research_cost = #{basicResearchCost,jdbcType=INTEGER},
|
|
|
+ accident = #{accident,jdbcType=INTEGER},
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ accept_date = #{acceptDate,jdbcType=TIMESTAMP},
|
|
|
+ issuing_date = #{issuingDate,jdbcType=TIMESTAMP},
|
|
|
+ certificate_number = #{certificateNumber,jdbcType=VARCHAR},
|
|
|
+ certificate_url = #{certificateUrl,jdbcType=VARCHAR},
|
|
|
+ state = #{state,jdbcType=INTEGER},
|
|
|
+ deleted_sign = #{deletedSign,jdbcType=INTEGER}
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <select id="findCognizanceBoByPage" parameterType="String" resultType="com.goafanti.techservice.cognizance.bo.CognizanceBo">
|
|
|
+ select x.uid, x.cid, x.serial_number as serialNumber, x.location_province as locationProvince,
|
|
|
+ x.unit_name as unitName, x.contacts, x.create_time as createTime, x.comment, x.state, x.certificate_number as certificateNumber,
|
|
|
+ x.issuing_date as issuingDate, a.name as consultant from
|
|
|
+ (select u.id as uid,
|
|
|
+ c.id as cid, c.serial_number, i.location_province,
|
|
|
+ i.unit_name, c.contacts, c.create_time,
|
|
|
+ c.comment, c.state, c.certificate_number,
|
|
|
+ c.issuing_date, c.consultant
|
|
|
+ from user u INNER JOIN org_cognizance c on u.id = c.uid and deleted_sign = 0
|
|
|
+ LEFT JOIN organization_identity i on i.uid = u.id) x
|
|
|
+ LEFT JOIN admin a on a.id = x.consultant
|
|
|
+ where 1 = 1
|
|
|
+ <if test="locationProvince != null">
|
|
|
+ and x.location_province = #{locationProvince, jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="unitName != null">
|
|
|
+ and x.unit_name = #{unitName,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ order by x.issuing_date desc
|
|
|
+ <if test="page_sql!=null">
|
|
|
+ ${page_sql}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="findCognizanceBoCount" resultType="java.lang.Integer" parameterType="String">
|
|
|
+ select count(1) from (
|
|
|
+
|
|
|
+ select x.uid, x.cid, x.serial_number as serialNumber, x.location_province as locationProvince,
|
|
|
+ x.unit_name as unitName, x.contacts, x.create_time as createTime, x.comment, x.state, x.certificate_number as certificateNumber,
|
|
|
+ x.issuing_date as issuingDate, a.name as consultant from
|
|
|
+ (select u.id as uid,
|
|
|
+ c.id as cid, c.serial_number, i.location_province,
|
|
|
+ i.unit_name, c.contacts, c.create_time,
|
|
|
+ c.comment, c.state, c.certificate_number,
|
|
|
+ c.issuing_date, c.consultant
|
|
|
+ from user u INNER JOIN org_cognizance c on u.id = c.uid and deleted_sign = 0
|
|
|
+ LEFT JOIN organization_identity i on i.uid = u.id) x
|
|
|
+ LEFT JOIN admin a on a.id = x.consultant
|
|
|
+ where 1 = 1
|
|
|
+ <if test="locationProvince != null">
|
|
|
+ and x.location_province = #{locationProvince, jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="unitName != null">
|
|
|
+ and x.unit_name = #{unitName,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ order by x.issuing_date desc
|
|
|
+ <if test="page_sql!=null">
|
|
|
+ ${page_sql}
|
|
|
+ </if>
|
|
|
+ ) as n
|
|
|
+ </select>
|
|
|
+</mapper>
|