`id`,`tenant_id`,`parent_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`,`is_del`,DATEDIFF(now(),create_date) freeDay,rent,rent_unit,business_id
where is_del=0
and `id` = #{id}
and `tenant_id` = #{tenantId}
and `parent_tenant_id` = #{parentTenantId}
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 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,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,s.addr,DATEDIFF(now(),s.create_date) freeDay,rent,rent_unit,s.business_id as
businessId,s.create_date create_date
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 s.is_del=0
and s.`type` = #{type}
and s.`tenant_id` = #{tenantId}
and s.`parent_tenant_id` = #{parentTenantId}
and s.`status` = #{status}
and s.`building`= #{building}
and s.`floor` = #{floor}
and s.`id` = #{id}
and s.`shop_number` like concat('%', #{shopNumber},'%')
and s.`build_area` like concat('%', #{buildArea},'%')
and s.`operation_area` like concat('%', #{operationArea},'%')
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.`point_type` = #{pointType}
and s.id in
#{idItem}
order by ${sortColumns}
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,b.building_name building,f.floor_name floor,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
from wx_shop s
left join wx_mall_building b on s.building=b.id
left join wx_mall_floor f on s.floor=f.id
where s.is_del=0
and s.`id` = #{id}
and s.`tenant_id` = #{tenantId}
and s.`parent_tenant_id` = #{parentTenantId}
and s.`shop_number` like concat('%', #{shopNumber},'%')
and s.`status` = #{status}
and s.`type` = #{type}
and s.`point_type` = #{pointType}
order by ${sortColumn} ${sortOrder}
order by ${sortColumns}
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,
b.building_name,f.floor_name,
m.id merchantId,m.name merchantName,m.link_person,m.link_phone,
brand.name brandName,
bus.title business,s.create_date as create_date
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
left join wx_business bus on m.business_id = bus.id
left join wx_brand brand on m.brand = brand.id
where s.is_del=0
and s.`id` = #{id}
and s.`tenant_id` = #{tenantId}
and s.`parent_tenant_id` = #{parentTenantId}
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.business_id = #{businessId}
and s.id in
#{idItem}
order by ${sortColumns}
select id,shop_number shopNumber from wx_shop
where shop_number = #{shopNumber} and is_del=0
and `tenant_id` = #{tenantId}
and `parent_tenant_id` = #{parentTenantId}
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.shop_id=#{shopId} and ms.is_del=0 and s.is_del=0
and ms.`tenant_id` = #{tenantId}
and ms.`parent_tenant_id` = #{parentTenantId}
select count(id) shopcount,IFNULL(sum(build_area),0) area from wx_shop
where status=#{status} and is_del=0
and `tenant_id` = #{tenantId}
and `parent_tenant_id` = #{parentTenantId}
select s.id 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,s.create_date create_date
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 s.is_del=0 and ms.is_del=0
and s.`tenant_id` = #{tenantId}
and s.`parent_tenant_id` = #{parentTenantId}
and s.`status` = #{status}
and s.id not in(
SELECT shop_id FROM wx_rent_contract WHERE status in(1,2,3,4,8)
and rent_shop_type=2
and `tenant_id` = #{tenantId}
and `parent_tenant_id` = #{parentTenantId}
)
and s.`type` = #{type}
and s.`point_type` = #{pointType}
and s.shop_number = #{shopNumber}
and b.building_name like concat('%', #{building},'%')
and m.`name` like concat('%', #{merchantName},'%')
order by ${sortColumns}
select count(*) from wx_shop where shop_number=#{shopNumber} and `type`=#{type}
and is_del=0
and `tenant_id` = #{tenantId}
and `parent_tenant_id` = #{parentTenantId}
and id != #{id}
select s.id,s.shop_number,b.building_name,f.floor_name,s.addr,s.baidu_poi,s.manager_phone,s.manager
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 s.is_del=0 and ms.is_del=0
and m.id=#{merchantId}
select count(*) from wx_shop w where w.is_del=0
and `tenant_id` = #{tenantId}
and `parent_tenant_id` = #{parentTenantId}
and `type`=#{type}
and status = #{status}
and building = #{building}
and floor = #{floor}
and `create_date` >= #{startdate}
and `create_date` <= #{enddate}
and business_id = #{businessId}
select
DATE_FORMAT(w.create_date,'%Y/%m/%d') xTime
DATE_FORMAT(w.create_date,'%Y/%m') xTime
,count(distinct w.shop_id) xCount
from wx_merchant_shop w left join wx_shop s on w.shop_id=s.id
where w.is_del=0 and s.is_del=0
and w.`tenant_id` = #{tenantId}
and w.`parent_tenant_id` = #{parentTenantId}
and s.building=#{building}
and s.floor=#{floor}
and s.business_id=#{businessId}
group by xTime
order by xTime