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

  <resultMap type="BBusiHollandRecords" id="BBusiHollandRecordsResult">
    <result property="id" column="id" />
    <result property="customerCode" column="customerCode" />
    <result property="code" column="code" />
    <result property="wants1" column="wants1" />
    <result property="wants2" column="wants2" />
    <result property="wants3" column="wants3" />
    <result property="ruleCode" column="ruleCode" />
    <result property="scorer" column="score_r" />
    <result property="scorei" column="score_i" />
    <result property="scorea" column="score_a" />
    <result property="scores" column="score_s" />
    <result property="scoree" column="score_e" />
    <result property="scorec" column="score_c" />
    <result property="createTime" column="createTime" />
    <result property="status" column="status" />
  </resultMap>

  <sql id="selectBBusiHollandRecordsVo">
    select id, customerCode, code, wants1, wants2, wants3, ruleCode, score_r, score_i, score_a, score_s, score_e, score_c, createTime, status from b_busi_holland_records
  </sql>

  <select id="selectBBusiHollandRecordsList" parameterType="BBusiHollandRecords" resultMap="BBusiHollandRecordsResult">
    <include refid="selectBBusiHollandRecordsVo" />
    <where>
      <if test="customerCode != null  and customerCode != ''"> and customerCode = #{customerCode}</if>
      <if test="code != null  and code != ''"> and code = #{code}</if>
      <if test="wants1 != null  and wants1 != ''"> and wants1 = #{wants1}</if>
      <if test="wants2 != null  and wants2 != ''"> and wants2 = #{wants2}</if>
      <if test="wants3 != null  and wants3 != ''"> and wants3 = #{wants3}</if>
      <if test="ruleCode != null  and ruleCode != ''"> and ruleCode = #{ruleCode}</if>
      <if test="scorer != null "> and score_r = #{scorer}</if>
      <if test="scorei != null "> and score_i = #{scorei}</if>
      <if test="scorea != null "> and score_a = #{scorea}</if>
      <if test="scores != null "> and score_s = #{scores}</if>
      <if test="scoree != null "> and score_e = #{scoree}</if>
      <if test="scorec != null "> and score_c = #{scorec}</if>
      <if test="createTime != null "> and createTime = #{createTime}</if>
      <if test="status != null "> and status = #{status}</if>
    </where>
    order by id desc
  </select>

  <select id="selectBBusiHollandRecordsById" parameterType="Long" resultMap="BBusiHollandRecordsResult">
    <include refid="selectBBusiHollandRecordsVo" />
    where id = #{id}
  </select>

  <insert id="insertBBusiHollandRecords" parameterType="BBusiHollandRecords" useGeneratedKeys="true" keyProperty="id">
    insert into b_busi_holland_records
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="customerCode != null and customerCode != ''">customerCode,</if>
      <if test="code != null and code != ''">code,</if>
      <if test="wants1 != null">wants1,</if>
      <if test="wants2 != null">wants2,</if>
      <if test="wants3 != null">wants3,</if>
      <if test="ruleCode != null and ruleCode != ''">ruleCode,</if>
      <if test="scorer != null">score_r,</if>
      <if test="scorei != null">score_i,</if>
      <if test="scorea != null">score_a,</if>
      <if test="scores != null">score_s,</if>
      <if test="scoree != null">score_e,</if>
      <if test="scorec != null">score_c,</if>
      <if test="createTime != null">createTime,</if>
      <if test="status != null">status,</if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="customerCode != null and customerCode != ''">#{customerCode},</if>
      <if test="code != null and code != ''">#{code},</if>
      <if test="wants1 != null">#{wants1},</if>
      <if test="wants2 != null">#{wants2},</if>
      <if test="wants3 != null">#{wants3},</if>
      <if test="ruleCode != null and ruleCode != ''">#{ruleCode},</if>
      <if test="scorer != null">#{scorer},</if>
      <if test="scorei != null">#{scorei},</if>
      <if test="scorea != null">#{scorea},</if>
      <if test="scores != null">#{scores},</if>
      <if test="scoree != null">#{scoree},</if>
      <if test="scorec != null">#{scorec},</if>
      <if test="createTime != null">#{createTime},</if>
      <if test="status != null">#{status},</if>
    </trim>
  </insert>

  <update id="updateBBusiHollandRecords" parameterType="BBusiHollandRecords">
    update b_busi_holland_records
    <trim prefix="SET" suffixOverrides=",">
      <if test="customerCode != null and customerCode != ''">customerCode = #{customerCode},</if>
      <if test="code != null and code != ''">code = #{code},</if>
      <if test="wants1 != null">wants1 = #{wants1},</if>
      <if test="wants2 != null">wants2 = #{wants2},</if>
      <if test="wants3 != null">wants3 = #{wants3},</if>
      <if test="ruleCode != null and ruleCode != ''">ruleCode = #{ruleCode},</if>
      <if test="scorer != null">score_r = #{scorer},</if>
      <if test="scorei != null">score_i = #{scorei},</if>
      <if test="scorea != null">score_a = #{scorea},</if>
      <if test="scores != null">score_s = #{scores},</if>
      <if test="scoree != null">score_e = #{scoree},</if>
      <if test="scorec != null">score_c = #{scorec},</if>
      <if test="createTime != null">createTime = #{createTime},</if>
      <if test="status != null">status = #{status},</if>
    </trim>
    where id = #{id}
  </update>

  <delete id="deleteBBusiHollandRecordsById" parameterType="Long">
    delete from b_busi_holland_records where id = #{id}
  </delete>

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