Browse Source

新增非现场执法任务评价消息

main
masiyuan 3 months ago
parent
commit
94f734f300
  1. 65
      zdxt-modules/zdxt-enforcement-nos/src/main/java/com/zdxt/enforcementnos/controller/app/enforcement/NosLawEnforcementCommentMsgController.java
  2. 20
      zdxt-modules/zdxt-enforcement-nos/src/main/java/com/zdxt/enforcementnos/controller/app/enterprise/EntNosLawEnforcementTaskMsgController.java
  3. 5
      zdxt-modules/zdxt-enforcement-nos/src/main/java/com/zdxt/enforcementnos/domain/NosLawEnforcementCommentMsg.java
  4. 100
      zdxt-modules/zdxt-enforcement-nos/src/main/java/com/zdxt/enforcementnos/domain/vo/NosLawEnforcementCommentMsgPageVO.java
  5. 8
      zdxt-modules/zdxt-enforcement-nos/src/main/java/com/zdxt/enforcementnos/domain/vo/NosLawEnforcementTaskDetailVO.java
  6. 11
      zdxt-modules/zdxt-enforcement-nos/src/main/java/com/zdxt/enforcementnos/mapper/NosLawEnforcementCommentMsgMapper.java
  7. 4
      zdxt-modules/zdxt-enforcement-nos/src/main/java/com/zdxt/enforcementnos/quartz/NosLawEnforcementTaskExpiredJob.java
  8. 9
      zdxt-modules/zdxt-enforcement-nos/src/main/java/com/zdxt/enforcementnos/service/NosLawEnforcementCommentMsgService.java
  9. 2
      zdxt-modules/zdxt-enforcement-nos/src/main/java/com/zdxt/enforcementnos/service/NosLawEnforcementTaskMsgService.java
  10. 107
      zdxt-modules/zdxt-enforcement-nos/src/main/java/com/zdxt/enforcementnos/service/impl/NosLawEnforcementCommentMsgServiceImpl.java
  11. 43
      zdxt-modules/zdxt-enforcement-nos/src/main/java/com/zdxt/enforcementnos/service/impl/NosLawEnforcementTaskMsgServiceImpl.java
  12. 3
      zdxt-modules/zdxt-enforcement-nos/src/main/java/com/zdxt/enforcementnos/service/impl/NosLawEnforcementTaskServiceImpl.java
  13. 80
      zdxt-modules/zdxt-enforcement-nos/src/main/resources/mapper/enforcementcode/NosLawEnforcementCommentMsgMapper.xml

65
zdxt-modules/zdxt-enforcement-nos/src/main/java/com/zdxt/enforcementnos/controller/app/enforcement/NosLawEnforcementCommentMsgController.java

@ -0,0 +1,65 @@
package com.zdxt.enforcementnos.controller.app.enforcement;
import com.zdxt.enforcementnos.common.PageParam;
import com.zdxt.enforcementnos.domain.vo.NosLawEnforcementCommentMsgPageVO;
import com.zdxt.enforcementnos.service.NosLawEnforcementCommentMsgService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.dromara.common.core.domain.R;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
* @author msy
* @Date: 2026/6/9
*/
@Tag(name = "执法端 - 非现场执法任务评价消息")
@Validated
@RestController
@RequestMapping("/app-enf/nos-law-enforcement-task/comment-msg")
public class NosLawEnforcementCommentMsgController {
@Resource
private NosLawEnforcementCommentMsgService nosLawEnforcementCommentMsgService;
/**
* 分页查询非现场执法任务评价消息
* @param pageParam 分页参数
* @return TableDataInfo<NosLawEnforcementCommentMsgPageVO>
*/
@Operation(summary = "分页查询非现场执法任务评价消息")
@PostMapping("/page")
public TableDataInfo<NosLawEnforcementCommentMsgPageVO> commentMsgPage(@RequestBody @Valid PageParam pageParam) {
return nosLawEnforcementCommentMsgService.commentMsgPage(pageParam);
}
/**
* 查询未读消息数量
* @return R<Integer>
*/
@Operation(summary = "查询未读消息数量")
@PostMapping("/un-read/count")
public R<Integer> unReadCommentMsgCount() {
return R.ok(nosLawEnforcementCommentMsgService.unReadCommentMsgCount());
}
/**
* 标记消息为已读
* @param msgId 消息id
* @return R<Boolean>
*/
@Operation(summary = "标记消息为已读")
@Parameter(name = "msgId", description = "消息id", required = true)
@GetMapping("/mark-read")
public R<Boolean> markRead(@RequestParam @Valid String msgId) {
return R.ok(nosLawEnforcementCommentMsgService.markRead(msgId));
}
}

