|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <?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="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
- <result column="mall_id" jdbcType="BIGINT" property="mallId" />
- <!--<result column="building_name" jdbcType="VARCHAR" property="name" />-->
- <result column="building_name" jdbcType="VARCHAR" property="buildingName" />
- <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`,`parent_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 '' != 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 != 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>
-
-
- <delete id="deleteByTenantId">
- delete from wx_mall_building where `tenant_id` = #{tenantId}
- </delete>
-
- <select id="findIdAndName" resultMap="BaseResultMap">
- select
- `id`,`building_name`
- from wx_mall_building
- where `tenant_id` = #{tenantId}
- </select>
-
-
- </mapper>
|