| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401 |
- <?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.TechProjectMapper">
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.TechProject">
- <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="INTEGER" />
- <result column="department" property="department" jdbcType="VARCHAR" />
- <result column="dispatch_info" property="dispatchInfo"
- jdbcType="VARCHAR" />
- <result column="project_name" property="projectName" jdbcType="VARCHAR" />
- <result column="project_catagory" property="projectCatagory"
- jdbcType="VARCHAR" />
- <result column="tech_field" property="techField" jdbcType="VARCHAR" />
- <result column="project_des" property="projectDes" jdbcType="VARCHAR" />
- <result column="project_mode" property="projectMode" jdbcType="INTEGER" />
- <result column="project_approval" property="projectApproval"
- jdbcType="DECIMAL" />
- <result column="subsidy" property="subsidy" jdbcType="INTEGER" />
- <result column="consultant" property="consultant" jdbcType="VARCHAR" />
- <result column="approval_url" property="approvalUrl" jdbcType="VARCHAR" />
- <result column="state" property="state" jdbcType="INTEGER" />
- <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
- <result column="accept_date" property="acceptDate" jdbcType="TIMESTAMP" />
- <result column="approved_date" property="approvedDate"
- jdbcType="TIMESTAMP" />
- <result column="record_time" property="recordTime" jdbcType="TIMESTAMP" />
- <result column="deleted_sign" property="deletedSign" jdbcType="INTEGER" />
- </resultMap>
- <sql id="Base_Column_List">
- id, uid, serial_number, contacts, department, dispatch_info,
- project_name, project_catagory,
- tech_field, project_des, project_mode, project_approval, subsidy, consultant,
- approval_url,
- state, create_time, accept_date, approved_date, record_time, deleted_sign
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap"
- parameterType="java.lang.String">
- select
- <include refid="Base_Column_List" />
- from tech_project
- where id = #{id,jdbcType=VARCHAR}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
- delete from tech_project
- where id = #{id,jdbcType=VARCHAR}
- </delete>
- <insert id="insert" parameterType="com.goafanti.common.model.TechProject">
- insert into tech_project (id, uid, serial_number,
- contacts, department, dispatch_info,
- project_name, project_catagory, tech_field,
- project_des, project_mode, project_approval,
- subsidy, consultant, approval_url,
- state, create_time, accept_date,
- approved_date, record_time, deleted_sign
- )
- values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR},
- #{serialNumber,jdbcType=INTEGER},
- #{contacts,jdbcType=INTEGER}, #{department,jdbcType=VARCHAR}, #{dispatchInfo,jdbcType=VARCHAR},
- #{projectName,jdbcType=VARCHAR}, #{projectCatagory,jdbcType=VARCHAR},
- #{techField,jdbcType=VARCHAR},
- #{projectDes,jdbcType=VARCHAR}, #{projectMode,jdbcType=INTEGER}, #{projectApproval,jdbcType=DECIMAL},
- #{subsidy,jdbcType=INTEGER}, #{consultant,jdbcType=VARCHAR},
- #{approvalUrl,jdbcType=VARCHAR},
- #{state,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{acceptDate,jdbcType=TIMESTAMP},
- #{approvedDate,jdbcType=TIMESTAMP}, #{recordTime,jdbcType=TIMESTAMP},
- #{deletedSign,jdbcType=INTEGER}
- )
- </insert>
- <insert id="insertSelective" parameterType="com.goafanti.common.model.TechProject">
- insert into tech_project
- <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="department != null">
- department,
- </if>
- <if test="dispatchInfo != null">
- dispatch_info,
- </if>
- <if test="projectName != null">
- project_name,
- </if>
- <if test="projectCatagory != null">
- project_catagory,
- </if>
- <if test="techField != null">
- tech_field,
- </if>
- <if test="projectDes != null">
- project_des,
- </if>
- <if test="projectMode != null">
- project_mode,
- </if>
- <if test="projectApproval != null">
- project_approval,
- </if>
- <if test="subsidy != null">
- subsidy,
- </if>
- <if test="consultant != null">
- consultant,
- </if>
- <if test="approvalUrl != null">
- approval_url,
- </if>
- <if test="state != null">
- state,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="acceptDate != null">
- accept_date,
- </if>
- <if test="approvedDate != null">
- approved_date,
- </if>
- <if test="recordTime != null">
- record_time,
- </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=INTEGER},
- </if>
- <if test="department != null">
- #{department,jdbcType=VARCHAR},
- </if>
- <if test="dispatchInfo != null">
- #{dispatchInfo,jdbcType=VARCHAR},
- </if>
- <if test="projectName != null">
- #{projectName,jdbcType=VARCHAR},
- </if>
- <if test="projectCatagory != null">
- #{projectCatagory,jdbcType=VARCHAR},
- </if>
- <if test="techField != null">
- #{techField,jdbcType=VARCHAR},
- </if>
- <if test="projectDes != null">
- #{projectDes,jdbcType=VARCHAR},
- </if>
- <if test="projectMode != null">
- #{projectMode,jdbcType=INTEGER},
- </if>
- <if test="projectApproval != null">
- #{projectApproval,jdbcType=DECIMAL},
- </if>
- <if test="subsidy != null">
- #{subsidy,jdbcType=INTEGER},
- </if>
- <if test="consultant != null">
- #{consultant,jdbcType=VARCHAR},
- </if>
- <if test="approvalUrl != null">
- #{approvalUrl,jdbcType=VARCHAR},
- </if>
- <if test="state != null">
- #{state,jdbcType=INTEGER},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="acceptDate != null">
- #{acceptDate,jdbcType=TIMESTAMP},
- </if>
- <if test="approvedDate != null">
- #{approvedDate,jdbcType=TIMESTAMP},
- </if>
- <if test="recordTime != null">
- #{recordTime,jdbcType=TIMESTAMP},
- </if>
- <if test="deletedSign != null">
- #{deletedSign,jdbcType=INTEGER},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TechProject">
- update tech_project
- <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=INTEGER},
- </if>
- <if test="department != null">
- department = #{department,jdbcType=VARCHAR},
- </if>
- <if test="dispatchInfo != null">
- dispatch_info = #{dispatchInfo,jdbcType=VARCHAR},
- </if>
- <if test="projectName != null">
- project_name = #{projectName,jdbcType=VARCHAR},
- </if>
- <if test="projectCatagory != null">
- project_catagory = #{projectCatagory,jdbcType=VARCHAR},
- </if>
- <if test="techField != null">
- tech_field = #{techField,jdbcType=VARCHAR},
- </if>
- <if test="projectDes != null">
- project_des = #{projectDes,jdbcType=VARCHAR},
- </if>
- <if test="projectMode != null">
- project_mode = #{projectMode,jdbcType=INTEGER},
- </if>
- <if test="projectApproval != null">
- project_approval = #{projectApproval,jdbcType=DECIMAL},
- </if>
- <if test="subsidy != null">
- subsidy = #{subsidy,jdbcType=INTEGER},
- </if>
- <if test="consultant != null">
- consultant = #{consultant,jdbcType=VARCHAR},
- </if>
- <if test="approvalUrl != null">
- approval_url = #{approvalUrl,jdbcType=VARCHAR},
- </if>
- <if test="state != null">
- state = #{state,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="approvedDate != null">
- approved_date = #{approvedDate,jdbcType=TIMESTAMP},
- </if>
- <if test="recordTime != null">
- record_time = #{recordTime,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.TechProject">
- update tech_project
- set uid = #{uid,jdbcType=VARCHAR},
- serial_number = #{serialNumber,jdbcType=INTEGER},
- contacts = #{contacts,jdbcType=INTEGER},
- department = #{department,jdbcType=VARCHAR},
- dispatch_info = #{dispatchInfo,jdbcType=VARCHAR},
- project_name = #{projectName,jdbcType=VARCHAR},
- project_catagory = #{projectCatagory,jdbcType=VARCHAR},
- tech_field = #{techField,jdbcType=VARCHAR},
- project_des = #{projectDes,jdbcType=VARCHAR},
- project_mode = #{projectMode,jdbcType=INTEGER},
- project_approval = #{projectApproval,jdbcType=DECIMAL},
- subsidy = #{subsidy,jdbcType=INTEGER},
- consultant = #{consultant,jdbcType=VARCHAR},
- approval_url = #{approvalUrl,jdbcType=VARCHAR},
- state = #{state,jdbcType=INTEGER},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- accept_date = #{acceptDate,jdbcType=TIMESTAMP},
- approved_date = #{approvedDate,jdbcType=TIMESTAMP},
- record_time = #{recordTime,jdbcType=TIMESTAMP},
- deleted_sign = #{deletedSign,jdbcType=INTEGER}
- where id = #{id,jdbcType=VARCHAR}
- </update>
- <select id="findTechProjectClientListByPage" parameterType="java.lang.String"
- resultType="com.goafanti.techproject.bo.TechProjectClientListBo">
- select p.id, p.uid, i.location_province as province,
- i.unit_name as unitName,
- CONCAT(i.first_contacts,' ', i.first_mobile) as firstContacts,
- CONCAT(i.second_contacts,' ', i.second_mobile) as secondContacts,
- CONCAT(i.third_contacts,' ', i.third_mobile) as thirdContacts,
- p.serial_number as serialNumber, p.create_time as createTime, p.approved_date as approvedDate,
- p.accept_date as acceptDate, a.name as consultant, p.contacts,
- p.project_name as projectName, p.project_catagory as projectCatagory, p.tech_field as techField, p.state
- FROM tech_project p
- LEFT JOIN organization_identity i on i.uid = p.uid
- LEFT JOIN admin a on p.consultant = a.id
- where p.deleted_sign = 0
- <if test ="uid != null">
- and p.uid = #{uid,jdbcType=VARCHAR}
- </if>
- order by p.serial_number desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id="findTechProjectClientCount" resultType="java.lang.Integer" parameterType="String">
- select count(1)
- FROM tech_project p
- LEFT JOIN organization_identity i on i.uid = p.uid
- LEFT JOIN admin a on p.consultant = a.id
- where p.deleted_sign = 0
- <if test ="uid != null">
- and p.uid = #{uid,jdbcType=VARCHAR}
- </if>
- </select>
-
- <select id ="findTechProjectManageListByPage" parameterType="java.lang.String"
- resultType="com.goafanti.techproject.bo.TechProjectManageListBo">
- select x.* from (select p.id, p.uid, i.location_province as province,
- i.unit_name as unitName,
- CONCAT(i.first_contacts,' ', i.first_mobile) as firstContacts,
- CONCAT(i.second_contacts,' ', i.second_mobile) as secondContacts,
- CONCAT(i.third_contacts,' ', i.third_mobile) as thirdContacts,
- p.serial_number as serialNumber, p.create_time as createTime, p.approved_date as approvedDate,
- p.accept_date as acceptDate, a.name as consultant, p.contacts,
- p.project_name as projectName, p.project_catagory as projectCatagory, p.tech_field as techField, p.state,
- w.id as wid, w.website, w.account_number as accountNumber, w.department, w.password, p.deleted_sign as pd, w.deleted_sign as wd
- FROM tech_project p
- LEFT JOIN organization_identity i on i.uid = p.uid
- LEFT JOIN admin a on p.consultant = a.id
- LEFT JOIN tech_website w on p.department = w.id where p.deleted_sign = 0 ) x where x.wd = 0 or x.wd is null
- <if test="province != null">
- and x.province = #{province,jdbcType=VARCHAR}
- </if>
- <if test="unitName != null" >
- and x.unitName like CONCAT('%', #{unitName,jdbcType=VARCHAR}, '%')
- </if>
- order by x.serialNumber desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id="findTechProjectManageCount" resultType="java.lang.Integer" parameterType="String">
- select count(1) from ( select x.* from (select p.id, p.uid, i.location_province as province,
- i.unit_name as unitName,
- CONCAT(i.first_contacts,' ', i.first_mobile) as firstContacts,
- CONCAT(i.second_contacts,' ', i.second_mobile) as secondContacts,
- CONCAT(i.third_contacts,' ', i.third_mobile) as thirdContacts,
- p.serial_number as serialNumber, p.create_time as createTime, p.approved_date as approvedDate,
- p.accept_date as acceptDate, a.name as consultant, p.contacts,
- p.project_name as projectName, p.project_catagory as projectCatagory, p.tech_field as techField, p.state,
- w.id as wid, w.website, w.account_number as accountNumber, w.department, w.password, p.deleted_sign as pd, w.deleted_sign as wd
- FROM tech_project p
- LEFT JOIN organization_identity i on i.uid = p.uid
- LEFT JOIN admin a on p.consultant = a.id
- LEFT JOIN tech_website w on p.department = w.id where p.deleted_sign = 0 ) x where x.wd = 0 or x.wd is null
- <if test="province != null">
- and x.province = #{province,jdbcType=VARCHAR}
- </if>
- <if test="unitName != null" >
- and x.unitName like CONCAT('%', #{unitName,jdbcType=VARCHAR}, '%')
- </if>
- ) y
- </select>
-
- <select id="selectProjectDetail" resultType="com.goafanti.techproject.bo.TechProjectDetailBo" parameterType="java.lang.String">
- select
- p.id, p.uid, i.location_province as province, i.location_city as city, i.location_area as area,
- i.unit_name as unitName, i.org_code as orgCode,
- p.serial_number as serialNumber,
- a.name as consultant, p.contacts, p.project_des as projectDes, p.subsidy, p.dispatch_info as dispatchInfo,
- p.project_mode as projectMode, p.project_approval as projectApproval, p.approval_url as approvalUrl , p.department,
- p.project_name as projectName, p.project_catagory as projectCatagory, p.tech_field as techField, p.state
- FROM tech_project p
- LEFT JOIN organization_identity i on i.uid = p.uid
- LEFT JOIN admin a on p.consultant = a.id
- where p.deleted_sign = 0 and p.id = #{uid,jdbcType=VARCHAR}
- </select>
-
- <update id="batchDeleteByPrimaryKey" parameterType="java.util.List">
- update tech_project set deleted_sign = 1
- where id in
- <foreach item="item" index="index" collection="list" open="(" separator="," close=")">
- #{item}
- </foreach>
- </update>
- </mapper>
|