|
|
|
<?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.kiisoo.ic.store.mapper.PoiStoreDOMapper">
|
|
|
|
|
|
|
|
<select id="selectRegionShop" resultType="com.kiisoo.ic.store.entity.PoiStore">
|
|
|
|
select t1.id,t1.name,t1.type,t1.code from poi_store t1, poi_store_region t2
|
|
|
|
where t1.id = t2.store_id and t2.region_id = #{regionId}
|
|
|
|
</select>
|
|
|
|
<select id="selectShopByName" resultType="com.kiisoo.ic.store.entity.PoiStore">
|
|
|
|
select t1.id,t1.name,t1.type,t1.code from poi_store t1
|
|
|
|
where name = #{name}
|
|
|
|
</select>
|
|
|
|
<select id="selectShopMsg" resultType="com.kiisoo.ic.generalize.entity.ShopRegionDO">
|
|
|
|
select t1.name as shopName,t3.name as regionName
|
|
|
|
from poi_store t1 left join poi_store_region t2 on t1.id = t2.store_id left join poi_region t3 on t2.region_id = t3.id
|
|
|
|
where t1.id = #{shopId}
|
|
|
|
</select>
|
|
|
|
<select id="selectCompanyStore" resultType="com.kiisoo.ic.generalize.entity.CompanyStoreDO">
|
|
|
|
select t2.name as companyName,t5.name as shopName,t5.code as shopCode
|
|
|
|
from poi_store_staff t1,
|
|
|
|
privilage_organizational t2,
|
|
|
|
privilage_organizational_domain t3,
|
|
|
|
privilage_domain_entity t4,
|
|
|
|
poi_store t5
|
|
|
|
where t2.id = t3.org_id
|
|
|
|
and t1.store_id = t5.id
|
|
|
|
and t3.domain_id = t4.domain_id
|
|
|
|
and t4.type = 3
|
|
|
|
and t1.store_id = t4.entity_id
|
|
|
|
and t1.user_id = #{sellerId}
|
|
|
|
</select>
|
|
|
|
<select id="selectShopByCompany" resultType="com.kiisoo.ic.store.entity.PoiStore">
|
|
|
|
select t3.id,t3.name
|
|
|
|
from privilage_organizational_domain t1,
|
|
|
|
privilage_domain_entity t2,
|
|
|
|
poi_store t3
|
|
|
|
where t1.domain_id = t2.domain_id
|
|
|
|
and t2.entity_id = t3.id
|
|
|
|
and t2.type = 3
|
|
|
|
and t1.org_id = #{orgId}
|
|
|
|
</select>
|
|
|
|
<select id="selectSellerByShop" resultType="com.kiisoo.ic.system.entity.PrivilageUserDO">
|
|
|
|
select t2.id ,t2.name
|
|
|
|
from poi_store_staff t1,
|
|
|
|
privilage_user t2
|
|
|
|
where t1.user_id = t2.id
|
|
|
|
and t1.store_id = #{shopId}
|
|
|
|
</select>
|
|
|
|
<select id="selectStoreQrCode" resultType="java.lang.String">
|
|
|
|
select t2.qr_code as qrCode
|
|
|
|
from privilage_cp_user_store t1,privilage_cp_user t2
|
|
|
|
where t1.cp_user_id = t2.id
|
|
|
|
and t1.store_id = #{shopId}
|
|
|
|
limit 1
|
|
|
|
</select>
|
|
|
|
<select id="selectShopByNameOrCode" resultType="com.kiisoo.ic.store.entity.PoiStore">
|
|
|
|
select t1.id,t1.name,t1.type,t1.code from poi_store t1
|
|
|
|
<if test="name != null and name != ''">
|
|
|
|
where (t1.name LIKE CONCAT('%',#{name},'%') OR t1.code LIKE
|
|
|
|
CONCAT('%',#{name},'%'))
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
</mapper>
|