|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- <?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.WxMallFloorMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxMallFloor">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
- <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
- <result column="mall_id" jdbcType="BIGINT" property="mallId"/>
- <result column="building_id" jdbcType="BIGINT" property="buildingId"/>
- <result column="floor_name" jdbcType="VARCHAR" property="floorName"/>
- <result column="background_img" jdbcType="VARCHAR" property="backgroundImg"/>
- <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
- <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
- <result column="total_area" jdbcType="DECIMAL" property="totalArea"/>
- <result column="operating_area" jdbcType="DECIMAL" property="operatingArea"/>
-
- <result column="floor_map" jdbcType="VARCHAR" property="floorMap"/>
-
- </resultMap>
-
- <sql id="allColumns">
- `id`,`tenant_id`,`parent_tenant_id`,`mall_id`,`building_id`,`floor_name`,`background_img`,`create_date`,`update_date`,`total_area`,`operating_area`,`floor_map`
- </sql>
-
- <sql id="dynamicWhereConditions">
- where 1 = 1
-
- <if test=" null != id ">
- and `id` = #{id}
- </if>
-
- <if test=" null != tenantId and '' != tenantId">
- and `tenant_id` = #{tenantId}
- </if>
- <if test=" null != parentTenantId and '' != parentTenantId">
- and `parent_tenant_id` = #{parentTenantId}
- </if>
-
- <if test=" null != mallId ">
- and `mall_id` = #{mallId}
- </if>
-
- <if test=" null != buildingId ">
- and `building_id` = #{buildingId}
- </if>
-
- <if test=" null != floorName ">
- and `floor_name` like concat('%', #{floorName},'%')
- </if>
-
- <if test=" null != backgroundImg ">
- and `background_img` like concat('%', #{backgroundImg},'%')
- </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.WxMallFloor" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from wx_mall_floor
- <include refid="dynamicWhereConditions"/>
- </select>
-
-
- <delete id="deleteByBuildingId">
- delete from wx_mall_floor where building_id = #{buildingId}
- </delete>
-
- <delete id="deleteByTenantId">
- delete from wx_mall_floor where `tenant_id` = #{tenantId}
- </delete>
-
- <select id="findIdAndName" resultMap="BaseResultMap">
- select
- `id`,`floor_name`
- from wx_mall_floor
- where `tenant_id` = #{tenantId}
- </select>
-
- </mapper>
|