| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- <?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.PatentLogMapper" >
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.PatentLog" >
- <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 patent_log
- where id = #{id,jdbcType=VARCHAR}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
- delete from patent_log
- where id = #{id,jdbcType=VARCHAR}
- </delete>
- <insert id="insert" parameterType="com.goafanti.common.model.PatentLog" >
- insert into patent_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.PatentLog" >
- insert into patent_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.PatentLog" >
- update patent_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.PatentLog" >
- update patent_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="selectProcessByPid" parameterType="java.lang.String" resultMap="BaseResultMap">
- select b.name as principal , m.operator , m.id , m.pid , m.state , m.comment , m.record_time from
- (select a.name as operator, p.id ,p.pid , p.state , p.comment ,p.record_time , p.principal as pri
- from patent_log p LEFT JOIN admin a
- on a.id = p.operator ) m LEFT JOIN admin b on m.pri = b. id
- where pid = #{pid,jdbcType=VARCHAR} order by m.record_time desc
-
- </select>
- </mapper>
|