|
|
|
@ -48,7 +48,31 @@
|
|
|
|
|
and t2.entity_id = t3.id
|
|
|
|
|
and t2.type = 3
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectDTOBatchIds" resultType="com.kiisoo.ic.store.bean.PoiStoreDTO">
|
|
|
|
|
SELECT
|
|
|
|
|
t.*,
|
|
|
|
|
t1.domain_id,
|
|
|
|
|
t2.org_id AS company_id,
|
|
|
|
|
t3.parent_id
|
|
|
|
|
FROM
|
|
|
|
|
poi_store t
|
|
|
|
|
LEFT JOIN privilage_domain_entity t1 ON t.id = t1.entity_id
|
|
|
|
|
LEFT JOIN privilage_organizational_domain t2 ON t1.domain_id = t2.domain_id
|
|
|
|
|
LEFT JOIN privilage_organizational t3 ON t2.org_id = t3.id
|
|
|
|
|
WHERE
|
|
|
|
|
1 = 1
|
|
|
|
|
<choose>
|
|
|
|
|
<when test="shopIds != null and shopIds.size > 0">
|
|
|
|
|
and t.id in
|
|
|
|
|
<foreach collection="shopIds" index="index" item="item" open="(" separator="," close=")">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
</when>
|
|
|
|
|
<otherwise>
|
|
|
|
|
and 1 = 0
|
|
|
|
|
</otherwise>
|
|
|
|
|
</choose>
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectCustomerShopByCompany" resultType="com.kiisoo.ic.store.entity.PoiStore">
|
|
|
|
|
select t3.id,t3.name
|
|
|
|
|
from privilage_organizational t,
|
|
|
|
@ -76,7 +100,7 @@
|
|
|
|
|
<choose>
|
|
|
|
|
<when test="customerIds != null and customerIds.size > 0">
|
|
|
|
|
and t1.org_id in
|
|
|
|
|
<foreach collection="customerIds" index="index" item="item" open="(" separator="," close=")">
|
|
|
|
|
<foreach collection="customerIds" index="index" item="item" open="(" separator="," close=")">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
</when>
|
|
|
|
@ -105,7 +129,7 @@
|
|
|
|
|
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},'%'))
|
|
|
|
|
CONCAT('%',#{name},'%'))
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
@ -130,46 +154,45 @@
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectShopByCustomerIdAndStore" resultType="com.kiisoo.ic.store.entity.PoiStore">
|
|
|
|
|
select t3.id,t3.name,t3.code
|
|
|
|
|
from privilage_organizational_domain t1 join privilage_domain_entity t2 on t1.domain_id = t2.domain_id and t2.type = 3
|
|
|
|
|
from privilage_organizational_domain t1 join privilage_domain_entity t2 on t1.domain_id = t2.domain_id and
|
|
|
|
|
t2.type = 3
|
|
|
|
|
|
|
|
|
|
join poi_store t3 on t2.entity_id = t3.id
|
|
|
|
|
|
|
|
|
|
<where>
|
|
|
|
|
<if test="null != storeId and storeId != 0">
|
|
|
|
|
and t2.entity_id = #{storeId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="null != code and code != ''">
|
|
|
|
|
and (t3.name LIKE CONCAT('%',#{code},'%') OR t3.code LIKE
|
|
|
|
|
CONCAT('%',#{code},'%'))
|
|
|
|
|
</if>
|
|
|
|
|
<if test="customerIds != null and customerIds.size > 0">
|
|
|
|
|
and t1.org_id in
|
|
|
|
|
<foreach collection="customerIds" index="index" item="item" open="(" separator="," close=")">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
</where>
|
|
|
|
|
|
|
|
|
|
<where>
|
|
|
|
|
<if test="null != storeId and storeId != 0">
|
|
|
|
|
and t2.entity_id = #{storeId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="null != code and code != ''">
|
|
|
|
|
and (t3.name LIKE CONCAT('%',#{code},'%') OR t3.code LIKE
|
|
|
|
|
CONCAT('%',#{code},'%'))
|
|
|
|
|
</if>
|
|
|
|
|
<if test="customerIds != null and customerIds.size > 0">
|
|
|
|
|
and t1.org_id in
|
|
|
|
|
<foreach collection="customerIds" index="index" item="item" open="(" separator="," close=")">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
</where>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <choose>-->
|
|
|
|
|
<!-- <when test="customerIds != null and customerIds.size > 0">-->
|
|
|
|
|
<!-- and t1.org_id in-->
|
|
|
|
|
<!-- <foreach collection= <foreaindex="index" item <foreaindex="index" ite," close=")">-->
|
|
|
|
|
<!-- #{item}-->
|
|
|
|
|
<!-- </foreach>-->
|
|
|
|
|
<!-- </when>-->
|
|
|
|
|
<!-- <otherwise>-->
|
|
|
|
|
<!-- and 0 = 0-->
|
|
|
|
|
<!-- </otherwise>-->
|
|
|
|
|
<!-- </choose>-->
|
|
|
|
|
<!-- <if test="customerIds != null and customerIds.size > 0">-->
|
|
|
|
|
<!-- and t1.org_id in-->
|
|
|
|
|
<!-- <foreach collection="customerIds" index="index"="customerIds" index="index"="customerIds" index separator="," close=")">-->
|
|
|
|
|
<!-- #{reach>-->
|
|
|
|
|
<!-- </if>-->
|
|
|
|
|
<!-- <choose>-->
|
|
|
|
|
<!-- <when test="customerIds != null and customerIds.size > 0">-->
|
|
|
|
|
<!-- and t1.org_id in-->
|
|
|
|
|
<!-- <foreach collection= <foreaindex="index" item <foreaindex="index" ite," close=")">-->
|
|
|
|
|
<!-- #{item}-->
|
|
|
|
|
<!-- </foreach>-->
|
|
|
|
|
<!-- </when>-->
|
|
|
|
|
<!-- <otherwise>-->
|
|
|
|
|
<!-- and 0 = 0-->
|
|
|
|
|
<!-- </otherwise>-->
|
|
|
|
|
<!-- </choose>-->
|
|
|
|
|
<!-- <if test="customerIds != null and customerIds.size > 0">-->
|
|
|
|
|
<!-- and t1.org_id in-->
|
|
|
|
|
<!-- <foreach collection="customerIds" index="index"="customerIds" index="index"="customerIds" index separator="," close=")">-->
|
|
|
|
|
<!-- #{reach>-->
|
|
|
|
|
<!-- </if>-->
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|