You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bsdgy-server/src/main/resources/mapper/RetailCompanyMapper.xml

38 lines
1.2 KiB
XML

6 years ago
<?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="java.lang.Long">
select t3.entity_id
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 t3.user_id
from privilage_organizational t1,
privilage_organizational_member t2,
poi_store_staff t3
where t1.id = t2.id
and t2.user_id = t3.user_id
<if test="orgId != null">
and t1.id = #{orgId}
</if>
<if test="shopId != null">
and t3.store_id = #{shopId}
</if>
<if test="shopId != null">
and t3.user_id = #{sellerId}
</if>
</select>
</mapper>