| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- <?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.TechProjectLogMapper" >
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.TechProjectLog" >
- <id column="id" property="id" jdbcType="VARCHAR" />
- <result column="pid" property="pid" jdbcType="VARCHAR" />
- <result column="record_time" property="recordTime" jdbcType="TIMESTAMP" />
- <result column="state" property="state" jdbcType="INTEGER" />
- <result column="principal" property="principal" jdbcType="VARCHAR" />
- <result column="operator" property="operator" jdbcType="VARCHAR" />
- <result column="comment" property="comment" jdbcType="VARCHAR" />
- </resultMap>
- <sql id="Base_Column_List" >
- id, pid, record_time, state, principal, operator, comment
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
- select
- <include refid="Base_Column_List" />
- from tech_project_log
- where id = #{id,jdbcType=VARCHAR}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
- delete from tech_project_log
- where id = #{id,jdbcType=VARCHAR}
- </delete>
- <insert id="insert" parameterType="com.goafanti.common.model.TechProjectLog" >
- insert into tech_project_log (id, pid, record_time,
- state, principal, operator,
- comment)
- values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{recordTime,jdbcType=TIMESTAMP},
- #{state,jdbcType=INTEGER}, #{principal,jdbcType=VARCHAR}, #{operator,jdbcType=VARCHAR},
- #{comment,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.goafanti.common.model.TechProjectLog" >
- insert into tech_project_log
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- id,
- </if>
- <if test="pid != null" >
- pid,
- </if>
- <if test="recordTime != null" >
- record_time,
- </if>
- <if test="state != null" >
- state,
- </if>
- <if test="principal != null" >
- principal,
- </if>
- <if test="operator != null" >
- operator,
- </if>
- <if test="comment != null" >
- comment,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- #{id,jdbcType=VARCHAR},
- </if>
- <if test="pid != null" >
- #{pid,jdbcType=VARCHAR},
- </if>
- <if test="recordTime != null" >
- #{recordTime,jdbcType=TIMESTAMP},
- </if>
- <if test="state != null" >
- #{state,jdbcType=INTEGER},
- </if>
- <if test="principal != null" >
- #{principal,jdbcType=VARCHAR},
- </if>
- <if test="operator != null" >
- #{operator,jdbcType=VARCHAR},
- </if>
- <if test="comment != null" >
- #{comment,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TechProjectLog" >
- update tech_project_log
- <set >
- <if test="pid != null" >
- pid = #{pid,jdbcType=VARCHAR},
- </if>
- <if test="recordTime != null" >
- record_time = #{recordTime,jdbcType=TIMESTAMP},
- </if>
- <if test="state != null" >
- state = #{state,jdbcType=INTEGER},
- </if>
- <if test="principal != null" >
- principal = #{principal,jdbcType=VARCHAR},
- </if>
- <if test="operator != null" >
- operator = #{operator,jdbcType=VARCHAR},
- </if>
- <if test="comment != null" >
- comment = #{comment,jdbcType=VARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TechProjectLog" >
- update tech_project_log
- set pid = #{pid,jdbcType=VARCHAR},
- record_time = #{recordTime,jdbcType=TIMESTAMP},
- state = #{state,jdbcType=INTEGER},
- principal = #{principal,jdbcType=VARCHAR},
- operator = #{operator,jdbcType=VARCHAR},
- comment = #{comment,jdbcType=VARCHAR}
- where id = #{id,jdbcType=VARCHAR}
- </update>
-
- <select id="selectTechProjectLogByPid" resultType="com.goafanti.common.model.TechProjectLog" parameterType="java.lang.String" >
- SELECT
- tpl.id,
- tpl.pid,
- tpl.state ,
- tpl.comment,
- tpl.record_time as recordTime,
- a.name AS operator,
- ad.name AS principal
- FROM
- tech_project_log tpl
- LEFT JOIN admin a ON a.id = tpl.operator
- LEFT JOIN admin ad ON ad.id = tpl.principal
- WHERE
- tpl.pid = #{pid,jdbcType=VARCHAR}
- ORDER BY
- tpl.record_time
- </select>
-
- <insert id="batchInsert" parameterType="com.goafanti.common.model.TechProjectLog">
- insert into tech_project_log (id, pid, record_time,
- state, principal, operator,
- comment)
- values
- <foreach item="item" index="index" collection="list" separator=",">
- (
- #{item.id,jdbcType=VARCHAR}, #{item.pid,jdbcType=VARCHAR}, #{item.recordTime,jdbcType=TIMESTAMP},
- #{item.state,jdbcType=INTEGER}, #{item.principal,jdbcType=VARCHAR}, #{item.operator,jdbcType=VARCHAR},
- #{item.comment,jdbcType=VARCHAR}
- )
- </foreach>
- </insert>
- </mapper>
|