BBusiDezhiVideoPackageChapterMapper.xml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.dezhi.mapper.BBusiDezhiVideoPackageChapterMapper">
  6. <resultMap type="BBusiDezhiVideoPackageChapter" id="BBusiDezhiVideoPackageChapterResult">
  7. <result property="id" column="id" />
  8. <result property="packId" column="pack_id" />
  9. <result property="chapterId" column="chapter_id" />
  10. <result property="chapterName" column="chapter_name" />
  11. <result property="from" column="from" />
  12. </resultMap>
  13. <sql id="selectBBusiDezhiVideoPackageChapterVo">
  14. select id, pack_id, chapter_id, chapter_name, `from` from b_busi_dezhi_video_package_chapter
  15. </sql>
  16. <select id="selectBBusiDezhiVideoPackageChapterList" parameterType="BBusiDezhiVideoPackageChapter" resultMap="BBusiDezhiVideoPackageChapterResult">
  17. <include refid="selectBBusiDezhiVideoPackageChapterVo" />
  18. <where>
  19. <if test="packId != null and packId != ''"> and pack_id = #{packId}</if>
  20. <if test="chapterId != null and chapterId != ''"> and chapter_id = #{chapterId}</if>
  21. <if test="chapterName != null and chapterName != ''"> and chapter_name like concat('%', #{chapterName}, '%')</if>
  22. <if test="from != null and from != ''"> and `from` = #{from}</if>
  23. </where>
  24. </select>
  25. <select id="selectBBusiDezhiVideoPackageChapterById" parameterType="Long" resultMap="BBusiDezhiVideoPackageChapterResult">
  26. <include refid="selectBBusiDezhiVideoPackageChapterVo" />
  27. where id = #{id}
  28. </select>
  29. <select id="selectBBusiDezhiVideoPackageChapterByChapterId" parameterType="String" resultMap="BBusiDezhiVideoPackageChapterResult">
  30. <include refid="selectBBusiDezhiVideoPackageChapterVo" />
  31. where chapter_id = #{chapterId}
  32. </select>
  33. <select id="selectBBusiDezhiVideoPackageChapterByPackId" parameterType="String" resultMap="BBusiDezhiVideoPackageChapterResult">
  34. <include refid="selectBBusiDezhiVideoPackageChapterVo" />
  35. where pack_id = #{packId}
  36. </select>
  37. <insert id="insertBBusiDezhiVideoPackageChapter" parameterType="BBusiDezhiVideoPackageChapter" useGeneratedKeys="true" keyProperty="id">
  38. insert into b_busi_dezhi_video_package_chapter
  39. <trim prefix="(" suffix=")" suffixOverrides=",">
  40. <if test="packId != null and packId != ''">pack_id,</if>
  41. <if test="chapterId != null">chapter_id,</if>
  42. <if test="chapterName != null">chapter_name,</if>
  43. <if test="from != null">`from`,</if>
  44. </trim>
  45. <trim prefix="values (" suffix=")" suffixOverrides=",">
  46. <if test="packId != null and packId != ''">#{packId},</if>
  47. <if test="chapterId != null">#{chapterId},</if>
  48. <if test="chapterName != null">#{chapterName},</if>
  49. <if test="from != null">#{from},</if>
  50. </trim>
  51. </insert>
  52. <update id="updateBBusiDezhiVideoPackageChapter" parameterType="BBusiDezhiVideoPackageChapter">
  53. update b_busi_dezhi_video_package_chapter
  54. <trim prefix="SET" suffixOverrides=",">
  55. <if test="packId != null and packId != ''">pack_id = #{packId},</if>
  56. <if test="chapterId != null">chapter_id = #{chapterId},</if>
  57. <if test="chapterName != null">chapter_name = #{chapterName},</if>
  58. <if test="from != null">`from` = #{from},</if>
  59. </trim>
  60. where id = #{id}
  61. </update>
  62. <delete id="deleteBBusiDezhiVideoPackageChapterById" parameterType="Long">
  63. delete from b_busi_dezhi_video_package_chapter where id = #{id}
  64. </delete>
  65. <delete id="deleteBBusiDezhiVideoPackageChapterByIds" parameterType="String">
  66. delete from b_busi_dezhi_video_package_chapter where id in
  67. <foreach item="id" collection="array" open="(" separator="," close=")">
  68. #{id}
  69. </foreach>
  70. </delete>
  71. </mapper>