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

  <resultMap type="BBusiHollandQuestionOptions" id="BBusiHollandQuestionOptionsResult">
    <result property="id" column="id" />
    <result property="questionId" column="questionId" />
    <result property="no" column="no" />
    <result property="label" column="label" />
    <result property="status" column="status" />
  </resultMap>

  <sql id="selectBBusiHollandQuestionOptionsVo">
    select id, questionId, no, label, status from b_busi_holland_question_options
  </sql>

  <select id="selectBBusiHollandQuestionOptionsList" parameterType="BBusiHollandQuestionOptions" resultMap="BBusiHollandQuestionOptionsResult">
    <include refid="selectBBusiHollandQuestionOptionsVo" />
    <where>
      <if test="questionId != null "> and questionId = #{questionId}</if>
      <if test="no != null "> and no = #{no}</if>
      <if test="label != null  and label != ''"> and label = #{label}</if>
      <if test="status != null "> and status = #{status}</if>
    </where>
  </select>

  <select id="selectBBusiHollandQuestionOptionsList2" parameterType="map" resultMap="BBusiHollandQuestionOptionsResult">
    <include refid="selectBBusiHollandQuestionOptionsVo" />
    <where>
      <if test="questionIds != null "> and questionId in <foreach item="id" collection="questionIds" open="(" separator="," close=")">#{id}</foreach></if>
      <if test="status != null "> and status = #{status}</if>
    </where>
  </select>

  <select id="selectBBusiHollandQuestionOptionsById" parameterType="Long" resultMap="BBusiHollandQuestionOptionsResult">
    <include refid="selectBBusiHollandQuestionOptionsVo" />
    where id = #{id}
  </select>

  <insert id="insertBBusiHollandQuestionOptions" parameterType="BBusiHollandQuestionOptions" useGeneratedKeys="true" keyProperty="id">
    insert into b_busi_holland_question_options
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="questionId != null">questionId,</if>
      <if test="no != null">no,</if>
      <if test="label != null">label,</if>
      <if test="status != null">status,</if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="questionId != null">#{questionId},</if>
      <if test="no != null">#{no},</if>
      <if test="label != null">#{label},</if>
      <if test="status != null">#{status},</if>
    </trim>
  </insert>

  <update id="updateBBusiHollandQuestionOptions" parameterType="BBusiHollandQuestionOptions">
    update b_busi_holland_question_options
    <trim prefix="SET" suffixOverrides=",">
      <if test="questionId != null">questionId = #{questionId},</if>
      <if test="no != null">no = #{no},</if>
      <if test="label != null">label = #{label},</if>
      <if test="status != null">status = #{status},</if>
    </trim>
    where id = #{id}
  </update>

  <delete id="deleteBBusiHollandQuestionOptionsById" parameterType="Long">
    delete from b_busi_holland_question_options where id = #{id}
  </delete>

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