`id`,`tenant_id`,`shop_number`,`build_area`,`operation_area`,`building`,
`floor`,`status`,`x`,`y`,`addr`,`baidu_poi`,`longitude`,`latitude`,`create_date`,
`update_date`,`img_url`,`manager`,`manager_phone`,`type`,`point_type`,`comments`
where 1 = 1
and `id` = #{id}
and `tenant_id` = #{tenantId}
and `shop_number` like concat('%', #{shopNumber},'%')
and `build_area` like concat('%', #{buildArea},'%')
and `operation_area` like concat('%', #{operationArea},'%')
and `building` like concat('%', #{building},'%')
and `floor` = #{floor}
and `status` = #{status}
and `x` = #{x}
and `y` = #{y}
and `addr` like concat('%', #{addr},'%')
and `baidu_poi` like concat('%', #{baiduPoi},'%')
and `longitude` = #{longitude}
and `latitude` = #{latitude}
and `create_date` = #{createDate}
and `update_date` = #{updateDate}
and `manager` = #{manager}
and `manager_phone` = #{managerPhone}
and `type` = #{type}
and `point_type` = #{pointType}
and id in
#{idItem}
order by ${sortColumns}
select
from wx_shop
select s.id,s.shop_number shopNumber,s.build_area buildArea,
s.img_url imgUrl,s.operation_area operationArea,
s.status,b.building_name building,f.floor_name floor,m.`name` merchantName,m.id merchantId,
m.link_person linkPerson,m.link_phone linkPhone,s.manager,s.manager_phone managerPhone,
s.type,s.point_type pointType
from wx_shop s left join wx_merchant_shop ms on ms.shop_id=s.id and ms.is_del=0
left join wx_merchant m on ms.merchant_id=m.id
left join wx_mall_building b on s.building=b.id
left join wx_mall_floor f on s.floor=f.id
where 1 = 1
and s.`id` = #{id}
and s.`tenant_id`= #{tenantId}
and s.`shop_number` like concat('%', #{shopNumber},'%')
and s.`build_area` like concat('%', #{buildArea},'%')
and s.`operation_area` like concat('%', #{operationArea},'%')
and s.`building`= #{building}
and s.`floor` = #{floor}
and s.`status` = #{status}
and s.`x` = #{x}
and s.`y` = #{y}
and s.`addr` like concat('%', #{addr},'%')
and s.`baidu_poi` like concat('%', #{baiduPoi},'%')
and s.`longitude` = #{longitude}
and s.`latitude` = #{latitude}
and s.`create_date` = #{createDate}
and s.`update_date` = #{updateDate}
and s.`manager` = #{manager}
and s.`manager_phone` = #{managerPhone}
and s.`type` = #{type}
and s.`point_type` = #{pointType}
and s.id in
#{idItem}
order by s.${sortColumns}
select id,shop_number shopNumber from wx_shop
where tenant_id=#{tenantId} and shop_number = #{shopNumber}
select m.`name` merchantName,s.build_area buildArea,s.operation_area operationArea,
c.price,c.receive_period receivePeriod,s.shop_number shopNumber,m.link_person linkPerson,
m.link_phone linkPhone
from wx_merchant_shop ms inner join wx_merchant m on ms.merchant_id=m.id
inner join wx_shop s on ms.shop_id=s.id
inner join wx_rent_contract c on ms.merchant_id=c.merchant_id
where ms.tenant_id=#{tenantId} and ms.shop_id=#{shopId} and ms.is_del=0
select count(id) shopcount,IFNULL(sum(build_area),0) area from wx_shop
where tenant_id=#{tenantId} and status=#{status}
select s.id,s.shop_number shopNumber,s.build_area buildArea,
s.img_url imgUrl,s.operation_area operationArea,
s.status,b.building_name building,f.floor_name floor,m.`name` merchantName,m.id merchantId,
m.link_person linkPerson,m.link_phone linkPhone,s.manager,s.manager_phone managerPhone,
m.brand,m.business_id businessId,m.shop_type shopType
from wx_shop s left join wx_merchant_shop ms on ms.shop_id=s.id
left join wx_merchant m on ms.merchant_id=m.id
left join wx_mall_building b on s.building=b.id
left join wx_mall_floor f on s.floor=f.id
where 1=1 and ms.is_del=0
and s.tenant_id=#{tenantId}
and s.`status` = #{status}
and s.id not in(
SELECT shop_id FROM wx_rent_contract WHERE tenant_id = #{tenantId} and status!=1 and status!=5 and status!=6 and status!=7 and merchant_id is not null
)
and s.`type` = #{type}
and s.`point_type` = #{pointType}
order by s.${sortColumns}
select count(*) from wx_shop where tenant_id=#{tenantId} and shop_number=#{shopNumber}
and id != #{id}