123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- <?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.fs.statis.mapper.FsStatisTempParamMapper">
- <!-- Enable auto-mapping from snake_case DB columns to camelCase DTO fields -->
- <!-- This is often configured globally in mybatis-config.xml or Spring Boot properties -->
- <!-- <settings>
- <setting name="mapUnderscoreToCamelCase" value="true"/>
- </settings> -->
- <resultMap id="BaseResultMap" type="com.fs.statis.domain.FsStatisTempParam">
- <id column="id" property="id" jdbcType="INTEGER"/>
- <result column="company_user_id" property="companyUserId" jdbcType="BIGINT"/>
- <result column="sop_id" property="sopId" jdbcType="BIGINT"/>
- <result column="this_date" property="thisDate" jdbcType="VARCHAR"/>
- <result column="qw_user_id" property="qwUserId" jdbcType="BIGINT"/>
- <result column="period_id" property="periodId" jdbcType="VARCHAR"/>
- <result column="start_time" property="startTime" jdbcType="VARCHAR"/>
- <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/> <!-- or DATETIME -->
- </resultMap>
- <sql id="Base_Column_List">
- id, company_user_id, sop_id, this_date, qw_user_id, period_id, start_time, create_time
- </sql>
- <select id="selectById" resultMap="BaseResultMap">
- SELECT <include refid="Base_Column_List" />
- FROM fs_statis_temp_param
- WHERE id = #{id,jdbcType=INTEGER}
- </select>
- <select id="selectAll" resultMap="BaseResultMap">
- SELECT <include refid="Base_Column_List" />
- FROM fs_statis_temp_param
- </select>
- <delete id="deleteById">
- DELETE FROM fs_statis_temp_param
- WHERE id = #{id,jdbcType=INTEGER}
- </delete>
- <insert id="insert" parameterType="com.fs.statis.domain.FsStatisTempParam" useGeneratedKeys="true" keyProperty="id">
- INSERT INTO fs_statis_temp_param (company_user_id, sop_id, this_date,
- qw_user_id, period_id, start_time, create_time)
- VALUES (#{companyUserId,jdbcType=BIGINT}, #{sopId,jdbcType=BIGINT}, #{thisDate,jdbcType=VARCHAR},
- #{qwUserId,jdbcType=BIGINT}, #{periodId,jdbcType=VARCHAR}, #{startTime,jdbcType=VARCHAR},
- #{createTime,jdbcType=TIMESTAMP})
- </insert>
- <insert id="insertSelective" parameterType="com.fs.statis.domain.FsStatisTempParam" useGeneratedKeys="true" keyProperty="id">
- INSERT INTO fs_statis_temp_param
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="companyUserId != null">company_user_id,</if>
- <if test="sopId != null">sop_id,</if>
- <if test="thisDate != null">this_date,</if>
- <if test="qwUserId != null">qw_user_id,</if>
- <if test="periodId != null">period_id,</if>
- <if test="startTime != null">start_time,</if>
- <if test="createTime != null">create_time,</if>
- </trim>
- <trim prefix="VALUES (" suffix=")" suffixOverrides=",">
- <if test="companyUserId != null">#{companyUserId,jdbcType=BIGINT},</if>
- <if test="sopId != null">#{sopId,jdbcType=BIGINT},</if>
- <if test="thisDate != null">#{thisDate,jdbcType=VARCHAR},</if>
- <if test="qwUserId != null">#{qwUserId,jdbcType=BIGINT},</if>
- <if test="periodId != null">#{periodId,jdbcType=VARCHAR},</if>
- <if test="startTime != null">#{startTime,jdbcType=VARCHAR},</if>
- <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
- </trim>
- </insert>
- <insert id="batchSave">
- REPLACE INTO fs_statis_temp_param (
- company_user_id, sop_id, this_date, qw_user_id,
- period_id, start_time, create_time,dept_id
- )
- VALUES
- <foreach collection="list" item="item" separator=",">
- (
- #{item.companyUserId}, #{item.sopId}, #{item.thisDate}, #{item.qwUserId},
- #{item.periodId}, #{item.startTime}, #{item.createTime},#{item.deptId}
- )
- </foreach>
- </insert>
- <insert id="batchSaveToSop">
- REPLACE INTO fs_statis_temp_param (
- company_user_id, sop_id, this_date, qw_user_id,
- period_id, start_time, create_time,dept_id
- )
- VALUES
- <foreach collection="list" item="item" separator=",">
- (
- #{item.companyUserId}, #{item.sopId}, #{item.thisDate}, #{item.qwUserId},
- #{item.periodId}, #{item.startTime}, #{item.createTime},#{item.deptId}
- )
- </foreach>
- </insert>
- <update id="updateById" parameterType="com.fs.statis.domain.FsStatisTempParam">
- UPDATE fs_statis_temp_param
- SET
- company_user_id = #{companyUserId,jdbcType=BIGINT},
- sop_id = #{sopId,jdbcType=BIGINT},
- this_date = #{thisDate,jdbcType=VARCHAR},
- qw_user_id = #{qwUserId,jdbcType=BIGINT},
- period_id = #{periodId,jdbcType=VARCHAR},
- start_time = #{startTime,jdbcType=VARCHAR},
- create_time = #{createTime,jdbcType=TIMESTAMP}
- WHERE id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByIdSelective" parameterType="com.fs.statis.domain.FsStatisTempParam">
- UPDATE fs_statis_temp_param
- <set>
- <if test="companyUserId != null">company_user_id = #{companyUserId,jdbcType=BIGINT},</if>
- <if test="sopId != null">sop_id = #{sopId,jdbcType=BIGINT},</if>
- <if test="thisDate != null">this_date = #{thisDate,jdbcType=VARCHAR},</if>
- <if test="qwUserId != null">qw_user_id = #{qwUserId,jdbcType=BIGINT},</if>
- <if test="periodId != null">period_id = #{periodId,jdbcType=VARCHAR},</if>
- <if test="startTime != null">start_time = #{startTime,jdbcType=VARCHAR},</if>
- <if test="createTime != null">create_time = #{createTime,jdbcType=TIMESTAMP},</if>
- </set>
- WHERE id = #{id,jdbcType=INTEGER}
- </update>
- </mapper>
|