<?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.iformall.mapper.WxMallBuildingMapper">
	<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxMallBuilding">
		<id column="id" jdbcType="BIGINT" property="id" />
		<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
		<result column="mall_id" jdbcType="BIGINT" property="mallId" />
		<result column="building_name" jdbcType="VARCHAR" property="name" />
		<result column="floor_number" jdbcType="INTEGER" property="floorNumber" />
		<result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
		<result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
	</resultMap>
	
	<sql id="allColumns">
	    `id`,`tenant_id`,`mall_id`,`building_name`,`floor_number`,`create_date`,`update_date`
	</sql>

	<sql id="dynamicWhereConditions">
	        where 1 = 1
	    
		<if test=" null != id "> 
		and `id` = #{id} 
       	
		</if>    
	    
		<if test=" null != tenantId "> 
		and `tenant_id`  = #{tenantId}
       	
		</if>    
	    
		<if test=" null != mallId "> 
		and `mall_id` = #{mallId} 
       	
		</if>    
	    
		<if test=" null != name ">
		and `building_name`  like concat('%', #{name},'%')
       	
		</if>    
	    
		<if test=" null != floorNumber "> 
		and `floor_number` = #{floorNumber} 
       	
		</if>    
	    
		<if test=" null != createDate "> 
		and `create_date` = #{createDate} 
       	
		</if>    
	    
		<if test=" null != updateDate "> 
		and `update_date` = #{updateDate} 
       	
		</if>    
		<if test=" null != ids ">
		 	and id in  
			<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
			#{idItem}
			</foreach>
		</if>		
		<if test=" null != sortColumns"> order by ${sortColumns} </if>
	</sql>
	
	<select id="findList" parameterType="com.iformall.domain.po.WxMallBuilding" resultMap="BaseResultMap">
		select <include refid="allColumns" /> from wx_mall_building
		<include refid="dynamicWhereConditions" />
	</select>
	
	
	
	
	
	
</mapper>
