|
|
@@ -0,0 +1,84 @@
|
|
|
+<?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.his.mapper.FsProjectRedDetailMapper">
|
|
|
+
|
|
|
+ <resultMap type="FsProjectRedDetail" id="FsProjectRedDetailResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="userId" column="user_id" />
|
|
|
+ <result property="companyUserId" column="company_user_id" />
|
|
|
+ <result property="projectId" column="project_id" />
|
|
|
+ <result property="readDuration" column="read_duration" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="source" column="source" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectFsProjectRedDetailVo">
|
|
|
+ select id, user_id, company_user_id, project_id, read_duration, create_time, source, update_time from fs_project_red_detail
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectFsProjectRedDetailList" parameterType="FsProjectRedDetail" resultMap="FsProjectRedDetailResult">
|
|
|
+ <include refid="selectFsProjectRedDetailVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="userId != null "> and user_id = #{userId}</if>
|
|
|
+ <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
|
|
|
+ <if test="projectId != null "> and project_id = #{projectId}</if>
|
|
|
+ <if test="readDuration != null "> and read_duration = #{readDuration}</if>
|
|
|
+ <if test="source != null and source != ''"> and source = #{source}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectFsProjectRedDetailById" parameterType="Long" resultMap="FsProjectRedDetailResult">
|
|
|
+ <include refid="selectFsProjectRedDetailVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertFsProjectRedDetail" parameterType="FsProjectRedDetail" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into fs_project_red_detail
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="userId != null">user_id,</if>
|
|
|
+ <if test="companyUserId != null">company_user_id,</if>
|
|
|
+ <if test="projectId != null">project_id,</if>
|
|
|
+ <if test="readDuration != null">read_duration,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="source != null">source,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="userId != null">#{userId},</if>
|
|
|
+ <if test="companyUserId != null">#{companyUserId},</if>
|
|
|
+ <if test="projectId != null">#{projectId},</if>
|
|
|
+ <if test="readDuration != null">#{readDuration},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="source != null">#{source},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateFsProjectRedDetail" parameterType="FsProjectRedDetail">
|
|
|
+ update fs_project_red_detail
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="userId != null">user_id = #{userId},</if>
|
|
|
+ <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
|
|
|
+ <if test="projectId != null">project_id = #{projectId},</if>
|
|
|
+ <if test="readDuration != null">read_duration = #{readDuration},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="source != null">source = #{source},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteFsProjectRedDetailById" parameterType="Long">
|
|
|
+ delete from fs_project_red_detail where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteFsProjectRedDetailByIds" parameterType="String">
|
|
|
+ delete from fs_project_red_detail where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|