<?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.syzy.mapper.BBusiWishXkcxCourseGroupMapper">

  <resultMap type="BBusiWishXkcxCourseGroup" id="BBusiWishXkcxCourseGroupResult">
    <result property="id" column="id" />
    <result property="course0" column="course0" />
    <result property="course1" column="course1" />
    <result property="course2" column="course2" />
    <result property="marjorRate" column="marjorRate" />
    <result property="status" column="status" />
  </resultMap>

  <sql id="selectBBusiWishXkcxCourseGroupVo">
    select id, course0, course1, course2, marjorRate, status from b_busi_wish_xkcx_course_group
  </sql>

  <select id="selectBBusiWishXkcxCourseGroupList" parameterType="BBusiWishXkcxCourseGroup" resultMap="BBusiWishXkcxCourseGroupResult">
    <include refid="selectBBusiWishXkcxCourseGroupVo" />
    <where>
      <if test="course0 != null  and course0 != ''"> and course0 = #{course0}</if>
      <if test="course1 != null  and course1 != ''"> and course1 = #{course1}</if>
      <if test="course2 != null  and course2 != ''"> and course2 = #{course2}</if>
      <if test="marjorRate != null "> and marjorRate = #{marjorRate}</if>
      <if test="status != null "> and status = #{status}</if>
    </where>
  </select>

  <select id="selectBBusiWishXkcxCourseGroupById" parameterType="Long" resultMap="BBusiWishXkcxCourseGroupResult">
    <include refid="selectBBusiWishXkcxCourseGroupVo" />
    where id = #{id}
  </select>

  <insert id="insertBBusiWishXkcxCourseGroup" parameterType="BBusiWishXkcxCourseGroup" useGeneratedKeys="true" keyProperty="id">
    insert into b_busi_wish_xkcx_course_group
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="course0 != null">course0,</if>
      <if test="course1 != null">course1,</if>
      <if test="course2 != null">course2,</if>
      <if test="marjorRate != null">marjorRate,</if>
      <if test="status != null">status,</if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="course0 != null">#{course0},</if>
      <if test="course1 != null">#{course1},</if>
      <if test="course2 != null">#{course2},</if>
      <if test="marjorRate != null">#{marjorRate},</if>
      <if test="status != null">#{status},</if>
    </trim>
  </insert>

  <update id="updateBBusiWishXkcxCourseGroup" parameterType="BBusiWishXkcxCourseGroup">
    update b_busi_wish_xkcx_course_group
    <trim prefix="SET" suffixOverrides=",">
      <if test="course0 != null">course0 = #{course0},</if>
      <if test="course1 != null">course1 = #{course1},</if>
      <if test="course2 != null">course2 = #{course2},</if>
      <if test="marjorRate != null">marjorRate = #{marjorRate},</if>
      <if test="status != null">status = #{status},</if>
    </trim>
    where id = #{id}
  </update>

  <delete id="deleteBBusiWishXkcxCourseGroupById" parameterType="Long">
    delete from b_busi_wish_xkcx_course_group where id = #{id}
  </delete>

  <delete id="deleteBBusiWishXkcxCourseGroupByIds" parameterType="String">
    delete from b_busi_wish_xkcx_course_group where id in
    <foreach item="id" collection="array" open="(" separator="," close=")">
      #{id}
    </foreach>
  </delete>
</mapper>