123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- <?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.course.mapper.FsBlackTalentMapper">
-
- <resultMap type="FsBlackTalent" id="FsBlackTalentResult">
- <result property="id" column="id" />
- <result property="userId" column="user_id" />
- <result property="talentId" column="talent_id" />
- <result property="type" column="type" />
- <result property="reportDesc" column="report_desc" />
- <result property="isAudit" column="is_audit" />
- <result property="auditTime" column="audit_time" />
- <result property="auditUser" column="audit_user" />
- <result property="auditDesc" column="audit_desc" />
- <result property="creatTime" column="creat_time" />
- <result property="videoId" column="video_id" />
- <result property="style" column="style" />
- <result property="phone" column="phone" />
- <result property="urls" column="urls" />
- <result property="templateId" column="template_id" />
- <result property="tradeImage" column="trade_image" />
- </resultMap>
- <sql id="selectFsBlackTalentVo">
- select id, user_id, talent_id, type, report_desc, is_audit, audit_time, audit_user, audit_desc, creat_time, video_id, style,template_id,urls,phone,trade_image from fs_black_talent
- </sql>
- <select id="selectFsBlackTalentList" parameterType="FsBlackTalent" resultMap="FsBlackTalentResult">
- <include refid="selectFsBlackTalentVo"/>
- <where>
- <if test="userId != null "> and user_id = #{userId}</if>
- <if test="talentId != null "> and talent_id = #{talentId}</if>
- <if test="type != null and type != ''"> and type = #{type}</if>
- <if test="reportDesc != null and reportDesc != ''"> and report_desc = #{reportDesc}</if>
- <if test="isAudit != null and isAudit != ''"> and is_audit = #{isAudit}</if>
- <if test="auditTime != null "> and audit_time = #{auditTime}</if>
- <if test="auditUser != null "> and audit_user = #{auditUser}</if>
- <if test="auditDesc != null and auditDesc != ''"> and audit_desc = #{auditDesc}</if>
- <if test="creatTime != null "> and creat_time = #{creatTime}</if>
- <if test="videoId != null "> and video_id = #{videoId}</if>
- <if test="style != null and style != ''"> and style = #{style}</if>
- <if test="phone != null and phone != ''"> and phone = #{phone}</if>
- <if test="urls != null and urls != ''"> and urls = #{urls}</if>
- <if test="templateId != null and templateId != ''"> and template_id = #{templateId}</if>
- <if test="tradeImage != null and tradeImage != ''"> and trade_image = #{tradeImage}</if>
- </where>
- </select>
- <select id="selectFsBlackTalentPVOList" parameterType="FsBlackTalent" resultType="com.fs.course.vo.FsBlackTalentPVO">
- select fbt.*,u.nick_name as audit_user_name,t.nick_name as talent_name from fs_black_talent fbt
- left join sys_user u on u.user_id = fbt.audit_user
- left join fs_user_talent t on t.talent_id = fbt.talent_id
- <where>
- <if test="userId != null "> and fbt.user_id = #{userId}</if>
- <if test="talentId != null "> and fbt.talent_id = #{talentId}</if>
- <if test="type != null and type != ''"> and fbt.type = #{type}</if>
- <if test="reportDesc != null and reportDesc != ''"> and fbt.eport_desc = #{reportDesc}</if>
- <if test="isAudit != null and isAudit != ''"> and fbt.is_audit = #{isAudit}</if>
- <if test="auditTime != null "> and fbt.audit_time = #{auditTime}</if>
- <if test="auditUser != null "> and fbt.audit_user = #{auditUser}</if>
- <if test="auditDesc != null and auditDesc != ''"> and fbt.audit_desc = #{auditDesc}</if>
- <if test="creatTime != null "> and fbt.creat_time = #{creatTime}</if>
- <if test="videoId != null "> and fbt.video_id = #{videoId}</if>
- <if test="style != null and style != ''"> and fbt.style = #{style}</if>
- <if test="phone != null and phone != ''"> and fbt.phone = #{phone}</if>
- <if test="urls != null and urls != ''"> and fbt.urls = #{urls}</if>
- <if test="templateId != null and templateId != ''"> and fbt.template_id = #{templateId}</if>
- <if test="tradeImage != null and tradeImage != ''"> and fbt.trade_image = #{tradeImage}</if>
- </where>
- </select>
-
- <select id="selectFsBlackTalentById" parameterType="Long" resultMap="FsBlackTalentResult">
- <include refid="selectFsBlackTalentVo"/>
- where id = #{id}
- </select>
- <select id="selectBlackAndReportVideoIdsByUserId" resultMap="FsBlackTalentResult">
- select video_id , talent_id from fs_black_talent where user_id = #{userId}
- </select>
- <select id="selectBlackTalent" resultType="java.lang.Integer">
- select count(id) from fs_black_talent where user_id = #{loginUserId} and talent_id = #{talentId} and type = 1
- </select>
- <insert id="insertFsBlackTalent" parameterType="FsBlackTalent" useGeneratedKeys="true" keyProperty="id">
- insert into fs_black_talent
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="userId != null">user_id,</if>
- <if test="talentId != null">talent_id,</if>
- <if test="type != null">type,</if>
- <if test="reportDesc != null">report_desc,</if>
- <if test="isAudit != null">is_audit,</if>
- <if test="auditTime != null">audit_time,</if>
- <if test="auditUser != null">audit_user,</if>
- <if test="auditDesc != null">audit_desc,</if>
- <if test="creatTime != null">creat_time,</if>
- <if test="videoId != null">video_id,</if>
- <if test="style != null">style,</if>
- <if test="phone != null">phone,</if>
- <if test="urls != null">urls,</if>
- <if test="templateId != null">template_id,</if>
- <if test="tradeImage != null">trade_image,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="userId != null">#{userId},</if>
- <if test="talentId != null">#{talentId},</if>
- <if test="type != null">#{type},</if>
- <if test="reportDesc != null">#{reportDesc},</if>
- <if test="isAudit != null">#{isAudit},</if>
- <if test="auditTime != null">#{auditTime},</if>
- <if test="auditUser != null">#{auditUser},</if>
- <if test="auditDesc != null">#{auditDesc},</if>
- <if test="creatTime != null">#{creatTime},</if>
- <if test="videoId != null">#{videoId},</if>
- <if test="style != null">#{style},</if>
- <if test="phone != null">#{phone},</if>
- <if test="urls != null">#{urls},</if>
- <if test="templateId != null">#{templateId},</if>
- <if test="tradeImage != null">#{tradeImage},</if>
- </trim>
- </insert>
- <update id="updateFsBlackTalent" parameterType="FsBlackTalent">
- update fs_black_talent
- <trim prefix="SET" suffixOverrides=",">
- <if test="userId != null">user_id = #{userId},</if>
- <if test="talentId != null">talent_id = #{talentId},</if>
- <if test="type != null">type = #{type},</if>
- <if test="reportDesc != null">report_desc = #{reportDesc},</if>
- <if test="isAudit != null">is_audit = #{isAudit},</if>
- <if test="auditTime != null">audit_time = #{auditTime},</if>
- <if test="auditUser != null">audit_user = #{auditUser},</if>
- <if test="auditDesc != null">audit_desc = #{auditDesc},</if>
- <if test="creatTime != null">creat_time = #{creatTime},</if>
- <if test="videoId != null">video_id = #{videoId},</if>
- <if test="style != null">style = #{style},</if>
- <if test="phone != null">phone = #{phone},</if>
- <if test="urls != null">urls = #{urls},</if>
- <if test="templateId != null">template_id = #{templateId},</if>
- <if test="tradeImage != null">trade_image = #{tradeImage},</if>
- </trim>
- where id = #{id}
- </update>
- <update id="audit">
- update fs_black_talent
- <trim prefix="SET" suffixOverrides=",">
- <if test="map.isAudit != null">is_audit = #{map.isAudit},</if>
- <if test="map.auditTime != null">audit_time = #{map.auditTime},</if>
- <if test="map.auditUser != null">audit_user = #{map.auditUser},</if>
- <if test="map.auditDesc != null">audit_desc = #{map.auditDesc},</if>
- </trim>
- where id = #{map.id}
- </update>
- <delete id="deleteFsBlackTalentById" parameterType="Long">
- delete from fs_black_talent where id = #{id}
- </delete>
- <delete id="deleteFsBlackTalentByIds" parameterType="String">
- delete from fs_black_talent where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <delete id="deleteFsBlackVideo">
- delete from fs_black_talent where user_id = #{userId} and video_id = #{videoId} and type = '1'
- </delete>
- <delete id="deleteFsBlackTalent">
- delete from fs_black_talent where user_id = #{userId} and talent_id = #{talentId} and type = '1'
- </delete>
- </mapper>
|