<?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.huiju.estateagents.mapper.TaBuildingImgMapper">
    <select id="getBuildingImgByApartment" resultType="com.huiju.estateagents.entity.TaBuildingImg" >
      select a.* from ta_building_img a inner join ta_apartment_img b on a.img_id = b.img_id
      where a.status = 1 and b.status= 1 and b.apartment_id = #{id} order by a.order_no asc
    </select>

    <delete id="delBuildingImgByApartment" >
        delete a from ta_building_img a inner join ta_apartment_img b on a.img_id=b.img_id where b.apartment_id=#{id}
    </delete>
</mapper>
