BBusiDezhiVideoPackageMapper.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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.BBusiDezhiVideoPackageMapper">
  6. <resultMap type="BBusiDezhiVideoPackage" id="BBusiDezhiVideoPackageResult">
  7. <result property="id" column="id" />
  8. <result property="type" column="type" />
  9. <result property="ctype" column="ctype" />
  10. <result property="course" column="course" />
  11. <result property="grade" column="grade" />
  12. <result property="version" column="version" />
  13. <result property="packId" column="pack_id" />
  14. <result property="packName" column="pack_name" />
  15. <result property="packImgurl" column="pack_imgurl" />
  16. <result property="packIntro" column="pack_intro" />
  17. <result property="sectionNum" column="section_num" />
  18. <result property="from" column="from" />
  19. <result property="priority" column="priority" />
  20. </resultMap>
  21. <sql id="selectBBusiDezhiVideoPackageVo">
  22. select id, type, ctype, course, grade, version, pack_id, pack_name, pack_imgurl, pack_intro, section_num, `from`, priority from b_busi_dezhi_video_package
  23. </sql>
  24. <select id="selectBBusiDezhiVideoPackageList" parameterType="BBusiDezhiVideoPackage" resultMap="BBusiDezhiVideoPackageResult">
  25. <include refid="selectBBusiDezhiVideoPackageVo" />
  26. <where>
  27. <if test="type != null "> and type = #{type}</if>
  28. <if test="ctype != null and ctype != ''"> and ctype = #{ctype}</if>
  29. <if test="course != null and course != ''"> and course = #{course}</if>
  30. <if test="grade != null and grade != ''"> and grade = #{grade}</if>
  31. <if test="version != null and version != ''"> and version = #{version}</if>
  32. <if test="packId != null and packId != ''"> and pack_id = #{packId}</if>
  33. <if test="packName != null and packName != ''"> and pack_name like concat('%', #{packName}, '%')</if>
  34. <if test="packImgurl != null and packImgurl != ''"> and pack_imgurl = #{packImgurl}</if>
  35. <if test="packIntro != null and packIntro != ''"> and pack_intro = #{packIntro}</if>
  36. <if test="sectionNum != null "> and section_num = #{sectionNum}</if>
  37. <if test="from != null and from != ''"> and `from` = #{from}</if>
  38. <if test="priority != null "> and priority = #{priority}</if>
  39. </where>
  40. order by priority
  41. </select>
  42. <select id="selectBBusiDezhiVideoPackageById" parameterType="Long" resultMap="BBusiDezhiVideoPackageResult">
  43. <include refid="selectBBusiDezhiVideoPackageVo" />
  44. where id = #{id}
  45. </select>
  46. <select id="selectBBusiDezhiVideoPackageByPackId" parameterType="String" resultMap="BBusiDezhiVideoPackageResult">
  47. <include refid="selectBBusiDezhiVideoPackageVo" />
  48. where pack_id = #{packId}
  49. </select>
  50. <insert id="insertBBusiDezhiVideoPackage" parameterType="BBusiDezhiVideoPackage" useGeneratedKeys="true" keyProperty="id">
  51. insert into b_busi_dezhi_video_package
  52. <trim prefix="(" suffix=")" suffixOverrides=",">
  53. <if test="type != null">type,</if>
  54. <if test="ctype != null">ctype,</if>
  55. <if test="course != null">course,</if>
  56. <if test="grade != null">grade,</if>
  57. <if test="version != null">version,</if>
  58. <if test="packId != null and packId != ''">pack_id,</if>
  59. <if test="packName != null">pack_name,</if>
  60. <if test="packImgurl != null">pack_imgurl,</if>
  61. <if test="packIntro != null">pack_intro,</if>
  62. <if test="sectionNum != null">section_num,</if>
  63. <if test="from != null">`from`,</if>
  64. <if test="priority != null">priority,</if>
  65. </trim>
  66. <trim prefix="values (" suffix=")" suffixOverrides=",">
  67. <if test="type != null">#{type},</if>
  68. <if test="ctype != null">#{ctype},</if>
  69. <if test="course != null">#{course},</if>
  70. <if test="grade != null">#{grade},</if>
  71. <if test="version != null">#{version},</if>
  72. <if test="packId != null and packId != ''">#{packId},</if>
  73. <if test="packName != null">#{packName},</if>
  74. <if test="packImgurl != null">#{packImgurl},</if>
  75. <if test="packIntro != null">#{packIntro},</if>
  76. <if test="sectionNum != null">#{sectionNum},</if>
  77. <if test="from != null">#{from},</if>
  78. <if test="priority != null">#{priority},</if>
  79. </trim>
  80. </insert>
  81. <update id="updateBBusiDezhiVideoPackage" parameterType="BBusiDezhiVideoPackage">
  82. update b_busi_dezhi_video_package
  83. <trim prefix="SET" suffixOverrides=",">
  84. <if test="type != null">type = #{type},</if>
  85. <if test="ctype != null">ctype = #{ctype},</if>
  86. <if test="course != null">course = #{course},</if>
  87. <if test="grade != null">grade = #{grade},</if>
  88. <if test="version != null">version = #{version},</if>
  89. <if test="packId != null and packId != ''">pack_id = #{packId},</if>
  90. <if test="packName != null">pack_name = #{packName},</if>
  91. <if test="packImgurl != null">pack_imgurl = #{packImgurl},</if>
  92. <if test="packIntro != null">pack_intro = #{packIntro},</if>
  93. <if test="sectionNum != null">section_num = #{sectionNum},</if>
  94. <if test="from != null">`from` = #{from},</if>
  95. <if test="priority != null">priority = #{priority},</if>
  96. </trim>
  97. where id = #{id}
  98. </update>
  99. <delete id="deleteBBusiDezhiVideoPackageById" parameterType="Long">
  100. delete from b_busi_dezhi_video_package where id = #{id}
  101. </delete>
  102. <delete id="deleteBBusiDezhiVideoPackageByIds" parameterType="String">
  103. delete from b_busi_dezhi_video_package where id in
  104. <foreach item="id" collection="array" open="(" separator="," close=")">
  105. #{id}
  106. </foreach>
  107. </delete>
  108. </mapper>