|
|
@@ -0,0 +1,100 @@
|
|
|
+<?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.FsShareMaterialClickRecordMapper">
|
|
|
+
|
|
|
+ <resultMap type="FsShareMaterialClickRecord" id="FsShareMaterialClickRecordResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="userId" column="user_id" />
|
|
|
+ <result property="companyUserId" column="company_user_id" />
|
|
|
+ <result property="unionId" column="union_id" />
|
|
|
+ <result property="materialId" column="material_id" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="avatar" column="avatar" />
|
|
|
+ <result property="userName" column="user_name" />
|
|
|
+ <result property="companyUserName" column="company_user_name" />
|
|
|
+ <result property="companyId" column="company_id" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectFsShareMaterialClickRecordVo">
|
|
|
+ select id, user_id, company_user_id, union_id, material_id, create_time, update_time, avatar, user_name, company_user_name, company_id from fs_share_material_click_record
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectFsShareMaterialClickRecordList" parameterType="FsShareMaterialClickRecord" resultMap="FsShareMaterialClickRecordResult">
|
|
|
+ <include refid="selectFsShareMaterialClickRecordVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="userId != null "> and user_id = #{userId}</if>
|
|
|
+ <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
|
|
|
+ <if test="unionId != null and unionId != ''"> and union_id = #{unionId}</if>
|
|
|
+ <if test="materialId != null "> and material_id = #{materialId}</if>
|
|
|
+ <if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
|
|
+ <if test="avatar != null and avatar != ''"> and avatar = #{avatar}</if>
|
|
|
+ <if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
|
|
+ <if test="companyUserName != null and companyUserName != ''"> and company_user_name like concat('%', #{companyUserName}, '%')</if>
|
|
|
+ <if test="companyId != null "> and company_id = #{companyId}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectFsShareMaterialClickRecordById" parameterType="Long" resultMap="FsShareMaterialClickRecordResult">
|
|
|
+ <include refid="selectFsShareMaterialClickRecordVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertFsShareMaterialClickRecord" parameterType="FsShareMaterialClickRecord" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into fs_share_material_click_record
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="userId != null">user_id,</if>
|
|
|
+ <if test="companyUserId != null">company_user_id,</if>
|
|
|
+ <if test="unionId != null">union_id,</if>
|
|
|
+ <if test="materialId != null">material_id,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="avatar != null">avatar,</if>
|
|
|
+ <if test="userName != null">user_name,</if>
|
|
|
+ <if test="companyUserName != null">company_user_name,</if>
|
|
|
+ <if test="companyId != null">company_id,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="userId != null">#{userId},</if>
|
|
|
+ <if test="companyUserId != null">#{companyUserId},</if>
|
|
|
+ <if test="unionId != null">#{unionId},</if>
|
|
|
+ <if test="materialId != null">#{materialId},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="avatar != null">#{avatar},</if>
|
|
|
+ <if test="userName != null">#{userName},</if>
|
|
|
+ <if test="companyUserName != null">#{companyUserName},</if>
|
|
|
+ <if test="companyId != null">#{companyId},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateFsShareMaterialClickRecord" parameterType="FsShareMaterialClickRecord">
|
|
|
+ update fs_share_material_click_record
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="userId != null">user_id = #{userId},</if>
|
|
|
+ <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
|
|
|
+ <if test="unionId != null">union_id = #{unionId},</if>
|
|
|
+ <if test="materialId != null">material_id = #{materialId},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="avatar != null">avatar = #{avatar},</if>
|
|
|
+ <if test="userName != null">user_name = #{userName},</if>
|
|
|
+ <if test="companyUserName != null">company_user_name = #{companyUserName},</if>
|
|
|
+ <if test="companyId != null">company_id = #{companyId},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteFsShareMaterialClickRecordById" parameterType="Long">
|
|
|
+ delete from fs_share_material_click_record where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteFsShareMaterialClickRecordByIds" parameterType="String">
|
|
|
+ delete from fs_share_material_click_record where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|