|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616 |
- <?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.WxShopMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxShop">
- <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="shop_number" jdbcType="VARCHAR" property="shopNumber"/>
- <result column="build_area" jdbcType="VARCHAR" property="buildArea"/>
- <result column="operation_area" jdbcType="VARCHAR" property="operationArea"/>
- <result column="building" jdbcType="BIGINT" property="building"/>
- <result column="floor" jdbcType="BIGINT" property="floor"/>
- <result column="building_name" jdbcType="VARCHAR" property="buildingName"/>
- <result column="floor_name" jdbcType="VARCHAR" property="floorName"/>
- <result column="status" jdbcType="INTEGER" property="status"/>
- <result column="x" jdbcType="DECIMAL" property="x"/>
- <result column="y" jdbcType="DECIMAL" property="y"/>
- <result column="sid" jdbcType="VARCHAR" property="sid"/>
- <result column="addr" jdbcType="VARCHAR" property="addr"/>
- <result column="baidu_poi" jdbcType="VARCHAR" property="baiduPoi"/>
- <result column="longitude" jdbcType="DECIMAL" property="longitude"/>
- <result column="latitude" jdbcType="DECIMAL" property="latitude"/>
- <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
- <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
- <result column="img_url" jdbcType="VARCHAR" property="imgUrl"/>
- <result column="manager" jdbcType="VARCHAR" property="manager"/>
- <result column="manager_phone" jdbcType="VARCHAR" property="managerPhone"/>
- <result column="type" jdbcType="INTEGER" property="type"/>
- <result column="point_type" jdbcType="INTEGER" property="pointType"/>
- <result column="comments" jdbcType="VARCHAR" property="comments"/>
- <result column="is_del" jdbcType="INTEGER" property="isDel"/>
- <result column="freeDay" property="freeDay"/>
- <result column="rent" property="rent"/>
- <result column="rent_unit" property="rentUnit"/>
- <result column="business_id" property="businessId"/>
-
- </resultMap>
-
- <sql id="allColumns">
- `id`,`tenant_id`,`parent_tenant_id`,`shop_number`,`build_area`,`operation_area`,`building`,`floor`,`status`,`x`,`y`,`sid`,`addr`,
- `baidu_poi`,`longitude`,`latitude`,`create_date`,`update_date`,`img_url`,`manager`,`manager_phone`,
- `type`,`point_type`,`comments`,`is_del`,DATEDIFF(now(),create_date) freeDay,rent,rent_unit,business_id
- </sql>
-
- <sql id="dynamicWhereConditions">
- where is_del=0
-
- <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 != shopNumber and ''!=shopNumber">
- and `shop_number` like concat('%', #{shopNumber},'%')
- </if>
-
- <if test=" null != buildArea ">
- and `build_area` like concat('%', #{buildArea},'%')
- </if>
-
- <if test=" null != operationArea ">
- and `operation_area` like concat('%', #{operationArea},'%')
- </if>
-
- <if test=" null != building ">
- and `building` like concat('%', #{building},'%')
- </if>
-
- <if test=" null != floor ">
- and `floor` = #{floor}
- </if>
-
- <if test=" null != status ">
- and `status` = #{status}
- </if>
-
- <if test=" null != x ">
- and `x` = #{x}
- </if>
-
- <if test=" null != y ">
- and `y` = #{y}
- </if>
-
- <if test=" null != sid ">
- and `sid` = #{sid}
- </if>
-
- <if test=" null != addr ">
- and `addr` like concat('%', #{addr},'%')
- </if>
-
- <if test=" null != baiduPoi ">
- and `baidu_poi` like concat('%', #{baiduPoi},'%')
- </if>
-
- <if test=" null != longitude ">
- and `longitude` = #{longitude}
- </if>
-
- <if test=" null != latitude ">
- and `latitude` = #{latitude}
- </if>
-
- <if test=" null != createDate ">
- and `create_date` = #{createDate}
- </if>
-
- <if test=" null != updateDate ">
- and `update_date` = #{updateDate}
- </if>
- <if test=" null != manager ">
- and `manager` = #{manager}
- </if>
- <if test=" null != managerPhone ">
- and `manager_phone` = #{managerPhone}
- </if>
-
- <if test=" null != type ">
- and `type` = #{type}
- </if>
-
- <if test=" null != pointType ">
- and `point_type` = #{pointType}
- </if>
-
- <if test=" null != floorForRule and '' != floorForRule ">
- and `floor` in (${floorForRule})
- </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.WxShop" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from wx_shop
- <include refid="dynamicWhereConditions"/>
- </select>
-
- <select id="findCount" parameterType="com.iformall.domain.po.WxShop" resultType="java.lang.Long">
- select count(id)
- from wx_shop
- <include refid="dynamicWhereConditions"/>
-
- </select>
-
- <select id="findIdList" parameterType="com.iformall.domain.po.WxShop" resultType="Long">
- select id
- from wx_shop
- <include refid="dynamicWhereConditions"/>
- </select>
-
- <select id="selectBatchByIds" resultMap="BaseResultMap">
- select
- s.`id`,s.`tenant_id`,s.`parent_tenant_id`,s.`shop_number`,s.`build_area`,s.`operation_area`,s.building,s.floor,s.`status`,s.`x`,s.`y`,s.`sid`,s.`addr`,
- s.`baidu_poi`,s.`longitude`,s.`latitude`,s.`create_date`,s.`update_date`,s.`img_url`,s.`manager`,s.`manager_phone`,
- s.`type`,s.`point_type`,s.`comments`,s.`is_del`,DATEDIFF(now(),s.create_date) freeDay,s.rent,s.rent_unit,s.business_id
- from wx_shop s
- where s.is_del=0
- <if test=" null != ids ">
- and s.id in
- <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
- </select>
-
- <select id="findListMap" parameterType="com.iformall.domain.po.WxShop" resultType="hashmap">
- select s.id id, s.tenant_id tenantId, s.parent_tenant_id parentTenantId, s.shop_number shopNumber,CONVERT(s.build_area,DECIMAL(10,2)) buildArea,
- s.img_url imgUrl,CONVERT(s.operation_area,DECIMAL(10,2)) operationArea,s.status,s.type,s.point_type pointType,s.addr,DATEDIFF(now(),s.create_date) freeDay,
- s.business_id as businessId,s.create_date create_date,s.rent,s.rent_unit,s.building as buildingId,s.floor as floorId,s.manager,s.manager_phone managerPhone
-
- from wx_shop s
- where s.is_del=0
-
- <if test=" null != type ">
- and s.`type` = #{type}
- </if>
-
- <if test=" null != tenantId and '' != tenantId">
- and s.`tenant_id` = #{tenantId}
- </if>
- <if test=" null != parentTenantId and '' != parentTenantId">
- and s.`parent_tenant_id` = #{parentTenantId}
- </if>
-
- <if test=" null != status">
- and s.`status` = #{status}
- </if>
-
- <if test=" null != building ">
- and s.`building`= #{building}
- </if>
-
- <if test=" null != floor ">
- and s.`floor` = #{floor}
- </if>
-
- <if test=" null != id ">
- and s.`id` = #{id}
- </if>
-
- <if test=" null != shopNumber and ''!=shopNumber">
- and s.`shop_number` like concat('%', #{shopNumber},'%')
- </if>
-
- <if test=" null != buildArea ">
- and s.`build_area` like concat('%', #{buildArea},'%')
- </if>
-
- <if test=" null != operationArea ">
- and s.`operation_area` like concat('%', #{operationArea},'%')
- </if>
-
- <if test=" null != x ">
- and s.`x` = #{x}
- </if>
-
- <if test=" null != y ">
- and s.`y` = #{y}
- </if>
-
- <if test=" null != sid ">
- and s.`sid` = #{sid}
- </if>
-
- <if test=" null != addr ">
- and s.`addr` like concat('%', #{addr},'%')
- </if>
-
- <if test=" null != baiduPoi ">
- and s.`baidu_poi` like concat('%', #{baiduPoi},'%')
- </if>
-
- <if test=" null != longitude ">
- and s.`longitude` = #{longitude}
- </if>
-
- <if test=" null != latitude ">
- and s.`latitude` = #{latitude}
- </if>
-
- <if test=" null != createDate ">
- and s.`create_date` = #{createDate}
- </if>
-
- <if test=" null != updateDate ">
- and s.`update_date` = #{updateDate}
- </if>
-
- <if test=" null != manager ">
- and s.`manager` = #{manager}
- </if>
- <if test=" null != managerPhone ">
- and s.`manager_phone` = #{managerPhone}
- </if>
-
- <if test=" null != pointType ">
- and s.`point_type` = #{pointType}
- </if>
- <if test=" null != ids ">
- and s.id in
- <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
-
- <if test=" null != sortColumns">order by ${sortColumns}</if>
- </select>
-
- <select id="notRentListMapAsPage" parameterType="com.iformall.domain.po.WxShop" resultType="hashmap">
- select s.id as id, s.tenant_id tenantId, s.parent_tenant_id parentTenantId, s.shop_number shopNumber,s.build_area buildArea,
- s.img_url imgUrl,s.operation_area operationArea,s.status,s.manager,s.manager_phone managerPhone,s.type,s.point_type pointType,s.addr,DATEDIFF(now(),s.create_date) freeDay,
- s.create_date as createDate,s.building as buildingId,s.floor as floorId
-
- from wx_shop s
- where s.is_del=0
- <if test=" null != id ">
- and s.`id` = #{id}
- </if>
-
- <if test=" null != tenantId and '' != tenantId">
- and s.`tenant_id` = #{tenantId}
- </if>
- <if test=" null != parentTenantId and '' != parentTenantId">
- and s.`parent_tenant_id` = #{parentTenantId}
- </if>
-
- <if test=" null != shopNumber and ''!=shopNumber">
- and s.`shop_number` like concat('%', #{shopNumber},'%')
- </if>
- <if test=" null != status">
- and s.`status` = #{status}
- </if>
- <if test=" null != type ">
- and s.`type` = #{type}
- </if>
- <if test=" null != pointType ">
- and s.`point_type` = #{pointType}
- </if>
- <if test="null != sortColumn">
- order by ${sortColumn} ${sortOrder}
- </if>
- <if test="null == sortColumn">
- <if test=" null != sortColumns">order by ${sortColumns}</if>
- </if>
-
- </select>
-
- <select id="findListWithMerchantMap" parameterType="com.iformall.domain.vo.WxShopVo" resultMap="BaseResultMap">
- select
- s.id as id,s.shop_number,s.build_area,s.img_url,s.operation_area,s.status,s.manager,s.manager_phone,s.addr,s.type,s.point_type,
- s.create_date,s.building,s.floor
- from wx_shop s
- where s.is_del=0
-
- <if test=" null != id ">
- and s.`id` = #{id}
- </if>
-
- <if test=" null != tenantId and '' != tenantId">
- and s.`tenant_id` = #{tenantId}
- </if>
- <if test=" null != parentTenantId and '' != parentTenantId">
- and s.`parent_tenant_id` = #{parentTenantId}
- </if>
-
- <if test=" null != shopNumber and ''!=shopNumber">
- and s.`shop_number` like concat('%', #{shopNumber},'%')
- </if>
-
- <if test=" null != buildArea ">
- and s.`build_area` like concat('%', #{buildArea},'%')
- </if>
-
- <if test=" null != operationArea ">
- and s.`operation_area` like concat('%', #{operationArea},'%')
- </if>
-
- <if test=" null != building ">
- and s.`building`= #{building}
- </if>
-
- <if test=" null != floor ">
- and s.`floor` = #{floor}
- </if>
-
- <if test=" null != status">
- and s.`status` = #{status}
- </if>
-
- <if test=" null != x ">
- and s.`x` = #{x}
- </if>
-
- <if test=" null != y ">
- and s.`y` = #{y}
- </if>
-
- <if test=" null != sid ">
- and s.`sid` = #{sid}
- </if>
-
- <if test=" null != addr ">
- and s.`addr` like concat('%', #{addr},'%')
- </if>
-
- <if test=" null != baiduPoi ">
- and s.`baidu_poi` like concat('%', #{baiduPoi},'%')
- </if>
-
- <if test=" null != longitude ">
- and s.`longitude` = #{longitude}
- </if>
-
- <if test=" null != latitude ">
- and s.`latitude` = #{latitude}
- </if>
-
- <if test=" null != createDate ">
- and s.`create_date` = #{createDate}
- </if>
-
- <if test=" null != updateDate ">
- and s.`update_date` = #{updateDate}
- </if>
-
- <if test=" null != manager ">
- and s.`manager` = #{manager}
- </if>
- <if test=" null != managerPhone ">
- and s.`manager_phone` = #{managerPhone}
- </if>
- <if test=" null != type ">
- and s.`type` = #{type}
- </if>
- <if test=" null != pointType ">
- and s.`point_type` = #{pointType}
- </if>
-
- <if test="null != businessId">
- and s.business_id = #{businessId}
- </if>
-
- <if test=" null != ids ">
- and s.id in
- <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
- <if test=" null != sortColumns">order by ${sortColumns}</if>
- </select>
-
- <select id="getShopList" resultType="hashmap" parameterType="hashmap">
- select id,shop_number shopNumber from wx_shop
- where shop_number = #{shopNumber} and is_del=0
- <if test=" null != tenantId and '' != tenantId">
- and `tenant_id` = #{tenantId}
- </if>
- <if test=" null != parentTenantId and '' != parentTenantId">
- and `parent_tenant_id` = #{parentTenantId}
- </if>
- </select>
-
- <select id="getMerchantShopByShopId" resultType="hashmap" parameterType="hashmap">
- select
- s.id,s.build_area buildArea,s.operation_area operationArea,s.shop_number shopNumber, s.manager, s.manager_phone managerPhone
- from wx_shop s
- where s.id = #{id} and s.is_del=0
- </select>
-
- <select id="queryShopLeftInfo" resultType="hashmap" parameterType="hashmap">
- select count(id) shopcount,IFNULL(sum(build_area),0) area from wx_shop
- where status=#{status} and is_del=0
- <if test=" null != tenantId and '' != tenantId">
- and `tenant_id` = #{tenantId}
- </if>
- <if test=" null != parentTenantId and '' != parentTenantId">
- and `parent_tenant_id` = #{parentTenantId}
- </if>
- </select>
-
- <select id="listShopFromContract" parameterType="com.iformall.domain.po.WxShop" resultType="hashmap">
- select s.id id,s.shop_number shopNumber,s.build_area buildArea,s.building as buildingId,s.floor as floorId,
- s.img_url imgUrl,s.operation_area operationArea,s.manager,s.manager_phone managerPhone,s.status,s.create_date
-
- from wx_shop s
- where s.is_del=0
- <if test=" null != tenantId and '' != tenantId">
- and s.`tenant_id` = #{tenantId}
- </if>
- <if test=" null != parentTenantId and '' != parentTenantId">
- and s.`parent_tenant_id` = #{parentTenantId}
- </if>
- <if test=" null != status">
- and s.`status` = #{status}
- </if>
- <if test="null != notInIdList and null!=status and status==1 and type!=null and type==2">
- and s.id not in(
- <foreach collection="notInIdList" index="index" item="notInIdItem" open="(" separator="," close=")">
- #{notInIdItem}
- </foreach>
- )
- </if>
- <if test=" null != type ">
- and s.`type` = #{type}
- </if>
-
- <if test=" null != pointType ">
- and s.`point_type` = #{pointType}
- </if>
-
- <if test=" null != shopNumber and '' != shopNumber ">
- and s.shop_number = #{shopNumber}
- </if>
-
- <if test=" null != building and '' != building ">
- and b.building_name like concat('%', #{building},'%')
- </if>
-
- <if test=" null != merchantName and ''!=merchantName ">
- and m.`name` like concat('%', #{merchantName},'%')
- </if>
-
- <if test=" null != sortColumns">order by ${sortColumns}</if>
- </select>
-
-
- <select id="hasShopNumber" parameterType="com.iformall.domain.po.WxShop" resultType="Integer">
- select count(1) from wx_shop where shop_number=#{shopNumber} and `type`=#{type}
- and is_del=0
- <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 != id">
- and id != #{id}
- </if>
- </select>
-
- <select id="hasShopSid" parameterType="com.iformall.domain.po.WxShop" resultType="Integer">
- select count(1) from wx_shop where sid=#{sid}
- and is_del=0
- <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 != id">
- and id != #{id}
- </if>
- </select>
-
- <resultMap id="rentRate" type="com.iformall.domain.vo.WxShopRentRateVo">
- <result column="xTime" property="xTime"/>
- <result column="rate" property="rate"/>
- </resultMap>
-
- <select id="getCountByWxShop" parameterType="com.iformall.domain.po.WxShop" resultType="Long">
- select count(1) from wx_shop w where w.is_del=0
- <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 != type">
- and `type`=#{type}
- </if>
- <if test="null != status">
- and status = #{status}
- </if>
- <if test="null != building">
- and building = #{building}
- </if>
- <if test="null != floor">
- and floor = #{floor}
- </if>
- <if test="null != startdate">
- and `create_date` >= #{startdate}
- </if>
- <if test="null != enddate">
- and `create_date` <= #{enddate}
- </if>
- <if test="null != businessId and businessId!=0">
- and business_id = #{businessId}
- </if>
- </select>
-
- <update id="updateUnRentByIds" parameterType="Long">
- update wx_shop set status = 0
- where id in
- <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </update>
-
- <select id="detailById" parameterType="Long" resultType="hashmap">
- select s.id id, s.tenant_id tenantId, s.parent_tenant_id parentTenantId, s.shop_number shopNumber,CONVERT(s.build_area,DECIMAL(10,2)) buildArea,
- s.img_url imgUrl,CONVERT(s.operation_area,DECIMAL(10,2)) operationArea,
- s.status,s.manager,s.manager_phone managerPhone,
- s.type,s.point_type pointType,s.addr,DATEDIFF(now(),s.create_date) freeDay,s.rent,s.rent_unit,s.business_id as businessId,s.create_date,
- s.building as buildingId,s.floor as floorId
- from wx_shop s where s.`id` = #{id}
- </select>
-
-
- <select id="detailBySid" parameterType="com.iformall.domain.po.WxShop" resultType="hashmap">
- select
- s.id id, s.tenant_id tenantId, s.parent_tenant_id parentTenantId, s.shop_number shopNumber,
- CONVERT(s.build_area,DECIMAL(10,2)) buildArea,
- s.img_url imgUrl,CONVERT(s.operation_area,DECIMAL(10,2)) operationArea,
- s.status,s.manager,s.manager_phone managerPhone,s.type,s.point_type pointType,s.addr,DATEDIFF(now(),s.create_date) freeDay,s.rent,s.rent_unit,
- s.business_id as businessId,s.create_date,s.building as buildingId,s.floor as floorId
-
- from wx_shop s where s.`is_del` = 0 and s.`sid` = #{sid}
- <if test=" null != tenantId and '' != tenantId">
- and s.`tenant_id` = #{tenantId}
- </if>
- <if test=" null != parentTenantId and '' != parentTenantId">
- and s.`parent_tenant_id` = #{parentTenantId}
- </if>
- </select>
-
-
- <select id="newFindShopVoList" parameterType="java.util.Map" resultType="com.iformall.domain.vo.WxShopVo">
- select id,shop_number shopNumber,img_url imgUrl,addr,building,floor,baidu_poi baiduPoi,manager_phone linkPhone,manager linkPerson
- from wx_shop
- where is_del=0
- <if test=" null != tenantId and '' != tenantId">
- and `tenant_id` = #{tenantId}
- </if>
- <if test=" null != shopIds ">
- and id in
- <foreach collection="shopIds" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
- </select>
- </mapper>
|