|
|
|
<?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.generalize.mapper.RetailCompanyMapper">
|
|
|
|
|
|
|
|
<select id="selectShopIdByRetail" resultType="com.kiisoo.ic.generalize.entity.CompanyStoreDO">
|
|
|
|
select t3.entity_id as shopId,t1.name as companyName
|
|
|
|
from privilage_organizational t1,
|
|
|
|
privilage_organizational_domain t2,
|
|
|
|
privilage_domain_entity t3
|
|
|
|
where t1.id = t2.org_id
|
|
|
|
and t2.domain_id = t3.domain_id
|
|
|
|
and t3.type = 3
|
|
|
|
<if test="orgId != null">
|
|
|
|
and t1.id = #{orgId}
|
|
|
|
</if>
|
|
|
|
<if test="shopId != null">
|
|
|
|
and t3.entity_id = #{shopId}
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
<select id="selectSellerIdsByShop" resultType="java.lang.Long">
|
|
|
|
select t4.user_id
|
|
|
|
from privilage_organizational t1,
|
|
|
|
privilage_organizational_domain t2,
|
|
|
|
privilage_domain_entity t3,
|
|
|
|
poi_store_staff t4
|
|
|
|
where t1.id = t2.org_id
|
|
|
|
and t2.domain_id = t3.domain_id
|
|
|
|
and t3.entity_id = t4.store_id
|
|
|
|
and t3.type = 3
|
|
|
|
<if test="orgId != null">
|
|
|
|
and t1.id = #{orgId}
|
|
|
|
</if>
|
|
|
|
<if test="shopId != null">
|
|
|
|
and t4.store_id = #{shopId}
|
|
|
|
</if>
|
|
|
|
<if test="sellerId != null">
|
|
|
|
and t4.user_id = #{sellerId}
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
<select id="selectChildList" resultType="Long">
|
|
|
|
select id from privilage_organizational where
|
|
|
|
<choose>
|
|
|
|
<when test="companys != null and companys.size > 0">
|
|
|
|
parent_id in
|
|
|
|
<foreach collection="companys" item="item" index="index" close=")" open="(" separator=",">
|
|
|
|
#{item}
|
|
|
|
</foreach>
|
|
|
|
</when>
|
|
|
|
<otherwise>
|
|
|
|
1 = 0
|
|
|
|
</otherwise>
|
|
|
|
</choose>
|
|
|
|
|
|
|
|
</select>
|
|
|
|
</mapper>
|