20
zdxt-modules/zdxt-enforcement-nos/src/main/java/com/zdxt/enforcementnos/controller/app/enterprise/EntNosLawEnforcementTaskMsgController.java

@ -4,16 +4,14 @@ import com.zdxt.enforcementnos.common.PageParam;
import com.zdxt.enforcementnos.domain.vo.NosLawEnforcementTaskMsgPageVO;
import com.zdxt.enforcementnos.service.NosLawEnforcementTaskMsgService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.dromara.common.core.domain.R;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
* 企业端非现场执法任务消息控制器
@ -50,4 +48,18 @@ public class EntNosLawEnforcementTaskMsgController {
public R<Integer> unReadTaskMsgCount() {
return R.ok(taskMsgService.unReadTaskMsgCount());
}
/**
* 标记消息为已读
* @param msgId 消息id
* @return R<Boolean>
*/
@Operation(summary = "标记消息为已读")
@Parameter(name = "msgId", description = "消息id", required = true)
@GetMapping("/mark-read")
public R<Boolean> markRead(@RequestParam @Valid String msgId) {
return R.ok(taskMsgService.markRead(msgId));
}
}

5
zdxt-modules/zdxt-enforcement-nos/src/main/java/com/zdxt/enforcementnos/domain/NosLawEnforcementCommentMsg.java

@ -34,6 +34,11 @@ public class NosLawEnforcementCommentMsg extends BaseEntity {
*/
private Integer taskType;
/**
* 标题
*/
private String title;
/**
* 企业id
*/

100
zdxt-modules/zdxt-enforcement-nos/src/main/java/com/zdxt/enforcementnos/domain/vo/NosLawEnforcementCommentMsgPageVO.java

@ -0,0 +1,100 @@
package com.zdxt.enforcementnos.domain.vo;
import com.zdxt.enforcementnos.common.LawEnforcer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @author msy
* @Date: 2026/6/9
*/
@Data
public class NosLawEnforcementCommentMsgPageVO {
/**
* id
*/
@Schema(description = "id")
private String id;
/**
* 任务id
*/
@Schema(description = "任务id")
private String taskId;
/**
* 任务类别1-行政检查2-材料备案3-材料验证4-待核实案件
*/
@Schema(description = "任务类别(1-行政检查、2-材料备案、3-材料验证、4-待核实案件)")
private Integer taskType;
/**
* 标题
*/
@Schema(description = "标题")
private String title;
/**
* 企业id
*/
@Schema(description = "企业id")
private String enterpriseId;
/**
* 企业名称
*/
@Schema(description = "企业名称")
private String enterpriseName;
/**
* 执法单位id
*/
@Schema(description = "执法单位id")
private String lawEnforcementAgencyId;
/**
* 执法单位名称
*/
@Schema(description = "执法单位名称")
private String lawEnforcementAgency;
/**
* 执法人员
*/
@Schema(description = "执法人员")
private List<LawEnforcer> lawEnforcer;
/**
* 评价状态0-未评价1-已评价
*/
@Schema(description = "评价状态(0-未评价,1-已评价)")
private Integer commentStatus;
/**
* 评价时间
*/
@Schema(description = "评价时间")
private Date commentTime;
/**
* 办结时间
*/
@Schema(description = "办结时间")
private Date checkTime;
/**
* 创建时间
*/
@Schema(description = "创建时间")
private Date createTime;
/**
* 是否已读
*/
@Schema(description = "是否已读")
private Boolean read;
}

8
zdxt-modules/zdxt-enforcement-nos/src/main/java/com/zdxt/enforcementnos/domain/vo/NosLawEnforcementTaskDetailVO.java

@ -65,6 +65,11 @@ public class NosLawEnforcementTaskDetailVO {
@Schema(description = "执法人员", example = "1")
private List<LawEnforcer> lawEnforcer;
/**
* 类别id
*/
private Integer taskTypeId;
/**
* 类别名称
*/
@ -169,4 +174,7 @@ public class NosLawEnforcementTaskDetailVO {
@Schema(description = "云笔录意见")
private String suggestion;
@Schema(description = "是否创建人")
private Boolean creator;
}

11
zdxt-modules/zdxt-enforcement-nos/src/main/java/com/zdxt/enforcementnos/mapper/NosLawEnforcementCommentMsgMapper.java

@ -1,8 +1,11 @@
package com.zdxt.enforcementnos.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zdxt.enforcementnos.domain.NosLawEnforcementCommentMsg;
import com.zdxt.enforcementnos.domain.vo.NosLawEnforcementCommentMsgPageVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @author msy
@ -10,4 +13,12 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface NosLawEnforcementCommentMsgMapper extends BaseMapper<NosLawEnforcementCommentMsg> {
Page<NosLawEnforcementCommentMsgPageVO> queryCommentMsgPage(Page<NosLawEnforcementCommentMsgPageVO> page,
@Param("userId") Long userId);
Integer unReadCommentMsgCount(@Param("userId") Long userId);
NosLawEnforcementCommentMsg queryCommentMsgByUser(@Param("msgId") String msgId,
@Param("userId") Long userId);
}

4
zdxt-modules/zdxt-enforcement-nos/src/main/java/com/zdxt/enforcementnos/quartz/NosLawEnforcementTaskExpiredJob.java

@ -45,8 +45,8 @@ public class NosLawEnforcementTaskExpiredJob extends QuartzJobBean {
.notIn(NosLawEnforcementTask::getTaskStatus,
Arrays.asList(
NosLawEnforcementTaskStatusEnum.COMPLETED.getCode(),
NosLawEnforcementTaskStatusEnum.COMPLETED_OVERDUE.getCode()),
NosLawEnforcementTaskStatusEnum.PENDING_ON_SITE_DISPOSAL.getCode());
NosLawEnforcementTaskStatusEnum.COMPLETED_OVERDUE.getCode(),
NosLawEnforcementTaskStatusEnum.PENDING_ON_SITE_DISPOSAL.getCode()));
taskService.update(updateWrapper);
}
}

