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

  <resultMap type="BBusiHollandRules" id="BBusiHollandRulesResult">
    <result property="id" column="id" />
    <result property="code" column="code" />
    <result property="jobs" column="jobs" />
    <result property="marjors" column="marjors" />
    <result property="status" column="status" />
  </resultMap>

  <sql id="selectBBusiHollandRulesVo">
    select id, code, jobs, marjors, status from b_busi_holland_rules
  </sql>

  <select id="selectBBusiHollandRulesList" parameterType="BBusiHollandRules" resultMap="BBusiHollandRulesResult">
    <include refid="selectBBusiHollandRulesVo" />
    <where>
      <if test="code != null  and code != ''"> and code = #{code}</if>
      <if test="jobs != null  and jobs != ''"> and jobs = #{jobs}</if>
      <if test="marjors != null  and marjors != ''"> and marjors = #{marjors}</if>
      <if test="status != null "> and status = #{status}</if>
    </where>
  </select>

  <select id="selectBBusiHollandRulesById" parameterType="Long" resultMap="BBusiHollandRulesResult">
    <include refid="selectBBusiHollandRulesVo" />
    where id = #{id}
  </select>

  <insert id="insertBBusiHollandRules" parameterType="BBusiHollandRules" useGeneratedKeys="true" keyProperty="id">
    insert into b_busi_holland_rules
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="code != null and code != ''">code,</if>
      <if test="jobs != null">jobs,</if>
      <if test="marjors != null">marjors,</if>
      <if test="status != null">status,</if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="code != null and code != ''">#{code},</if>
      <if test="jobs != null">#{jobs},</if>
      <if test="marjors != null">#{marjors},</if>
      <if test="status != null">#{status},</if>
    </trim>
  </insert>

  <update id="updateBBusiHollandRules" parameterType="BBusiHollandRules">
    update b_busi_holland_rules
    <trim prefix="SET" suffixOverrides=",">
      <if test="code != null and code != ''">code = #{code},</if>
      <if test="jobs != null">jobs = #{jobs},</if>
      <if test="marjors != null">marjors = #{marjors},</if>
      <if test="status != null">status = #{status},</if>
    </trim>
    where id = #{id}
  </update>

  <delete id="deleteBBusiHollandRulesById" parameterType="Long">
    delete from b_busi_holland_rules where id = #{id}
  </delete>

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