123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- <?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.ruoyi.dezhi.mapper.BBusiDezhiVideoMapper">
- <resultMap type="BBusiDezhiVideo" id="BBusiDezhiVideoResult">
- <result property="id" column="id" />
- <result property="packId" column="pack_id" />
- <result property="sectionId" column="section_id" />
- <result property="chapterId" column="chapter_id" />
- <result property="plays" column="plays" />
- <result property="played" column="played" />
- <result property="clicked" column="clicked" />
- <result property="sectionName" column="section_name" />
- <result property="sectionIntro" column="section_intro" />
- <result property="sectionTime" column="section_time" />
- <result property="sectionSort" column="section_sort" />
- <result property="sectionTearcher" column="section_tearcher" />
- <result property="sectionImaurl" column="section_imaurl" />
- <result property="sectionUrl" column="section_url" />
- <result property="sectionAliid" column="section_aliId" />
- <result property="from" column="from" />
- </resultMap>
- <sql id="selectBBusiDezhiVideoVo">
- select id, pack_id, section_id, chapter_id, plays, played, clicked, section_name, section_intro, section_time, section_sort, section_tearcher,
- section_imaurl, section_url,
- section_aliId, `from` from b_busi_dezhi_video
- </sql>
- <select id="selectBBusiDezhiVideoList" parameterType="BBusiDezhiVideo" resultMap="BBusiDezhiVideoResult">
- <include refid="selectBBusiDezhiVideoVo" />
- where 1=1
- <if test="packId != null and packId != ''"> and pack_id = #{packId}</if>
- <if test="sectionId != null and sectionId != ''"> and section_id = #{sectionId}</if>
- <if test="chapterId != null and chapterId != ''"> and chapter_id = #{chapterId}</if>
- <if test="plays != null "> and plays = #{plays}</if>
- <if test="played != null "> and played = #{played}</if>
- <if test="clicked != null "> and clicked = #{clicked}</if>
- <if test="sectionName != null and sectionName != ''"> and section_name like concat('%', #{sectionName}, '%')</if>
- <if test="sectionIntro != null and sectionIntro != ''"> and section_intro = #{sectionIntro}</if>
- <if test="sectionTime != null and sectionTime != ''"> and section_time = #{sectionTime}</if>
- <if test="sectionSort != null and sectionSort != ''"> and section_sort = #{sectionSort}</if>
- <if test="sectionTearcher != null and sectionTearcher != ''"> and section_tearcher = #{sectionTearcher}</if>
- <if test="sectionImaurl != null and sectionImaurl != ''"> and section_imaurl = #{sectionImaurl}</if>
- <if test="sectionUrl != null and sectionUrl != ''"> and section_url = #{sectionUrl}</if>
- <if test="sectionAliid != null and sectionAliid != ''"> and section_aliId = #{sectionAliid}</if>
- <if test="from != null and from != ''"> and `from` = #{from}</if>
- <if test="course != null">
- and pack_id in (
- SELECT DISTINCT pack_id FROM b_busi_dezhi_video_package WHERE course = #{course}
- )
- </if>
- </select>
- <select id="selectBBusiDezhiVideoById" parameterType="Long" resultMap="BBusiDezhiVideoResult">
- <include refid="selectBBusiDezhiVideoVo" />
- where id = #{id}
- </select>
- <select id="selectVideoList" parameterType="Map" resultType="com.alibaba.fastjson.JSONObject">
- select a.*,b.grade, b.pack_imgurl as img from b_busi_dezhi_video a
- left join b_busi_dezhi_video_package b on a.pack_id=b.pack_id
- LEFT JOIN b_busi_dezhi_video_package_chapter t2 ON a.chapter_id = t2.chapter_id
- <where>
- <if test="packId != null and packId != ''"> and a.pack_id = #{packId}</if>
- <if test="course != null and course != ''"> and b.course = #{course}</if>
- <if test="grade != null and grade != ''"> and b.grade = #{grade}</if>
- <if test="gradeLimit != null"> and b.grade <= #{gradeLimit}</if>
- <if test="version != null and version != ''"> and b.version = #{version}</if>
- <if test="sectionName != null and sectionName != ''"> and a.section_name like concat('%', #{sectionName}, '%')</if>
- </where>
- ORDER BY t2.id, CAST(a.section_sort AS UNSIGNED)
- </select>
- <select id="selectVideoList2" parameterType="Map" resultType="com.alibaba.fastjson.JSONObject">
- select a.*,b.pack_imgurl as img
- from b_busi_dezhi_video a
- join b_busi_dezhi_video_package b on a.pack_id=b.pack_id
- WHERE a.section_aliId IS NOT NULL and b.pack_imgurl IS NOT NULL and not (b.pack_imgurl) AND b.pack_imgurl != ''
- <if test="course != null and course != ''"> and b.course = #{course}</if>
- ORDER BY RAND()
- LIMIT 10
- </select>
- <select id="searchInfoByPackId" parameterType="String" resultType="com.alibaba.fastjson.JSONObject">
- select t2.chapter_name,t1.* from b_busi_dezhi_video t1
- inner join
- b_busi_dezhi_video_package_chapter t2 on t1.chapter_id = t2.chapter_id
- where t1.pack_id = #{packId}
- ORDER BY t2.id, CAST(t1.section_sort AS UNSIGNED)
- </select>
- <insert id="insertBBusiDezhiVideo" parameterType="BBusiDezhiVideo" useGeneratedKeys="true" keyProperty="id">
- insert into b_busi_dezhi_video
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="packId != null">pack_id,</if>
- <if test="sectionId != null and sectionId != ''">section_id,</if>
- <if test="chapterId != null">chapter_id,</if>
- <if test="plays != null">plays,</if>
- <if test="played != null">played,</if>
- <if test="clicked != null">clicked,</if>
- <if test="sectionName != null">section_name,</if>
- <if test="sectionIntro != null">section_intro,</if>
- <if test="sectionTime != null">section_time,</if>
- <if test="sectionSort != null">section_sort,</if>
- <if test="sectionTearcher != null">section_tearcher,</if>
- <if test="sectionImaurl != null">section_imaurl,</if>
- <if test="sectionUrl != null">section_url,</if>
- <if test="sectionAliid != null">section_aliId,</if>
- <if test="from != null">`from`,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="packId != null">#{packId},</if>
- <if test="sectionId != null and sectionId != ''">#{sectionId},</if>
- <if test="chapterId != null">#{chapterId},</if>
- <if test="plays != null">#{plays},</if>
- <if test="played != null">#{played},</if>
- <if test="clicked != null">#{clicked},</if>
- <if test="sectionName != null">#{sectionName},</if>
- <if test="sectionIntro != null">#{sectionIntro},</if>
- <if test="sectionTime != null">#{sectionTime},</if>
- <if test="sectionSort != null">#{sectionSort},</if>
- <if test="sectionTearcher != null">#{sectionTearcher},</if>
- <if test="sectionImaurl != null">#{sectionImaurl},</if>
- <if test="sectionUrl != null">#{sectionUrl},</if>
- <if test="sectionAliid != null">#{sectionAliid},</if>
- <if test="from != null">#{from},</if>
- </trim>
- </insert>
- <update id="updateBBusiDezhiVideo" parameterType="BBusiDezhiVideo">
- update b_busi_dezhi_video
- <trim prefix="SET" suffixOverrides=",">
- <if test="packId != null">pack_id = #{packId},</if>
- <if test="sectionId != null and sectionId != ''">section_id = #{sectionId},</if>
- <if test="chapterId != null">chapter_id = #{chapterId},</if>
- <if test="plays != null">plays = #{plays},</if>
- <if test="played != null">played = #{played},</if>
- <if test="clicked != null">clicked = #{clicked},</if>
- <if test="sectionName != null">section_name = #{sectionName},</if>
- <if test="sectionIntro != null">section_intro = #{sectionIntro},</if>
- <if test="sectionTime != null">section_time = #{sectionTime},</if>
- <if test="sectionSort != null">section_sort = #{sectionSort},</if>
- <if test="sectionTearcher != null">section_tearcher = #{sectionTearcher},</if>
- <if test="sectionImaurl != null">section_imaurl = #{sectionImaurl},</if>
- <if test="sectionUrl != null">section_url = #{sectionUrl},</if>
- <if test="sectionAliid != null">section_aliId = #{sectionAliid},</if>
- <if test="from != null">`from` = #{from},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteBBusiDezhiVideoById" parameterType="Long">
- delete from b_busi_dezhi_video where id = #{id}
- </delete>
- <delete id="deleteBBusiDezhiVideoByIds" parameterType="String">
- delete from b_busi_dezhi_video where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|