|
|
@@ -0,0 +1,195 @@
|
|
|
+<?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.TaskTimeMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.goafanti.common.model.TaskTime">
|
|
|
+ <id column="id" jdbcType="INTEGER" property="id" />
|
|
|
+ <result column="tid" jdbcType="INTEGER" property="tid" />
|
|
|
+ <result column="project_status" jdbcType="INTEGER" property="projectStatus" />
|
|
|
+ <result column="date_time" jdbcType="DATE" property="dateTime" />
|
|
|
+ <result column="suspend_img" jdbcType="VARCHAR" property="suspendImg" />
|
|
|
+ <result column="title" jdbcType="VARCHAR" property="title" />
|
|
|
+ <result column="certificate_number" jdbcType="VARCHAR" property="certificateNumber" />
|
|
|
+ <result column="set_up_amount" jdbcType="VARCHAR" property="setUpAmount" />
|
|
|
+ <result column="appropriation" jdbcType="VARCHAR" property="appropriation" />
|
|
|
+ <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ id, tid, project_status, date_time, suspend_img, title, certificate_number, set_up_amount,
|
|
|
+ appropriation, create_time
|
|
|
+ </sql>
|
|
|
+ <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from task_time
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </select>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
|
+ delete from task_time
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TaskTime" useGeneratedKeys="true">
|
|
|
+ insert into task_time (tid, project_status, date_time,
|
|
|
+ suspend_img, title, certificate_number,
|
|
|
+ set_up_amount, appropriation, create_time
|
|
|
+ )
|
|
|
+ values (#{tid,jdbcType=INTEGER}, #{projectStatus,jdbcType=INTEGER}, #{dateTime,jdbcType=DATE},
|
|
|
+ #{suspendImg,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{certificateNumber,jdbcType=VARCHAR},
|
|
|
+ #{setUpAmount,jdbcType=VARCHAR}, #{appropriation,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TaskTime" useGeneratedKeys="true">
|
|
|
+ insert into task_time
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="tid != null">
|
|
|
+ tid,
|
|
|
+ </if>
|
|
|
+ <if test="projectStatus != null">
|
|
|
+ project_status,
|
|
|
+ </if>
|
|
|
+ <if test="dateTime != null">
|
|
|
+ date_time,
|
|
|
+ </if>
|
|
|
+ <if test="suspendImg != null">
|
|
|
+ suspend_img,
|
|
|
+ </if>
|
|
|
+ <if test="title != null">
|
|
|
+ title,
|
|
|
+ </if>
|
|
|
+ <if test="certificateNumber != null">
|
|
|
+ certificate_number,
|
|
|
+ </if>
|
|
|
+ <if test="setUpAmount != null">
|
|
|
+ set_up_amount,
|
|
|
+ </if>
|
|
|
+ <if test="appropriation != null">
|
|
|
+ appropriation,
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="tid != null">
|
|
|
+ #{tid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="projectStatus != null">
|
|
|
+ #{projectStatus,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="dateTime != null">
|
|
|
+ #{dateTime,jdbcType=DATE},
|
|
|
+ </if>
|
|
|
+ <if test="suspendImg != null">
|
|
|
+ #{suspendImg,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="title != null">
|
|
|
+ #{title,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="certificateNumber != null">
|
|
|
+ #{certificateNumber,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="setUpAmount != null">
|
|
|
+ #{setUpAmount,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="appropriation != null">
|
|
|
+ #{appropriation,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TaskTime">
|
|
|
+ update task_time
|
|
|
+ <set>
|
|
|
+ <if test="tid != null">
|
|
|
+ tid = #{tid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="projectStatus != null">
|
|
|
+ project_status = #{projectStatus,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="dateTime != null">
|
|
|
+ date_time = #{dateTime,jdbcType=DATE},
|
|
|
+ </if>
|
|
|
+ <if test="suspendImg != null">
|
|
|
+ suspend_img = #{suspendImg,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="title != null">
|
|
|
+ title = #{title,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="certificateNumber != null">
|
|
|
+ certificate_number = #{certificateNumber,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="setUpAmount != null">
|
|
|
+ set_up_amount = #{setUpAmount,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="appropriation != null">
|
|
|
+ appropriation = #{appropriation,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TaskTime">
|
|
|
+ update task_time
|
|
|
+ set tid = #{tid,jdbcType=INTEGER},
|
|
|
+ project_status = #{projectStatus,jdbcType=INTEGER},
|
|
|
+ date_time = #{dateTime,jdbcType=DATE},
|
|
|
+ suspend_img = #{suspendImg,jdbcType=VARCHAR},
|
|
|
+ title = #{title,jdbcType=VARCHAR},
|
|
|
+ certificate_number = #{certificateNumber,jdbcType=VARCHAR},
|
|
|
+ set_up_amount = #{setUpAmount,jdbcType=VARCHAR},
|
|
|
+ appropriation = #{appropriation,jdbcType=VARCHAR},
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP}
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </update>
|
|
|
+ <update id="updateByTidAndProjectSelective">
|
|
|
+ update task_time
|
|
|
+ <set>
|
|
|
+ <if test="dateTime != null">
|
|
|
+ date_time = #{dateTime,jdbcType=DATE},
|
|
|
+ </if>
|
|
|
+ <if test="suspendImg != null">
|
|
|
+ suspend_img = #{suspendImg,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="title != null">
|
|
|
+ title = #{title,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="certificateNumber != null">
|
|
|
+ certificate_number = #{certificateNumber,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="setUpAmount != null">
|
|
|
+ set_up_amount = #{setUpAmount,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="appropriation != null">
|
|
|
+ appropriation = #{appropriation,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where tid = #{tid,jdbcType=INTEGER} and project_status = #{projectStatus,jdbcType=INTEGER}
|
|
|
+ </update>
|
|
|
+ <select id="selectByTidAndProject" parameterType="com.goafanti.common.model.TaskTime" resultMap="BaseResultMap">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from task_time
|
|
|
+ where tid = #{tid,jdbcType=INTEGER}
|
|
|
+ </select>
|
|
|
+ <select id="getAllTimeRecord" resultType="com.goafanti.common.model.TOrderTask">
|
|
|
+ SELECT id,time_record timeRecord
|
|
|
+ from t_order_task
|
|
|
+ where time_record is not null and split_status in (0,2)
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertBatch">
|
|
|
+ insert into task_time (tid, project_status, date_time,
|
|
|
+ suspend_img, title, certificate_number,
|
|
|
+ set_up_amount, appropriation
|
|
|
+ ) values
|
|
|
+ <foreach collection="list" index="index" item="item" separator=",">
|
|
|
+ ( #{item.tid}, #{item.projectStatus},#{item.dateTime,jdbcType=DATE},
|
|
|
+ #{item.suspendImg},#{item.title},#{item.certificateNumber},
|
|
|
+ #{item.setUpAmount},#{item.appropriation}
|
|
|
+ )
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+</mapper>
|