Compare commits
2 Commits
fe766a4b3e
...
6c3d3505cf
| Author | SHA1 | Date |
|---|---|---|
|
|
6c3d3505cf | 4 days ago |
|
|
c9491f75e7 | 4 days ago |
5 changed files with 306 additions and 1 deletions
@ -0,0 +1,13 @@
|
||||
package com.biutag.supervision.mapper; |
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.biutag.supervision.pojo.entity.mailbox.MailSource; |
||||
|
||||
/** |
||||
* @author |
||||
* @date |
||||
*/ |
||||
@DS("mailbox") |
||||
public interface MailSourceMapper extends BaseMapper<MailSource> { |
||||
} |
||||
@ -0,0 +1,116 @@
|
||||
package com.biutag.supervision.pojo.entity.mailbox; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import io.swagger.v3.oas.annotations.media.Schema; |
||||
import lombok.Getter; |
||||
import lombok.Setter; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
import java.time.LocalDateTime; |
||||
|
||||
/** |
||||
* @ClassName MailSource |
||||
* @Description 信件源数据 |
||||
* @Author |
||||
* @Date |
||||
*/ |
||||
@Accessors(chain = true) |
||||
@Getter |
||||
@Setter |
||||
@Schema(description = "信件源数据") |
||||
@TableName("mail_source") |
||||
public class MailSource { |
||||
|
||||
@Schema(description = "主键ID") |
||||
@TableId |
||||
@TableField("id") |
||||
private String id; |
||||
|
||||
@Schema(description = "联系人姓名") |
||||
@TableField("contact_name") |
||||
private String contactName; |
||||
|
||||
@Schema(description = "联系人性别") |
||||
@TableField("contact_sex") |
||||
private String contactSex; |
||||
|
||||
@Schema(description = "联系人身份证号") |
||||
@TableField("contact_id_card") |
||||
private String contactIdCard; |
||||
|
||||
@Schema(description = "联系人手机号") |
||||
@TableField("contact_phone") |
||||
private String contactPhone; |
||||
|
||||
@Schema(description = "案件编号") |
||||
@TableField("case_number") |
||||
private String caseNumber; |
||||
|
||||
@Schema(description = "内容") |
||||
@TableField("content") |
||||
private String content; |
||||
|
||||
@Schema(description = "附件") |
||||
@TableField("attachments") |
||||
private String attachments; |
||||
|
||||
@Schema(description = "创建时间") |
||||
@TableField("create_time") |
||||
private LocalDateTime createTime; |
||||
|
||||
@Schema(description = "更新时间") |
||||
@TableField("update_time") |
||||
private LocalDateTime updateTime; |
||||
|
||||
@Schema(description = "来源") |
||||
@TableField("source") |
||||
private String source; |
||||
|
||||
@Schema(description = "状态") |
||||
@TableField("state") |
||||
private String state; |
||||
|
||||
@Schema(description = "信件ID") |
||||
@TableField("mail_id") |
||||
private String mailId; |
||||
|
||||
@Schema(description = "来信时间") |
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@TableField("mail_time") |
||||
private LocalDateTime mailTime; |
||||
|
||||
@Schema(description = "信件类别") |
||||
@TableField("mail_type") |
||||
private String mailType; |
||||
|
||||
@Schema(description = "涉及单位ID") |
||||
@TableField("involved_dept_id") |
||||
private Integer involvedDeptId; |
||||
|
||||
@Schema(description = "涉及单位名称") |
||||
@TableField("involved_dept_name") |
||||
private String involvedDeptName; |
||||
|
||||
@Schema(description = "签收标识") |
||||
@TableField("sign_flag") |
||||
private Boolean signFlag; |
||||
|
||||
@Schema(description = "AI判断状态") |
||||
@TableField("ai_determine_state") |
||||
private String aiDetermineState; |
||||
|
||||
@Schema(description = "AI判断数量") |
||||
@TableField("ai_determine_total") |
||||
private Integer aiDetermineTotal; |
||||
|
||||
@Schema(description = "是否复核") |
||||
@TableField("revisit") |
||||
private Boolean revisit; |
||||
|
||||
@Schema(description = "数据来源平台") |
||||
@TableField("data_source_platform") |
||||
private String dataSourcePlatform; |
||||
} |
||||
@ -0,0 +1,67 @@
|
||||
package com.biutag.supervision.pojo.param; |
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
||||
import lombok.Getter; |
||||
import lombok.Setter; |
||||
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
import java.util.Set; |
||||
|
||||
/** |
||||
* @ClassName MailSourceQueryParam |
||||
* @Description 信件源数据查询参数 |
||||
* @Author |
||||
* @Date |
||||
*/ |
||||
@Getter |
||||
@Setter |
||||
@Schema(description = "信件源数据查询参数") |
||||
public class MailSourceQueryParam extends BasePage { |
||||
|
||||
@Schema(description = "主键") |
||||
private String id; |
||||
|
||||
@Schema(description = "主键集合") |
||||
private Set<String> ids; |
||||
|
||||
@Schema(description = "信件表ID") |
||||
private String mailId; |
||||
|
||||
@Schema(description = "信件表ID集合") |
||||
private Set<String> mailIds; |
||||
|
||||
@Schema(description = "联系人姓名") |
||||
private String contactName; |
||||
|
||||
@Schema(description = "联系人手机号") |
||||
private String contactPhone; |
||||
|
||||
@Schema(description = "案件编号") |
||||
private String caseNumber; |
||||
|
||||
@Schema(description = "来源") |
||||
private String source; |
||||
|
||||
@Schema(description = "状态") |
||||
private String state; |
||||
|
||||
@Schema(description = "信件类别") |
||||
private String mailType; |
||||
|
||||
@Schema(description = "涉及单位ID") |
||||
private Integer involvedDeptId; |
||||
|
||||
@Schema(description = "AI判断状态") |
||||
private String aiDetermineState; |
||||
|
||||
@Schema(description = "创建时间") |
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
private List<Date> createTime = new ArrayList<>(); |
||||
|
||||
@Schema(description = "来信时间") |
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
private List<Date> mailTime = new ArrayList<>(); |
||||
} |
||||
@ -0,0 +1,87 @@
|
||||
package com.biutag.supervision.repository.mail; |
||||
|
||||
import cn.hutool.core.collection.CollectionUtil; |
||||
import cn.hutool.core.util.StrUtil; |
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.biutag.supervision.mapper.MailSourceMapper; |
||||
import com.biutag.supervision.pojo.entity.mailbox.MailSource; |
||||
import com.biutag.supervision.pojo.param.MailSourceQueryParam; |
||||
import com.biutag.supervision.repository.base.BaseDAO; |
||||
import jakarta.annotation.Resource; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.Collections; |
||||
import java.util.List; |
||||
import java.util.Objects; |
||||
|
||||
/** |
||||
* @ClassName MailSourceResourceService |
||||
* @Description 信件源数据资源层 |
||||
* @Author |
||||
* @Date |
||||
*/ |
||||
@Service |
||||
public class MailSourceResourceService extends BaseDAO { |
||||
|
||||
@Resource |
||||
private MailSourceMapper mailSourceMapper; |
||||
|
||||
public List<MailSource> query(MailSourceQueryParam param) { |
||||
LambdaQueryWrapper<MailSource> queryWrapper = new LambdaQueryWrapper<>(); |
||||
setBatchQuery(param.getMailId(), param.getMailIds(), queryWrapper, MailSource::getMailId); |
||||
queryWrapper.eq(StrUtil.isNotBlank(param.getId()), MailSource::getId, param.getId()); |
||||
queryWrapper.in(CollectionUtil.isNotEmpty(param.getIds()), MailSource::getId, param.getIds()); |
||||
queryWrapper.eq(StrUtil.isNotBlank(param.getContactPhone()), MailSource::getContactPhone, param.getContactPhone()); |
||||
queryWrapper.eq(StrUtil.isNotBlank(param.getCaseNumber()), MailSource::getCaseNumber, param.getCaseNumber()); |
||||
queryWrapper.eq(StrUtil.isNotBlank(param.getState()), MailSource::getState, param.getState()); |
||||
queryWrapper.eq(StrUtil.isNotBlank(param.getSource()), MailSource::getSource, param.getSource()); |
||||
queryWrapper.eq(StrUtil.isNotBlank(param.getMailType()), MailSource::getMailType, param.getMailType()); |
||||
queryWrapper.eq(StrUtil.isNotBlank(param.getAiDetermineState()), MailSource::getAiDetermineState, param.getAiDetermineState()); |
||||
queryWrapper.eq(Objects.nonNull(param.getInvolvedDeptId()), MailSource::getInvolvedDeptId, param.getInvolvedDeptId()); |
||||
queryWrapper.eq(StrUtil.isNotBlank(param.getContactName()), MailSource::getContactName, param.getContactName()); |
||||
if (!param.getMailTime().isEmpty() && param.getMailTime().size() >= 2) { |
||||
queryWrapper.between(MailSource::getMailTime, param.getMailTime().get(0), param.getMailTime().get(1)); |
||||
} |
||||
if (!param.getCreateTime().isEmpty() && param.getCreateTime().size() >= 2) { |
||||
queryWrapper.between(MailSource::getCreateTime, param.getCreateTime().get(0), param.getCreateTime().get(1)); |
||||
} |
||||
if (queryWrapper.getExpression() == null || queryWrapper.getExpression().getSqlSegment().isEmpty()) { |
||||
return Collections.emptyList(); |
||||
} |
||||
return mailSourceMapper.selectList(queryWrapper); |
||||
} |
||||
|
||||
public long count(MailSourceQueryParam param) { |
||||
LambdaQueryWrapper<MailSource> queryWrapper = new LambdaQueryWrapper<>(); |
||||
queryWrapper.eq(StrUtil.isNotBlank(param.getId()), MailSource::getId, param.getId()); |
||||
queryWrapper.in(CollectionUtil.isNotEmpty(param.getIds()), MailSource::getId, param.getIds()); |
||||
queryWrapper.eq(StrUtil.isNotBlank(param.getContactPhone()), MailSource::getContactPhone, param.getContactPhone()); |
||||
queryWrapper.eq(StrUtil.isNotBlank(param.getState()), MailSource::getState, param.getState()); |
||||
queryWrapper.eq(StrUtil.isNotBlank(param.getMailType()), MailSource::getMailType, param.getMailType()); |
||||
if (CollectionUtil.isNotEmpty(param.getCreateTime()) && param.getCreateTime().size() >= 2) { |
||||
queryWrapper.between(MailSource::getCreateTime, param.getCreateTime().get(0), param.getCreateTime().get(1)); |
||||
} |
||||
if (CollectionUtil.isNotEmpty(param.getMailTime()) && param.getMailTime().size() >= 2) { |
||||
queryWrapper.between(MailSource::getMailTime, param.getMailTime().get(0), param.getMailTime().get(1)); |
||||
} |
||||
return mailSourceMapper.selectCount(queryWrapper); |
||||
} |
||||
|
||||
public Page<MailSource> page(MailSourceQueryParam param) { |
||||
LambdaQueryWrapper<MailSource> queryWrapper = new LambdaQueryWrapper<>(); |
||||
queryWrapper.eq(StrUtil.isNotBlank(param.getId()), MailSource::getId, param.getId()); |
||||
queryWrapper.in(CollectionUtil.isNotEmpty(param.getIds()), MailSource::getId, param.getIds()); |
||||
queryWrapper.eq(StrUtil.isNotBlank(param.getContactPhone()), MailSource::getContactPhone, param.getContactPhone()); |
||||
queryWrapper.eq(StrUtil.isNotBlank(param.getCaseNumber()), MailSource::getCaseNumber, param.getCaseNumber()); |
||||
queryWrapper.eq(StrUtil.isNotBlank(param.getState()), MailSource::getState, param.getState()); |
||||
queryWrapper.eq(StrUtil.isNotBlank(param.getSource()), MailSource::getSource, param.getSource()); |
||||
queryWrapper.eq(StrUtil.isNotBlank(param.getMailType()), MailSource::getMailType, param.getMailType()); |
||||
queryWrapper.eq(StrUtil.isNotBlank(param.getContactName()), MailSource::getContactName, param.getContactName()); |
||||
if (!param.getMailTime().isEmpty() && param.getMailTime().size() >= 2) { |
||||
queryWrapper.between(MailSource::getMailTime, param.getMailTime().get(0), param.getMailTime().get(1)); |
||||
} |
||||
queryWrapper.orderByDesc(MailSource::getCreateTime); |
||||
return mailSourceMapper.selectPage(new Page<>(param.getCurrent(), param.getSize()), queryWrapper); |
||||
} |
||||
} |
||||
Loading…
Reference in new issue