0318-海宁菜单调整+北仑客群部分开发
This commit is contained in:
@@ -121,4 +121,30 @@
|
||||
WHERE sec_grid_id = #{gridId}
|
||||
AND cust_type = #{custType}
|
||||
</select>
|
||||
|
||||
<!-- 根据网格ID列表查询所有客户(一级或二级网格) -->
|
||||
<select id="selectAllCustByGridIds" resultType="RegionCustUser">
|
||||
SELECT DISTINCT cust_id, cust_name, cust_type
|
||||
FROM grid_region_cust_user_${headId}
|
||||
WHERE (top_grid_id IN
|
||||
<foreach collection="gridIds" item="gridId" index="index" open="(" separator="," close=")">
|
||||
#{gridId}
|
||||
</foreach>
|
||||
OR sec_grid_id IN
|
||||
<foreach collection="gridIds" item="gridId" index="index" open="(" separator="," close=")">
|
||||
#{gridId}
|
||||
</foreach>)
|
||||
</select>
|
||||
|
||||
<!-- 根据绘制网格ID查询所有客户(用于客群导入,直接拼接headId绕过拦截器) -->
|
||||
<select id="selectCustByDrawGridId" resultType="RegionCustUser">
|
||||
SELECT DISTINCT
|
||||
sc.cust_id,
|
||||
sc.cust_name,
|
||||
sc.cust_type
|
||||
FROM grid_draw_shape_relate sr
|
||||
LEFT JOIN draw_shape_cust_${headId} sc ON sc.shape_id = sr.shape_id
|
||||
WHERE sr.grid_id = #{gridId}
|
||||
AND sr.delete_flag = '0'
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -339,4 +339,26 @@
|
||||
<select id="getSecGridIdByTopGridId" resultType="Long">
|
||||
select grid_id from grid_region_grid where parent_grid_id = #{gridId} and grid_level = '2' and delete_flag = '0'
|
||||
</select>
|
||||
|
||||
<!-- 查询地理网格列表(简化版)- 专用于客群创建 -->
|
||||
<select id="getRegionGridListForGroup" parameterType="RegionGridListDTO" resultType="RegionGridGroupVO">
|
||||
select distinct a.grid_id, a.grid_name
|
||||
from grid_region_grid a
|
||||
left join grid_region_user_relate c on c.grid_id = a.grid_id
|
||||
where a.delete_flag = '0'
|
||||
and c.delete_flag = '0'
|
||||
and a.grid_level = #{gridLevel}
|
||||
and (a.dept_id in (select dept_id from sys_dept where dept_id = #{deptId} or find_in_set(#{deptId}, ancestors))
|
||||
or c.relate_dept_id in (select dept_id from sys_dept where dept_id = #{deptId} or find_in_set(#{deptId}, ancestors)))
|
||||
<if test="opsDept != null and opsDept != ''">
|
||||
and a.ops_dept = #{opsDept}
|
||||
</if>
|
||||
<if test="gridDutyType != null and gridDutyType != ''">
|
||||
and a.grid_duty_type = #{gridDutyType}
|
||||
</if>
|
||||
<if test="gridName != null and gridName != ''">
|
||||
and a.grid_name like concat('%', #{gridName}, '%')
|
||||
</if>
|
||||
ORDER BY a.grid_name
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user