<?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.system.mapper.house.HouseResourceBusinessEntityInfoMappingMapper">
    <resultMap id="BaseResultMap" type="com.ruoyi.system.domain.house.HouseResourceBusinessEntityInfoMapping">
        <id property="houseResourceId" column="house_resource_id" jdbcType="VARCHAR"/>
        <id property="businessEntityInfoId" column="business_entity_info_id" jdbcType="VARCHAR"/>
    </resultMap>
    <insert id="insert">
        INSERT INTO house_resource_business_entity_info_mapping
        (id, house_resource_id, business_entity_info_id)
        VALUES
        (#{id,jdbcType=VARCHAR}, #{houseResourceId,jdbcType=VARCHAR}, #{businessEntityInfoId,jdbcType=VARCHAR})
    </insert>
    <delete id="deleteByHouseResourceIdBusinessEntityInfoId">
        DELETE FROM house_resource_business_entity_info_mapping
        WHERE house_resource_id = #{houseResourceId,jdbcType=VARCHAR}
        AND business_entity_info_id = #{businessEntityInfoId,jdbcType=VARCHAR}
    </delete>
    <delete id="deleteByHouseResourceId">
        DELETE FROM house_resource_business_entity_info_mapping
        WHERE house_resource_id = #{houseResourceId,jdbcType=VARCHAR}
    </delete>
    <select id="selectByBusinessEntityInfoId"
            resultType="com.ruoyi.system.domain.house.HouseResourceBusinessEntityInfoMapping">
        SELECT * FROM house_resource_business_entity_info_mapping WHERE business_entity_info_id = #{businessEntityInfoId,jdbcType=VARCHAR}
    </select>
    <select id="selectByHouseResourceId"
            resultType="com.ruoyi.system.domain.house.HouseResourceBusinessEntityInfoMapping">
        SELECT * FROM house_resource_business_entity_info_mapping WHERE house_resource_id = #{houseResourceId,jdbcType=VARCHAR}
    </select>
    <select id="selectByHouseResourceIds"
            resultType="com.ruoyi.system.domain.house.HouseResourceBusinessEntityInfoMapping">
        SELECT * FROM house_resource_business_entity_info_mapping WHERE house_resource_id IN
        <foreach item="item" index="index" collection="houseResourceIds" open="(" separator="," close=")">
            #{item}
        </foreach>
    </select>
</mapper>
