<?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.szxc.mapper.SzxcJmHouseMapper">

    <resultMap type="SzxcJmHouse" id="SzxcJmHouseResult">
        <result property="id"    column="id"    />
        <result property="jmId"    column="jm_id"    />
        <result property="houseId"    column="house_id"    />
    </resultMap>

    <sql id="selectSzxcJmHouseVo">
        select id, jm_id, house_id from szxc_jm_house
    </sql>

    <select id="selectSzxcJmHouseList" parameterType="SzxcJmHouse" resultMap="SzxcJmHouseResult">
        <include refid="selectSzxcJmHouseVo"/>
        <where>
            <if test="jmId != null "> and jm_id = #{jmId}</if>
            <if test="houseId != null "> and house_id = #{houseId}</if>
        </where>
    </select>

    <select id="selectSzxcJmHouseById" parameterType="Long" resultMap="SzxcJmHouseResult">
        <include refid="selectSzxcJmHouseVo"/>
        where id = #{id}
    </select>

    <insert id="insertSzxcJmHouse" parameterType="SzxcJmHouse" useGeneratedKeys="true" keyProperty="id">
        insert into szxc_jm_house
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="jmId != null">jm_id,</if>
            <if test="houseId != null">house_id,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="jmId != null">#{jmId},</if>
            <if test="houseId != null">#{houseId},</if>
        </trim>
    </insert>

    <update id="updateSzxcJmHouse" parameterType="SzxcJmHouse">
        update szxc_jm_house
        <trim prefix="SET" suffixOverrides=",">
            <if test="jmId != null">jm_id = #{jmId},</if>
            <if test="houseId != null">house_id = #{houseId},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteSzxcJmHouseById" parameterType="Long">
        delete from szxc_jm_house where id = #{id}
    </delete>

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