9
zdxt-modules/zdxt-enforcement-nos/src/main/java/com/zdxt/enforcementnos/service/NosLawEnforcementCommentMsgService.java

@ -1,11 +1,20 @@
package com.zdxt.enforcementnos.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zdxt.enforcementnos.common.PageParam;
import com.zdxt.enforcementnos.domain.NosLawEnforcementCommentMsg;
import com.zdxt.enforcementnos.domain.vo.NosLawEnforcementCommentMsgPageVO;
import jakarta.validation.Valid;
import org.dromara.common.mybatis.core.page.TableDataInfo;
/**
* @author msy
* @Date: 2026/6/3
*/
public interface NosLawEnforcementCommentMsgService extends IService<NosLawEnforcementCommentMsg> {
TableDataInfo<NosLawEnforcementCommentMsgPageVO> commentMsgPage(@Valid PageParam pageParam);
Integer unReadCommentMsgCount();
Boolean markRead(@Valid String msgId);
}

2
zdxt-modules/zdxt-enforcement-nos/src/main/java/com/zdxt/enforcementnos/service/NosLawEnforcementTaskMsgService.java

@ -15,4 +15,6 @@ public interface NosLawEnforcementTaskMsgService extends IService<NosLawEnforcem
TableDataInfo<NosLawEnforcementTaskMsgPageVO> unReadTaskMsgPage(@Valid PageParam pageParam);
Integer unReadTaskMsgCount();
Boolean markRead(@Valid String msgId);
}

107
zdxt-modules/zdxt-enforcement-nos/src/main/java/com/zdxt/enforcementnos/service/impl/NosLawEnforcementCommentMsgServiceImpl.java

