| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- <?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.ruoyi.system.mapper.UserRecordMapper">
- <resultMap id="BaseResultMap" type="com.ruoyi.system.domain.UserRecord">
- <id property="id" column="id" jdbcType="BIGINT"/>
- <result property="ddUserId" column="dd_user_id" jdbcType="BIGINT"/>
- <result property="psrId" column="psr_id" jdbcType="BIGINT"/>
- <result property="name" column="name" jdbcType="VARCHAR"/>
- <result property="status" column="status" jdbcType="INTEGER"/>
- <result property="clockStatus" column="clock_status" jdbcType="INTEGER"/>
- <result property="content" column="content" jdbcType="VARCHAR"/>
- <result property="recordTime" column="record_time" jdbcType="TIMESTAMP"/>
- <result property="startTime" column="start_time" jdbcType="TIMESTAMP"/>
- <result property="endTime" column="end_time" jdbcType="TIMESTAMP"/>
- <result property="sumDuration" column="sum_duration" jdbcType="DOUBLE"/>
- <result property="checkDuration" column="check_duration" jdbcType="DOUBLE"/>
- <result property="createId" column="create_id" jdbcType="BIGINT"/>
- </resultMap>
- <sql id="Base_Column_List">
- id,dd_user_id,psr_id,
- name,status,clock_status,
- content,record_time,start_time,
- end_time,sum_duration,check_duration,
- create_id
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from user_record
- where id = #{id,jdbcType=BIGINT}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
- delete from user_record
- where id = #{id,jdbcType=BIGINT}
- </delete>
- <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.ruoyi.system.domain.UserRecord" useGeneratedKeys="true">
- insert into user_record
- ( id,dd_user_id,psr_id
- ,name,status,clock_status
- ,content,record_time,start_time
- ,end_time,sum_duration,check_duration
- ,create_id)
- values (#{id,jdbcType=BIGINT},#{ddUserId,jdbcType=BIGINT},#{psrId,jdbcType=BIGINT}
- ,#{name,jdbcType=VARCHAR},#{status,jdbcType=INTEGER},#{clockStatus,jdbcType=INTEGER}
- ,#{content,jdbcType=VARCHAR},#{recordTime,jdbcType=TIMESTAMP},#{startTime,jdbcType=TIMESTAMP}
- ,#{endTime,jdbcType=TIMESTAMP},#{sumDuration,jdbcType=DOUBLE},#{checkDuration,jdbcType=DOUBLE}
- ,#{createId,jdbcType=BIGINT})
- </insert>
- <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.ruoyi.system.domain.UserRecord" useGeneratedKeys="true">
- insert into user_record
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">id,</if>
- <if test="ddUserId != null">dd_user_id,</if>
- <if test="psrId != null">psr_id,</if>
- <if test="name != null">name,</if>
- <if test="status != null">status,</if>
- <if test="clockStatus != null">clock_status,</if>
- <if test="content != null">content,</if>
- <if test="recordTime != null">record_time,</if>
- <if test="startTime != null">start_time,</if>
- <if test="endTime != null">end_time,</if>
- <if test="sumDuration != null">sum_duration,</if>
- <if test="checkDuration != null">check_duration,</if>
- <if test="createId != null">create_id,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">#{id,jdbcType=BIGINT},</if>
- <if test="ddUserId != null">#{ddUserId,jdbcType=BIGINT},</if>
- <if test="psrId != null">#{psrId,jdbcType=BIGINT},</if>
- <if test="name != null">#{name,jdbcType=VARCHAR},</if>
- <if test="status != null">#{status,jdbcType=INTEGER},</if>
- <if test="clockStatus != null">#{clockStatus,jdbcType=INTEGER},</if>
- <if test="content != null">#{content,jdbcType=VARCHAR},</if>
- <if test="recordTime != null">#{recordTime,jdbcType=TIMESTAMP},</if>
- <if test="startTime != null">#{startTime,jdbcType=TIMESTAMP},</if>
- <if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</if>
- <if test="sumDuration != null">#{sumDuration,jdbcType=DOUBLE},</if>
- <if test="checkDuration != null">#{checkDuration,jdbcType=DOUBLE},</if>
- <if test="createId != null">#{createId,jdbcType=BIGINT},</if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.ruoyi.system.domain.UserRecord">
- update user_record
- <set>
- <if test="ddUserId != null">
- dd_user_id = #{ddUserId,jdbcType=BIGINT},
- </if>
- <if test="psrId != null">
- psr_id = #{psrId,jdbcType=BIGINT},
- </if>
- <if test="name != null">
- name = #{name,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- status = #{status,jdbcType=INTEGER},
- </if>
- <if test="clockStatus != null">
- clock_status = #{clockStatus,jdbcType=INTEGER},
- </if>
- <if test="content != null">
- content = #{content,jdbcType=VARCHAR},
- </if>
- <if test="recordTime != null">
- record_time = #{recordTime,jdbcType=TIMESTAMP},
- </if>
- <if test="startTime != null">
- start_time = #{startTime,jdbcType=TIMESTAMP},
- </if>
- <if test="endTime != null">
- end_time = #{endTime,jdbcType=TIMESTAMP},
- </if>
- <if test="sumDuration != null">
- sum_duration = #{sumDuration,jdbcType=DOUBLE},
- </if>
- <if test="checkDuration != null">
- check_duration = #{checkDuration,jdbcType=DOUBLE},
- </if>
- <if test="createId != null">
- create_id = #{createId,jdbcType=BIGINT},
- </if>
- </set>
- where id = #{id,jdbcType=BIGINT}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.ruoyi.system.domain.UserRecord">
- update user_record
- set
- dd_user_id = #{ddUserId,jdbcType=BIGINT},
- psr_id = #{psrId,jdbcType=BIGINT},
- name = #{name,jdbcType=VARCHAR},
- status = #{status,jdbcType=INTEGER},
- clock_status = #{clockStatus,jdbcType=INTEGER},
- content = #{content,jdbcType=VARCHAR},
- record_time = #{recordTime,jdbcType=TIMESTAMP},
- start_time = #{startTime,jdbcType=TIMESTAMP},
- end_time = #{endTime,jdbcType=TIMESTAMP},
- sum_duration = #{sumDuration,jdbcType=DOUBLE},
- check_duration = #{checkDuration,jdbcType=DOUBLE},
- create_id = #{createId,jdbcType=BIGINT}
- where id = #{id,jdbcType=BIGINT}
- </update>
- <resultMap id="OutMap" type="com.ruoyi.system.domain.UserRecordOut">
- <id property="id" column="id" jdbcType="BIGINT"/>
- <result property="ddUserId" column="dd_user_id" jdbcType="BIGINT"/>
- <result property="psrId" column="psr_id" jdbcType="BIGINT"/>
- <result property="name" column="name" jdbcType="VARCHAR"/>
- <result property="status" column="status" jdbcType="INTEGER"/>
- <result property="clockStatus" column="clock_status" jdbcType="INTEGER"/>
- <result property="content" column="content" jdbcType="VARCHAR"/>
- <result property="recordTime" column="record_time" jdbcType="TIMESTAMP"/>
- <result property="startTime" column="start_time" jdbcType="TIMESTAMP"/>
- <result property="endTime" column="end_time" jdbcType="TIMESTAMP"/>
- <result property="sumDuration" column="sum_duration" jdbcType="DOUBLE"/>
- <result property="checkDuration" column="check_duration" jdbcType="DOUBLE"/>
- <result property="duration" column="duration" jdbcType="DOUBLE"/>
- <result property="createId" column="create_id" jdbcType="BIGINT"/>
- </resultMap>
- <select id="selectUserClock" resultMap="OutMap">
- select
- a.id,a.dd_user_id, a.psr_id, a.name, a.status,a.clock_status, a.content, a.record_time, a.start_time, a.end_time,
- a.sum_duration, a.check_duration, a.create_id,
- b.duration
- from user_record a left join project_staff_record b on a.psr_id=b.id
- where a.create_id= #{userId,jdbcType=BIGINT}
- <if test="status != null">
- and a.status = #{status,jdbcType=INTEGER}
- </if>
- </select>
- </mapper>
|