|
@@ -0,0 +1,73 @@
|
|
|
+<?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.store.mapper.FsUserCompanyUserMapper">
|
|
|
+
|
|
|
+ <resultMap type="FsUserCompanyUser" id="FsUserCompanyUserResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="userId" column="user_id" />
|
|
|
+ <result property="companyUserId" column="company_user_id" />
|
|
|
+ <result property="companyId" column="company_id" />
|
|
|
+ <result property="isRepeatFans" column="is_repeat_fans" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectFsUserCompanyUserVo">
|
|
|
+ select id, user_id, company_user_id, company_id, is_repeat_fans from fs_user_company_user
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectFsUserCompanyUserList" parameterType="FsUserCompanyUser" resultMap="FsUserCompanyUserResult">
|
|
|
+ <include refid="selectFsUserCompanyUserVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="userId != null "> and user_id = #{userId}</if>
|
|
|
+ <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
|
|
|
+ <if test="companyId != null "> and company_id = #{companyId}</if>
|
|
|
+ <if test="isRepeatFans != null "> and is_repeat_fans = #{isRepeatFans}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectFsUserCompanyUserById" parameterType="Long" resultMap="FsUserCompanyUserResult">
|
|
|
+ <include refid="selectFsUserCompanyUserVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertFsUserCompanyUser" parameterType="FsUserCompanyUser" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into fs_user_company_user
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">id,</if>
|
|
|
+ <if test="userId != null">user_id,</if>
|
|
|
+ <if test="companyUserId != null">company_user_id,</if>
|
|
|
+ <if test="companyId != null">company_id,</if>
|
|
|
+ <if test="isRepeatFans != null">is_repeat_fans,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">#{id},</if>
|
|
|
+ <if test="userId != null">#{userId},</if>
|
|
|
+ <if test="companyUserId != null">#{companyUserId},</if>
|
|
|
+ <if test="companyId != null">#{companyId},</if>
|
|
|
+ <if test="isRepeatFans != null">#{isRepeatFans},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateFsUserCompanyUser" parameterType="FsUserCompanyUser">
|
|
|
+ update fs_user_company_user
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="userId != null">user_id = #{userId},</if>
|
|
|
+ <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
|
|
|
+ <if test="companyId != null">company_id = #{companyId},</if>
|
|
|
+ <if test="isRepeatFans != null">is_repeat_fans = #{isRepeatFans},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteFsUserCompanyUserById" parameterType="Long">
|
|
|
+ delete from fs_user_company_user where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteFsUserCompanyUserByIds" parameterType="String">
|
|
|
+ delete from fs_user_company_user where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|