| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324 |
- <?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.RdDetailsMapper">
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.RdDetails">
- <id column="id" jdbcType="BIGINT" property="id" />
- <result column="user_name" jdbcType="VARCHAR" property="userName" />
- <result column="rd_no" jdbcType="VARCHAR" property="rdNo" />
- <result column="ip_no" jdbcType="VARCHAR" property="ipNo" />
- <result column="rd_name" jdbcType="VARCHAR" property="rdName" />
- <result column="rd_start" jdbcType="TIMESTAMP" property="rdStart" />
- <result column="rd_end" jdbcType="TIMESTAMP" property="rdEnd" />
- <result column="technical_field" jdbcType="VARCHAR" property="technicalField" />
- <result column="technology_source" jdbcType="VARCHAR" property="technologySource" />
- <result column="total_amount" jdbcType="DECIMAL" property="totalAmount" />
- <result column="recent_three_amount" jdbcType="DECIMAL" property="recentThreeAmount" />
- <result column="rd_objective" jdbcType="VARCHAR" property="rdObjective" />
- <result column="core_technology" jdbcType="VARCHAR" property="coreTechnology" />
- <result column="achieve_results" jdbcType="VARCHAR" property="achieveResults" />
- <result column="consultant_name" jdbcType="VARCHAR" property="consultantName" />
- <result column="status" jdbcType="INTEGER" property="status" />
- <result column="open_time" jdbcType="TIMESTAMP" property="openTime" />
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
- <result column="aid" jdbcType="VARCHAR" property="aid" />
- </resultMap>
- <sql id="Base_Column_List">
- id, user_name, rd_no, ip_no, rd_name, rd_start, rd_end, technical_field, technology_source,
- total_amount, recent_three_amount, rd_objective, core_technology, achieve_results,
- consultant_name, `status`, open_time, create_time, aid
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from rd_details
- where id = #{id,jdbcType=BIGINT}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
- delete from rd_details
- where id = #{id,jdbcType=BIGINT}
- </delete>
- <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.RdDetails" useGeneratedKeys="true">
- insert into rd_details (user_name, rd_no, ip_no,
- rd_name, rd_start, rd_end,
- technical_field, technology_source, total_amount,
- recent_three_amount, rd_objective, core_technology,
- achieve_results, consultant_name, `status`,
- open_time, create_time, aid
- )
- values (#{userName,jdbcType=VARCHAR}, #{rdNo,jdbcType=VARCHAR}, #{ipNo,jdbcType=VARCHAR},
- #{rdName,jdbcType=VARCHAR}, #{rdStart,jdbcType=TIMESTAMP}, #{rdEnd,jdbcType=TIMESTAMP},
- #{technicalField,jdbcType=VARCHAR}, #{technologySource,jdbcType=VARCHAR}, #{totalAmount,jdbcType=DECIMAL},
- #{recentThreeAmount,jdbcType=DECIMAL}, #{rdObjective,jdbcType=VARCHAR}, #{coreTechnology,jdbcType=VARCHAR},
- #{achieveResults,jdbcType=VARCHAR}, #{consultantName,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
- #{openTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, #{aid,jdbcType=VARCHAR}
- )
- </insert>
- <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.RdDetails" useGeneratedKeys="true">
- insert into rd_details
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="userName != null">
- user_name,
- </if>
- <if test="rdNo != null">
- rd_no,
- </if>
- <if test="ipNo != null">
- ip_no,
- </if>
- <if test="rdName != null">
- rd_name,
- </if>
- <if test="rdStart != null">
- rd_start,
- </if>
- <if test="rdEnd != null">
- rd_end,
- </if>
- <if test="technicalField != null">
- technical_field,
- </if>
- <if test="technologySource != null">
- technology_source,
- </if>
- <if test="totalAmount != null">
- total_amount,
- </if>
- <if test="recentThreeAmount != null">
- recent_three_amount,
- </if>
- <if test="rdObjective != null">
- rd_objective,
- </if>
- <if test="coreTechnology != null">
- core_technology,
- </if>
- <if test="achieveResults != null">
- achieve_results,
- </if>
- <if test="consultantName != null">
- consultant_name,
- </if>
- <if test="status != null">
- `status`,
- </if>
- <if test="openTime != null">
- open_time,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="aid != null">
- aid,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="userName != null">
- #{userName,jdbcType=VARCHAR},
- </if>
- <if test="rdNo != null">
- #{rdNo,jdbcType=VARCHAR},
- </if>
- <if test="ipNo != null">
- #{ipNo,jdbcType=VARCHAR},
- </if>
- <if test="rdName != null">
- #{rdName,jdbcType=VARCHAR},
- </if>
- <if test="rdStart != null">
- #{rdStart,jdbcType=TIMESTAMP},
- </if>
- <if test="rdEnd != null">
- #{rdEnd,jdbcType=TIMESTAMP},
- </if>
- <if test="technicalField != null">
- #{technicalField,jdbcType=VARCHAR},
- </if>
- <if test="technologySource != null">
- #{technologySource,jdbcType=VARCHAR},
- </if>
- <if test="totalAmount != null">
- #{totalAmount,jdbcType=DECIMAL},
- </if>
- <if test="recentThreeAmount != null">
- #{recentThreeAmount,jdbcType=DECIMAL},
- </if>
- <if test="rdObjective != null">
- #{rdObjective,jdbcType=VARCHAR},
- </if>
- <if test="coreTechnology != null">
- #{coreTechnology,jdbcType=VARCHAR},
- </if>
- <if test="achieveResults != null">
- #{achieveResults,jdbcType=VARCHAR},
- </if>
- <if test="consultantName != null">
- #{consultantName,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- #{status,jdbcType=INTEGER},
- </if>
- <if test="openTime != null">
- #{openTime,jdbcType=TIMESTAMP},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="aid != null">
- #{aid,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.RdDetails">
- update rd_details
- <set>
- <if test="userName != null">
- user_name = #{userName,jdbcType=VARCHAR},
- </if>
- <if test="rdNo != null">
- rd_no = #{rdNo,jdbcType=VARCHAR},
- </if>
- <if test="ipNo != null">
- ip_no = #{ipNo,jdbcType=VARCHAR},
- </if>
- <if test="rdName != null">
- rd_name = #{rdName,jdbcType=VARCHAR},
- </if>
- <if test="rdStart != null">
- rd_start = #{rdStart,jdbcType=TIMESTAMP},
- </if>
- <if test="rdEnd != null">
- rd_end = #{rdEnd,jdbcType=TIMESTAMP},
- </if>
- <if test="technicalField != null">
- technical_field = #{technicalField,jdbcType=VARCHAR},
- </if>
- <if test="technologySource != null">
- technology_source = #{technologySource,jdbcType=VARCHAR},
- </if>
- <if test="totalAmount != null">
- total_amount = #{totalAmount,jdbcType=DECIMAL},
- </if>
- <if test="recentThreeAmount != null">
- recent_three_amount = #{recentThreeAmount,jdbcType=DECIMAL},
- </if>
- <if test="rdObjective != null">
- rd_objective = #{rdObjective,jdbcType=VARCHAR},
- </if>
- <if test="coreTechnology != null">
- core_technology = #{coreTechnology,jdbcType=VARCHAR},
- </if>
- <if test="achieveResults != null">
- achieve_results = #{achieveResults,jdbcType=VARCHAR},
- </if>
- <if test="consultantName != null">
- consultant_name = #{consultantName,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- `status` = #{status,jdbcType=INTEGER},
- </if>
- <if test="openTime != null">
- open_time = #{openTime,jdbcType=TIMESTAMP},
- </if>
- <if test="createTime != null">
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="aid != null">
- aid = #{aid,jdbcType=VARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=BIGINT}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.RdDetails">
- update rd_details
- set user_name = #{userName,jdbcType=VARCHAR},
- rd_no = #{rdNo,jdbcType=VARCHAR},
- ip_no = #{ipNo,jdbcType=VARCHAR},
- rd_name = #{rdName,jdbcType=VARCHAR},
- rd_start = #{rdStart,jdbcType=TIMESTAMP},
- rd_end = #{rdEnd,jdbcType=TIMESTAMP},
- technical_field = #{technicalField,jdbcType=VARCHAR},
- technology_source = #{technologySource,jdbcType=VARCHAR},
- total_amount = #{totalAmount,jdbcType=DECIMAL},
- recent_three_amount = #{recentThreeAmount,jdbcType=DECIMAL},
- rd_objective = #{rdObjective,jdbcType=VARCHAR},
- core_technology = #{coreTechnology,jdbcType=VARCHAR},
- achieve_results = #{achieveResults,jdbcType=VARCHAR},
- consultant_name = #{consultantName,jdbcType=VARCHAR},
- `status` = #{status,jdbcType=INTEGER},
- open_time = #{openTime,jdbcType=TIMESTAMP},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- aid = #{aid,jdbcType=VARCHAR}
- where id = #{id,jdbcType=BIGINT}
- </update>
- <select id="checkRdNo" resultType="java.lang.Integer">
- select count(*)
- from rd_details
- where rd_no =#{rdNo}
- </select>
- <sql id="details_List">
- a.id, a.user_name userName, a.rd_no rdNo, a.ip_no ipNo, a.rd_name rdName,a.technical_field technicalField,
- a.technology_source technologySource, a.total_amount totalAmount, a.recent_three_amount recentThreeAmount,
- a.rd_objective rdObjective, a.core_technology coreTechnology, a.achieve_results achieveResults,
- a.consultant_name consultantName, a.status, date_format(a.rd_start, '%Y-%m-%d %H:%i:%s') rdStartS,
- date_format(a.rd_end , '%Y-%m-%d %H:%i:%s') rdEndS,date_format(a.open_time, '%Y-%m-%d %H:%i:%s')openTimeS,
- date_format(a.create_time, '%Y-%m-%d %H:%i:%s') createTimeS
- </sql>
- <select id="details" resultType="com.goafanti.RD.bo.OutRdDetails">
- select
- <include refid="details_List" />
- from rd_details a
- where a.id =#{id}
- </select>
- <select id="RdDetailsList" resultType="com.goafanti.RD.bo.OutRdDetails">
- select
- <include refid="details_List" />
- from rd_details a
- where 1=1
- <if test="RdStart !=null and RdEnd !=null">
- and a.rd_start >= #{RdStart} and a.rd_end <![CDATA[ <= ]]> #{RdEnd}
- </if>
- <if test="RdName !=null ">
- and a.rd_name =#{RdName}
- </if>
- <if test="page_sql !=null ">
- ${page_sql}
- </if>
- </select>
- <select id="RdDetailsCount" resultType="java.lang.Integer">
- select
- count(*)
- from rd_details a
- where 1=1
- <if test="RdStart !=null and RdEnd !=null">
- and a.rd_start >= #{RdStart} and a.rd_end <![CDATA[ <= ]]> #{RdEnd}
- </if>
- <if test="RdName !=null ">
- and a.rd_name =#{RdName}
- </if>
- </select>
- <insert id="insertBatch">
- insert into rd_details (user_name, rd_no, ip_no,
- rd_name, rd_start, rd_end,
- technical_field, technology_source, total_amount,
- recent_three_amount, rd_objective, core_technology,
- achieve_results, consultant_name, `status`,
- open_time, create_time, aid
- ) values
- <foreach item="item" index="index" collection="list" separator=",">
- (#{item.userName,jdbcType=VARCHAR}, #{item.rdNo,jdbcType=VARCHAR}, #{item.ipNo,jdbcType=VARCHAR},
- #{item.rdName,jdbcType=VARCHAR}, #{item.rdStart,jdbcType=TIMESTAMP}, #{item.rdEnd,jdbcType=TIMESTAMP},
- #{item.technicalField,jdbcType=VARCHAR}, #{item.technologySource,jdbcType=VARCHAR}, #{item.totalAmount,jdbcType=DECIMAL},
- #{item.recentThreeAmount,jdbcType=DECIMAL}, #{item.rdObjective,jdbcType=VARCHAR}, #{item.coreTechnology,jdbcType=VARCHAR},
- #{item.achieveResults,jdbcType=VARCHAR}, #{item.consultantName,jdbcType=VARCHAR}, #{item.status,jdbcType=INTEGER},
- #{item.openTime,jdbcType=TIMESTAMP}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.aid,jdbcType=VARCHAR}
- )
- </foreach>
- </insert>
- </mapper>
|