@ -1,11 +1,29 @@
package com.zdxt.enforcementnos.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zdxt.enforcementnos.common.LawEnforcer;
import com.zdxt.enforcementnos.common.PageParam;
import com.zdxt.enforcementnos.common.commonenum.PlatformTypeEnums;
import com.zdxt.enforcementnos.domain.NosLawEnforcementCommentMsg;
import com.zdxt.enforcementnos.domain.NosLawEnforcementTaskLawEnforcerRelation;
import com.zdxt.enforcementnos.domain.SysMessageViewLog;
import com.zdxt.enforcementnos.domain.vo.NosLawEnforcementCommentMsgPageVO;
import com.zdxt.enforcementnos.mapper.NosLawEnforcementCommentMsgMapper;
import com.zdxt.enforcementnos.service.NosLawEnforcementCommentMsgService;
import com.zdxt.enforcementnos.service.NosLawEnforcementTaskLawEnforcerRelationService;
import com.zdxt.enforcementnos.service.SysMessageViewLogService;
import jakarta.annotation.Resource;
import org.dromara.common.core.exception.ServiceException;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.satoken.utils.LoginHelper;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author msy
* @Date: 2026/6/3
@ -14,4 +32,93 @@ import org.springframework.stereotype.Service;
public class NosLawEnforcementCommentMsgServiceImpl extends ServiceImpl<NosLawEnforcementCommentMsgMapper, NosLawEnforcementCommentMsg>
implements NosLawEnforcementCommentMsgService {
@Resource
private NosLawEnforcementTaskLawEnforcerRelationService taskLawEnforcerRelationService;
@Resource
private SysMessageViewLogService sysMessageViewLogService;
@Override
public TableDataInfo<NosLawEnforcementCommentMsgPageVO> commentMsgPage(PageParam pageParam) {
Long userId = LoginHelper.getUserId();
Page<NosLawEnforcementCommentMsgPageVO> page = new Page<>(pageParam.getPageNo(), pageParam.getPageSize());
page = this.baseMapper.queryCommentMsgPage(page, userId);
List<NosLawEnforcementCommentMsgPageVO> records = page.getRecords();
if(!records.isEmpty()) {
List<String> taskIdList = records.stream().map(NosLawEnforcementCommentMsgPageVO::getTaskId).toList();
// 查询执法人员
LambdaQueryWrapper<NosLawEnforcementTaskLawEnforcerRelation> relationLambdaQueryWrapper = new LambdaQueryWrapper<>();
relationLambdaQueryWrapper
.in(NosLawEnforcementTaskLawEnforcerRelation::getTaskId, taskIdList);
List<NosLawEnforcementTaskLawEnforcerRelation> relationList = taskLawEnforcerRelationService.list(relationLambdaQueryWrapper);
Map<String, List<NosLawEnforcementTaskLawEnforcerRelation>> relationMap = relationList.stream()
.collect(Collectors.groupingBy(NosLawEnforcementTaskLawEnforcerRelation::getTaskId));
// 查询当前用户是否已读
LambdaQueryWrapper<SysMessageViewLog> sysMessageViewLogLambdaQueryWrapper = new LambdaQueryWrapper<>();
sysMessageViewLogLambdaQueryWrapper
.eq(SysMessageViewLog::getCreateBy, userId)
.eq(SysMessageViewLog::getPlatformType, PlatformTypeEnums.ENFORCEMENT.getKey())
.in(SysMessageViewLog::getSourceId, taskIdList);
List<SysMessageViewLog> list = sysMessageViewLogService.list(sysMessageViewLogLambdaQueryWrapper);
Map<String, Boolean> readMap = list.stream()
.collect(Collectors.toMap(SysMessageViewLog::getSourceId, item -> true));
for (NosLawEnforcementCommentMsgPageVO record : records) {
List<NosLawEnforcementTaskLawEnforcerRelation> relations = relationMap.get(record.getTaskId());
if (relations != null) {
record.setLawEnforcer(relations.stream().map(item -> {
LawEnforcer user = new LawEnforcer();
user.setLawEnforcerId(item.getLawEnforcerId());
user.setLawEnforcerName(item.getLawEnforcerName());
user.setLawEnforcerPhone(item.getLawEnforcerPhone());
user.setLawEnforcerIdCard(item.getLawEnforcerIdCard());
return user;
}).toList());
}
Boolean read = readMap.get(record.getId());
record.setRead(read);
}
}
return TableDataInfo.build(page);
}
@Override
public Integer unReadCommentMsgCount() {
Long userId = LoginHelper.getUserId();
if(userId == null) {
throw new ServiceException("当前用户未登录");
}
return this.baseMapper.unReadCommentMsgCount(userId);
}
@Override
public Boolean markRead(String msgId) {
Long userId = LoginHelper.getUserId();
NosLawEnforcementCommentMsg msg = this.baseMapper.queryCommentMsgByUser(msgId, userId);
if(msg == null) {
throw new ServiceException("消息不存在");
}
// 先查询该用户是否已读
LambdaQueryWrapper<SysMessageViewLog> sysMessageViewLogLambdaQueryWrapper = new LambdaQueryWrapper<>();
sysMessageViewLogLambdaQueryWrapper
.eq(SysMessageViewLog::getSourceId, msgId)
.eq(SysMessageViewLog::getCreateBy, userId);
long count = sysMessageViewLogService.count(sysMessageViewLogLambdaQueryWrapper);
if(count > 0) {
return true;
}
// 往sys_message_view_log表里新增一条消息和用户的关联数据,代表该用户已读此消息
SysMessageViewLog sysMessageViewLog = new SysMessageViewLog();
sysMessageViewLog.setSourceId(msgId);
sysMessageViewLog.setPlatformType(PlatformTypeEnums.ENFORCEMENT.getKey());
sysMessageViewLog.setSourceType(6);
return sysMessageViewLogService.save(sysMessageViewLog);
}
}

