<?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.BCustomerXkcxCourseMapper">

  <resultMap type="BCustomerXkcxCourse" id="BCustomerXkcxCourseResult">
    <result property="id" column="id" />
    <result property="customerCode" column="customerCode" />
    <result property="groupId" column="groupId" />
    <result property="df" column="df" />
    <result property="createTime" column="createTime" />
    <result property="status" column="status" />
  </resultMap>

  <sql id="selectBCustomerXkcxCourseVo">
    select id, customerCode, groupId, df, createTime, status from b_customer_xkcx_course
  </sql>

  <select id="selectBCustomerXkcxCourseList" parameterType="BCustomerXkcxCourse" resultMap="BCustomerXkcxCourseResult">
    <include refid="selectBCustomerXkcxCourseVo" />
    <where>
      <if test="customerCode != null  and customerCode != ''"> and customerCode = #{customerCode}</if>
      <if test="groupId != null "> and groupId = #{groupId}</if>
      <if test="df != null "> and df = #{df}</if>
      <if test="createTime != null "> and createTime = #{createTime}</if>
      <if test="status != null "> and status = #{status}</if>
    </where>
  </select>

  <select id="selectBCustomerXkcxCourseById" parameterType="Long" resultMap="BCustomerXkcxCourseResult">
    <include refid="selectBCustomerXkcxCourseVo" />
    where id = #{id}
  </select>

  <insert id="insertBCustomerXkcxCourse" parameterType="BCustomerXkcxCourse" useGeneratedKeys="true" keyProperty="id">
    insert into b_customer_xkcx_course
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="customerCode != null">customerCode,</if>
      <if test="groupId != null">groupId,</if>
      <if test="df != null">df,</if>
      <if test="createTime != null">createTime,</if>
      <if test="status != null">status,</if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="customerCode != null">#{customerCode},</if>
      <if test="groupId != null">#{groupId},</if>
      <if test="df != null">#{df},</if>
      <if test="createTime != null">#{createTime},</if>
      <if test="status != null">#{status},</if>
    </trim>
  </insert>

  <update id="updateBCustomerXkcxCourse" parameterType="BCustomerXkcxCourse">
    update b_customer_xkcx_course
    <trim prefix="SET" suffixOverrides=",">
      <if test="customerCode != null">customerCode = #{customerCode},</if>
      <if test="groupId != null">groupId = #{groupId},</if>
      <if test="df != null">df = #{df},</if>
      <if test="createTime != null">createTime = #{createTime},</if>
      <if test="status != null">status = #{status},</if>
    </trim>
    where id = #{id}
  </update>

  <delete id="deleteBCustomerXkcxCourseById" parameterType="Long">
    delete from b_customer_xkcx_course where id = #{id}
  </delete>

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