0318-海宁菜单调整+北仑客群部分开发
This commit is contained in:
@@ -193,7 +193,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
and status = #{status}
|
||||
</if>
|
||||
<if test="alterType != null and alterType != ''">
|
||||
and alter_type LIKE CONCAT('%', #{alterType}, '%')
|
||||
and alter_type = #{alterType}
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc, status asc
|
||||
@@ -232,7 +232,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
and wr.status = #{status}
|
||||
</if>
|
||||
<if test="alterType != null and alterType != ''">
|
||||
and wr.alter_type LIKE CONCAT('%', #{alterType}, '%')
|
||||
and wr.alter_type = #{alterType}
|
||||
</if>
|
||||
<!-- "走访异常提醒"类型直接通过用户名匹配,其他类型按角色权限处理 -->
|
||||
and ((wr.alter_type = '走访异常提醒' and wr.user_name = #{username}) or
|
||||
@@ -268,4 +268,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="selectAlterTypes" resultType="string">
|
||||
select distinct alter_type
|
||||
from work_record
|
||||
where is_alter = 1
|
||||
and alter_type is not null
|
||||
and alter_type != ''
|
||||
and left(user_name, 3) = #{headId}
|
||||
order by alter_type
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -505,4 +505,26 @@
|
||||
where manager_id is not null
|
||||
</select>
|
||||
|
||||
<!-- 根据网格类型和总行ID查询客户经理列表 -->
|
||||
<select id="getManagerListByGridType" resultType="java.util.HashMap">
|
||||
select distinct user_name as userName, nick_name as nickName
|
||||
from grid_cmpm_${gridType}_${headId}
|
||||
where user_name is not null
|
||||
order by user_name
|
||||
</select>
|
||||
|
||||
<!-- 根据网格类型、总行ID和客户经理查询客户列表(分表查询,适用于客群导入)-->
|
||||
<select id="getCustomerListForImport" resultType="GridCmpmVO">
|
||||
select cust_id, cust_name, cust_type, cust_idc, usci
|
||||
from grid_cmpm_${gridType}_${headId}
|
||||
where user_name = #{userName}
|
||||
</select>
|
||||
|
||||
<!-- 根据网格类型、总行ID和客户经理流式查询客户列表(使用Cursor,适用于大数据量场景)-->
|
||||
<select id="getCustomerListForImportCursor" resultType="GridCmpmVO" fetchSize="1000">
|
||||
select cust_id, cust_name, cust_type, cust_idc, usci
|
||||
from grid_cmpm_${gridType}_${headId}
|
||||
where user_name = #{userName}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -55,8 +55,17 @@
|
||||
<if test="custName != null and custName != ''">AND b.cust_name like concat('%', #{custName}, '%')</if>
|
||||
<if test="custType != null and custType != ''">AND b.cust_type = #{custType}</if>
|
||||
</select>
|
||||
<select id="">
|
||||
|
||||
<!-- 根据绘制网格ID查询所有客户(用于客群导入,直接拼接headId绕过拦截器) -->
|
||||
<select id="selectCustByDrawGridId" resultType="com.ruoyi.ibs.grid.domain.entity.RegionCustUser">
|
||||
SELECT DISTINCT
|
||||
sc.cust_id,
|
||||
sc.cust_name,
|
||||
sc.cust_type
|
||||
FROM grid_draw_shape_relate sr
|
||||
INNER 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>
|
||||
@@ -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