|
|
@@ -0,0 +1,93 @@
|
|
|
+<?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.FsSignArticleReadDetailMapper">
|
|
|
+
|
|
|
+ <resultMap type="FsSignArticleReadDetail" id="FsSignArticleReadDetailResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="fsUserId" column="fs_user_id" />
|
|
|
+ <result property="shareCompanyUserId" column="share_company_user_id"/>
|
|
|
+ <result property="articleId" column="article_id" />
|
|
|
+ <result property="readStartTime" column="read_start_time" />
|
|
|
+ <result property="readEndTime" column="read_end_time" />
|
|
|
+ <result property="readDuration" column="read_duration" />
|
|
|
+ <result property="source" column="source" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectFsSignArticleReadDetailVo">
|
|
|
+ select id, fs_user_id, share_company_user_id, article_id,
|
|
|
+ read_start_time, read_end_time, read_duration, source, create_time
|
|
|
+ from fs_sign_article_read_detail
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectFsSignArticleReadDetailList" parameterType="FsSignArticleReadDetail" resultMap="FsSignArticleReadDetailResult">
|
|
|
+ <include refid="selectFsSignArticleReadDetailVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="fsUserId != null"> and fs_user_id = #{fsUserId}</if>
|
|
|
+ <if test="shareCompanyUserId != null"> and share_company_user_id = #{shareCompanyUserId}</if>
|
|
|
+ <if test="articleId != null"> and article_id = #{articleId}</if>
|
|
|
+ <if test="readStartTime != null"> and read_start_time >= #{readStartTime}</if>
|
|
|
+ <if test="readEndTime != null"> and read_end_time <= #{readEndTime}</if>
|
|
|
+ <if test="source != null and source != ''"> and source = #{source}</if>
|
|
|
+ </where>
|
|
|
+ order by create_time desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectFsSignArticleReadDetailById" parameterType="Long" resultMap="FsSignArticleReadDetailResult">
|
|
|
+ <include refid="selectFsSignArticleReadDetailVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertFsSignArticleReadDetail" parameterType="FsSignArticleReadDetail" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into fs_sign_article_read_detail
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="fsUserId != null">fs_user_id,</if>
|
|
|
+ <if test="shareCompanyUserId != null">share_company_user_id,</if>
|
|
|
+ <if test="articleId != null">article_id,</if>
|
|
|
+ <if test="readStartTime != null">read_start_time,</if>
|
|
|
+ <if test="readEndTime != null">read_end_time,</if>
|
|
|
+ <if test="readDuration != null">read_duration,</if>
|
|
|
+ <if test="source != null">source,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="fsUserId != null">#{fsUserId},</if>
|
|
|
+ <if test="shareCompanyUserId != null">#{shareCompanyUserId},</if>
|
|
|
+ <if test="articleId != null">#{articleId},</if>
|
|
|
+ <if test="readStartTime != null">#{readStartTime},</if>
|
|
|
+ <if test="readEndTime != null">#{readEndTime},</if>
|
|
|
+ <if test="readDuration != null">#{readDuration},</if>
|
|
|
+ <if test="source != null">#{source},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateFsSignArticleReadDetail" parameterType="FsSignArticleReadDetail">
|
|
|
+ update fs_sign_article_read_detail
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="fsUserId != null">fs_user_id = #{fsUserId},</if>
|
|
|
+ <if test="shareCompanyUserId != null">share_company_user_id = #{shareCompanyUserId},</if>
|
|
|
+ <if test="articleId != null">article_id = #{articleId},</if>
|
|
|
+ <if test="readStartTime != null">read_start_time = #{readStartTime},</if>
|
|
|
+ <if test="readEndTime != null">read_end_time = #{readEndTime},</if>
|
|
|
+ <if test="readDuration != null">read_duration = #{readDuration},</if>
|
|
|
+ <if test="source != null">source = #{source},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteFsSignArticleReadDetailById" parameterType="Long">
|
|
|
+ delete from fs_sign_article_read_detail where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteFsSignArticleReadDetailByIds" parameterType="String">
|
|
|
+ delete from fs_sign_article_read_detail where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|