43
zdxt-modules/zdxt-enforcement-nos/src/main/java/com/zdxt/enforcementnos/service/impl/NosLawEnforcementTaskMsgServiceImpl.java

@ -1,13 +1,18 @@
package com.zdxt.enforcementnos.service.impl;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zdxt.enforcementnos.common.PageParam;
import com.zdxt.enforcementnos.common.commonenum.PlatformTypeEnums;
import com.zdxt.enforcementnos.domain.NosLawEnforcementTaskMsg;
import com.zdxt.enforcementnos.domain.SysMessageViewLog;
import com.zdxt.enforcementnos.domain.vo.NosLawEnforcementTaskMsgPageVO;
import com.zdxt.enforcementnos.mapper.NosLawEnforcementTaskMsgMapper;
import com.zdxt.enforcementnos.service.NosLawEnforcementTaskMsgService;
import com.zdxt.enforcementnos.service.SysMessageViewLogService;
import jakarta.annotation.Resource;
import org.dromara.common.core.exception.ServiceException;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.satoken.utils.LoginHelper;
@ -22,6 +27,10 @@ public class NosLawEnforcementTaskMsgServiceImpl extends ServiceImpl<NosLawEnfor
implements NosLawEnforcementTaskMsgService {
@Resource
private SysMessageViewLogService sysMessageViewLogService;
@Override
public TableDataInfo<NosLawEnforcementTaskMsgPageVO> unReadTaskMsgPage(PageParam pageParam) {
Long userId = LoginHelper.getUserId();
@ -53,4 +62,38 @@ public class NosLawEnforcementTaskMsgServiceImpl extends ServiceImpl<NosLawEnfor
return this.baseMapper.unReadTaskMsgCount(userId, enterpriseId);
}
@Override
public Boolean markRead(String msgId) {
Long userId = LoginHelper.getUserId();
String enterpriseId = LoginHelper.getDeptId();
LambdaQueryWrapper<NosLawEnforcementTaskMsg> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper
.eq(NosLawEnforcementTaskMsg::getId, msgId)
.eq(NosLawEnforcementTaskMsg::getEnterpriseId, enterpriseId)
.eq(NosLawEnforcementTaskMsg::getCreateBy, userId);
NosLawEnforcementTaskMsg msg = this.getOne(queryWrapper);
if(msg == null) {
throw new ServiceException("当前用户没有此消息");
}
// 先查询该用户是否已读
LambdaQueryWrapper<SysMessageViewLog> sysMessageViewLogLambdaQueryWrapper = new LambdaQueryWrapper<>();
sysMessageViewLogLambdaQueryWrapper
.eq(SysMessageViewLog::getSourceId, msgId)
.eq(SysMessageViewLog::getCreateBy, userId);
long count = sysMessageViewLogService.count(sysMessageViewLogLambdaQueryWrapper);
if(count > 0) {
return true;
}
// 往sys_message_view_log表里新增一条消息和用户的关联数据,代表该用户已读此消息
SysMessageViewLog sysMessageViewLog = new SysMessageViewLog();
sysMessageViewLog.setSourceId(msgId);
sysMessageViewLog.setPlatformType(PlatformTypeEnums.ENTERPRISE.getKey());
sysMessageViewLog.setSourceType(5);
sysMessageViewLog.setCompanyId(enterpriseId);
return sysMessageViewLogService.save(sysMessageViewLog);
}
}

