|
|
@@ -0,0 +1,291 @@
|
|
|
+<?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" />
|
|
|
+ </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
|
|
|
+ </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)
|
|
|
+ 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})
|
|
|
+ </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>
|
|
|
+ </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>
|
|
|
+ </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>
|
|
|
+ </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}
|
|
|
+ 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>
|
|
|
+
|
|
|
+
|
|
|
+</mapper>
|