Commit 8f5b37ed by 林永健

refactor(digitalmanagement): 优化用户模板查询排除指定模板

- 在 DigitalManagementTemplateMapper 接口中增加 excludeTempCode 参数用于排除模板编码
- 修改对应 XML 映射文件,支持排除指定模板编码的查询条件
- 调整 DigitalManagementTemplateService 中区域运营角色的模板查询逻辑,排除轻改日报模板
- 增强查询灵活性,避免返回不需要的模板数据
1 parent e474257e
...@@ -24,7 +24,7 @@ public interface DigitalManagementTemplateMapper extends OreMapper<DigitalManage ...@@ -24,7 +24,7 @@ public interface DigitalManagementTemplateMapper extends OreMapper<DigitalManage
* @param date * @param date
* @return * @return
*/ */
DigitalManagementTemplate queryUserTemplate(@Param("uuid") String uuid, @Param("date") Date date); DigitalManagementTemplate queryUserTemplate(@Param("uuid") String uuid, @Param("date") Date date, @Param("excludeTempCode") String excludeTempCode);
/** /**
* 查找用户指定日期关联的模板 * 查找用户指定日期关联的模板
......
...@@ -514,7 +514,8 @@ public class DigitalManagementTemplateService { ...@@ -514,7 +514,8 @@ public class DigitalManagementTemplateService {
switch (loginRole){ switch (loginRole){
// 区域运营角色,查询圈人 // 区域运营角色,查询圈人
case DigitalManagementConstants.LOGIN_ROLE_REGIONAL_SUPERVISION: case DigitalManagementConstants.LOGIN_ROLE_REGIONAL_SUPERVISION:
DigitalManagementTemplate template = templateMapper.queryUserTemplate(uuid, date); // 排除一下轻改日报模板
DigitalManagementTemplate template = templateMapper.queryUserTemplate(uuid, date, getLightChangeTemplateCode());
if (template == null) { if (template == null) {
return null; return null;
} }
......
...@@ -84,6 +84,9 @@ ...@@ -84,6 +84,9 @@
SELECT r2.template_code as template_code, max(r2.id) as id SELECT r2.template_code as template_code, max(r2.id) as id
FROM digital_management_template_staff_ref r2 FROM digital_management_template_staff_ref r2
where r2.deleted_flag = 'N' where r2.deleted_flag = 'N'
<if test="excludeTempCode != null and excludeTempCode != ''">
and r2.template_code != #{excludeTempCode}
</if>
and r2.effective_date &lt;= date(#{date}) and r2.effective_date &lt;= date(#{date})
group by r2.template_code group by r2.template_code
) temp on temp.template_code = r1.template_code ) temp on temp.template_code = r1.template_code
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!