3
zdxt-modules/zdxt-enforcement-nos/src/main/java/com/zdxt/enforcementnos/service/impl/NosLawEnforcementTaskServiceImpl.java

@ -312,7 +312,7 @@ public class NosLawEnforcementTaskServiceImpl extends ServiceImpl<NosLawEnforcem
vo.setSuggestion(relation.getSuggestion());
}
}
vo.setCreator(Objects.equals(task.getCreateBy(), userId));
return vo;
}
@ -509,6 +509,7 @@ public class NosLawEnforcementTaskServiceImpl extends ServiceImpl<NosLawEnforcem
NosLawEnforcementCommentMsg commentMsg = new NosLawEnforcementCommentMsg();
commentMsg.setTaskId(task.getId());
commentMsg.setTaskType(task.getTaskTypeId());
commentMsg.setTitle(task.getEnterpriseName() + "季度检查");
commentMsg.setEnterpriseId(task.getEnterpriseId());
commentMsg.setEnterpriseName(task.getEnterpriseName());
commentMsg.setLawEnforcementAgencyId(task.getLawEnforcementAgencyId());

80
zdxt-modules/zdxt-enforcement-nos/src/main/resources/mapper/enforcementcode/NosLawEnforcementCommentMsgMapper.xml

@ -0,0 +1,80 @@
<?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.zdxt.enforcementnos.mapper.NosLawEnforcementCommentMsgMapper">
<select id="queryCommentMsgPage"
resultType="com.zdxt.enforcementnos.domain.vo.NosLawEnforcementCommentMsgPageVO">
SELECT
m.id,
m.task_id,
m.task_type,
m.title,
m.enterprise_id,
m.enterprise_name,
m.law_enforcement_agency_id,
m.law_enforcement_agency,
m.comment_status,
m.comment_time,
m.check_time,
m.create_time
FROM nos_law_enforcement_comment_msg m
INNER JOIN nos_law_enforcement_task_law_enforcer_relation r
ON m.task_id = r.task_id
AND r.is_delete = '0'
WHERE m.is_delete = '0'
AND r.law_enforcer_id = #{userId}
ORDER BY m.create_time DESC
</select>
<select id="unReadCommentMsgCount" resultType="java.lang.Integer">
SELECT
count(*)
FROM nos_law_enforcement_comment_msg msg
WHERE msg.is_delete = '0'
AND NOT EXISTS (
SELECT 1
FROM sys_message_view_log log
WHERE log.source_id = msg.id
AND log.create_by = #{userId}
AND log.is_delete = 0
AND log.platform_type = 2
)
</select>
<select id="queryCommentMsgByUser" resultType="com.zdxt.enforcementnos.domain.NosLawEnforcementCommentMsg">
SELECT
m.id,
m.task_id,
m.task_type,
m.title,
m.enterprise_id,
m.enterprise_name,
m.law_enforcement_agency_id,
m.law_enforcement_agency,
m.law_enforcer,
m.comment_status,
m.comment_time,
m.check_time,
m.create_by,
m.create_time,
m.update_by,
m.update_time,
m.is_delete,
m.create_dept,
m.bureau_dept_id,
m.dept_id,
m.organ_id
FROM nos_law_enforcement_comment_msg m
INNER JOIN nos_law_enforcement_task_law_enforcer_relation r
ON m.task_id = r.task_id
AND r.is_delete = '0'
WHERE m.is_delete = '0'
AND m.id = #{msgId}
AND r.law_enforcer_id = #{userId}
LIMIT 1
</select>
</mapper>
Loading…
Cancel
Save