Ver código fonte

智能打标结果相关功能开发

2507040827 5 dias atrás
pai
commit
4ad7c4d7f7
16 arquivos alterados com 1340 adições e 0 exclusões
  1. 108 0
      server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/controller/AitagTagInfoController.java
  2. 118 0
      server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/controller/AitagTagLogController.java
  3. 55 0
      server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/domain/entity/AitagTagDailyAggEntity.java
  4. 190 0
      server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/domain/entity/AitagTagInfoEntity.java
  5. 135 0
      server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/domain/entity/AitagTagLogEntity.java
  6. 171 0
      server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/domain/vo/AitagTagInfoQueryVo.java
  7. 24 0
      server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/mapper/AitagTagDailyAggDao.java
  8. 17 0
      server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/mapper/AitagTagInfoDao.java
  9. 35 0
      server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/mapper/AitagTagLogDao.java
  10. 25 0
      server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/service/AitagTagInfoService.java
  11. 29 0
      server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/service/AitagTagLogService.java
  12. 72 0
      server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/service/impl/AitagTagInfoServiceImpl.java
  13. 196 0
      server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/service/impl/AitagTagLogServiceImpl.java
  14. 37 0
      server/yusp-tagging-core/src/main/resources/mapper/AitagTagDailyAggMapper.xml
  15. 18 0
      server/yusp-tagging-core/src/main/resources/mapper/AitagTagInfoMapper.xml
  16. 110 0
      server/yusp-tagging-core/src/main/resources/mapper/AitagTagLogMapper.xml

+ 108 - 0
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/controller/AitagTagInfoController.java

@@ -0,0 +1,108 @@
+package cn.com.yusys.yusp.controller;
+
+import cn.com.yusys.yusp.commons.module.adapter.web.rest.ResultDto;
+import cn.com.yusys.yusp.domain.entity.AitagTagInfoEntity;
+import cn.com.yusys.yusp.domain.vo.AitagTagInfoQueryVo;
+import cn.com.yusys.yusp.service.AitagTagInfoService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+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.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 
+ *
+ * @author 2507040827
+ * @date 2026-02-26 14:34:56
+ */
+@Api(tags = "")
+@RestController
+@RequestMapping("/api/aitagtaginfo")
+public class AitagTagInfoController {
+    /**
+     * AitagTagInfoService
+     */
+    @Autowired
+    private AitagTagInfoService aitagTagInfoService;
+
+
+    /**
+     * 列表查询
+     *
+     * @param aitagTagInfoQueryVo
+     * @return ResultDto
+     */
+    @ApiOperation("列表查询")
+    @GetMapping("/list")
+    public ResultDto<List<AitagTagInfoEntity>> list(AitagTagInfoQueryVo aitagTagInfoQueryVo) {
+        IPage<AitagTagInfoEntity> page = aitagTagInfoService.queryPage(aitagTagInfoQueryVo);
+
+        return ResultDto.success(page.getRecords()).total(page.getTotal());
+    }
+
+    /**
+     * 详细
+     *
+     * @param id
+     * @return ResultDto
+     */
+    @ApiOperation("详细")
+    @GetMapping("/info/{id}")
+    public ResultDto<AitagTagInfoEntity> info(@PathVariable("id") String id) {
+        AitagTagInfoEntity aitagTagInfo = aitagTagInfoService.getById(id);
+
+        return ResultDto.success(aitagTagInfo);
+    }
+
+    /**
+     * 保存
+     *
+     * @param aitagTagInfoEntity
+     * @return ResultDto
+     */
+    @ApiOperation("保存")
+    @PostMapping("/save")
+    public ResultDto save(@RequestBody AitagTagInfoEntity aitagTagInfoEntity) {
+        aitagTagInfoService.save(aitagTagInfoEntity);
+
+        return ResultDto.success();
+    }
+
+    /**
+     * 修改
+     *
+     * @param aitagTagInfoEntity
+     * @return ResultDto
+     */
+    @ApiOperation("修改")
+    @PostMapping("/update")
+    public ResultDto update(@RequestBody AitagTagInfoEntity aitagTagInfoEntity) {
+        aitagTagInfoService.updateById(aitagTagInfoEntity);
+
+        return ResultDto.success();
+    }
+
+    /**
+     * 删除
+     *
+     * @param ids
+     * @return ResultDto
+     */
+    @ApiOperation("删除")
+    @PostMapping("/delete")
+    public ResultDto delete(@RequestBody String[] ids) {
+        aitagTagInfoService.removeByIds(Arrays.asList(ids));
+
+        return ResultDto.success();
+    }
+
+}

+ 118 - 0
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/controller/AitagTagLogController.java

@@ -0,0 +1,118 @@
+package cn.com.yusys.yusp.controller;
+
+import cn.com.yusys.yusp.commons.module.adapter.web.rest.ResultDto;
+import cn.com.yusys.yusp.domain.entity.AitagTagLogEntity;
+import cn.com.yusys.yusp.domain.vo.*;
+import cn.com.yusys.yusp.service.AitagTagLogService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+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 java.util.Arrays;
+import java.util.List;
+
+/**
+ * 
+ *
+ * @author 2507040827
+ * @date 2026-02-25 14:56:45
+ */
+@Api(tags = "数据概览")
+@RestController
+@RequestMapping("/api/aitagtaglog")
+public class AitagTagLogController {
+    /**
+     * AitagTagLogService
+     */
+    @Autowired
+    private AitagTagLogService aitagTagLogService;
+
+
+    /**
+     * 数据概览
+     *
+     * @param taggingResult 智能打标结果
+     * @return ResultDto
+     */
+    @ApiOperation("数据概览")
+    @PostMapping("/dataOverview")
+    public ResultDto<DataOverviewVo> dataOverview(@RequestBody SmartTaggingResultVo taggingResult) {
+        DataOverviewVo dataOverviewDTO = aitagTagLogService.dataOverview(taggingResult);
+        return ResultDto.success(dataOverviewDTO);
+    }
+
+
+
+    /**
+     * 打标趋势
+     *
+     * @param taggingTrendReq 打标趋势
+     * @return ResultDto
+     */
+    @ApiOperation("打标趋势")
+    @PostMapping("/taggingTrend")
+    public ResultDto<List<IconResVo>> taggingTrend(@RequestBody TaggingTrendReqVo taggingTrendReq) {
+        List<IconResVo> taggingTrendRes = aitagTagLogService.taggingTrend(taggingTrendReq);
+        return ResultDto.success(taggingTrendRes);
+    }
+
+    /**
+     * 标签分布统计
+     *
+     * @param resultDTO 智能打标结果
+     * @return ResultDto
+     */
+    @ApiOperation("标签分布统计")
+    @PostMapping("/tagDistStats")
+    public ResultDto<List<IconResVo>> tagDistStats(@RequestBody TagDistStatsReqVo resultDTO) {
+        List<IconResVo> taggingTrendRes = aitagTagLogService.tagDistStats(resultDTO);
+        return ResultDto.success(taggingTrendRes);
+    }
+
+
+    /**
+     * 打标明细
+     *
+     * @param transactionReqVo
+     * @return ResultDto
+     */
+    @ApiOperation("打标明细")
+    @PostMapping("/taggingTransaction")
+    public ResultDto<IPage<AitagTagLogEntity>> taggingTransaction(@RequestBody TaggingTransactionReqVo transactionReqVo) {
+        IPage<AitagTagLogEntity> page = aitagTagLogService.taggingDetails(transactionReqVo);
+        return ResultDto.success(page);
+    }
+
+    /**
+     * 打标结果详情
+     *
+     * @param id
+     * @return ResultDto
+     */
+    @ApiOperation("打标结果详情")
+    @PostMapping("/show")
+    public ResultDto<AitagTagLogEntity> show(@RequestBody String id) {
+        AitagTagLogEntity taggingDetailsResDTO = aitagTagLogService.show(id);
+        return ResultDto.success(taggingDetailsResDTO);
+    }
+
+    /**
+     * 删除
+     *
+     * @param ids
+     * @return ResultDto
+     */
+    @ApiOperation("删除")
+    @PostMapping("/delete")
+    public ResultDto delete(@RequestBody String[] ids) {
+        aitagTagLogService.removeByIds(Arrays.asList(ids));
+
+        return ResultDto.success();
+    }
+
+}

+ 55 - 0
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/domain/entity/AitagTagDailyAggEntity.java

@@ -0,0 +1,55 @@
+package cn.com.yusys.yusp.domain.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.IdType;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+
+/**
+ * 智能标签按天汇总信息
+ *
+ * @author 2507040827
+ * @date 2026-02-26 11:07:40
+ */
+@TableName("aitag_tag_daily_agg")
+@Data
+@ApiModel(value = "AitagTagDailyAggEntity", description = "智能标签按天汇总信息")
+public class AitagTagDailyAggEntity {
+
+    /**
+     * id
+     **/
+    @ApiModelProperty(value="id")
+    @TableId(type=IdType.UUID)
+    private String id;
+
+    /**
+     * 汇总日期
+     **/
+    @ApiModelProperty(value = "汇总日期")
+    private String aggDate;
+
+    /**
+     * 类别名称
+     **/
+    @ApiModelProperty(value = "标签类别")
+    private String categoryCode;
+
+    /**
+     * 标签名称
+     **/
+    @ApiModelProperty(value = "标签名称")
+    private String tagNm;
+
+    /**
+     * 统计梳理
+     **/
+    @ApiModelProperty(value = "统计梳理")
+    private Integer tagCount;
+
+
+
+}

+ 190 - 0
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/domain/entity/AitagTagInfoEntity.java

@@ -0,0 +1,190 @@
+package cn.com.yusys.yusp.domain.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.IdType;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+
+/**
+ * 
+ *
+ * @author 2507040827
+ * @date 2026-02-26 14:34:56
+ */
+@TableName("aitag_tag_info")
+@ApiModel(value = "AitagTagInfoEntity", description = "")
+public class AitagTagInfoEntity {
+
+    /**
+     * id
+     **/
+    @ApiModelProperty(value="id")
+    @TableId(type=IdType.UUID)
+    private String id;
+
+    /**
+     * 所属大类
+     **/
+    @ApiModelProperty(value = "所属大类")
+    private String categoryId;
+
+    /**
+     * 标签名称
+     **/
+    @ApiModelProperty(value = "标签名称")
+    private String tagNm;
+
+    /**
+     * 标签代码
+     **/
+    @ApiModelProperty(value = "标签代码")
+    private String tagCode;
+
+    /**
+     * 标签备注
+     **/
+    @ApiModelProperty(value = "标签备注")
+    private String tagRemark;
+
+    /**
+     * 父级ID
+     **/
+    @ApiModelProperty(value = "父级ID")
+    private String parentCode;
+
+    /**
+     * 标签规则
+     **/
+    @ApiModelProperty(value = "标签规则")
+    private String reg;
+
+    /**
+     * 标签等级
+     **/
+    @ApiModelProperty(value = "标签等级")
+    private Integer level;
+
+    /**
+     * tag1/tag2/tag3/...
+     **/
+    @ApiModelProperty(value = "tag1/tag2/tag3/...")
+    private String tagPath;
+
+    /**
+     * 0未删除;1删除
+     **/
+    @ApiModelProperty(value = "0未删除;1删除")
+    private Integer isDelete;
+
+    /**
+     * 0 正常;1 停用
+     **/
+    @ApiModelProperty(value = "0 正常;1 停用")
+    private Integer state;
+
+    /**
+     * 标签提示词
+     **/
+    @ApiModelProperty(value = "标签提示词")
+    private String tagPrompt;
+
+
+    public String getId() {
+        return this.id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getCategoryId() {
+        return this.categoryId;
+    }
+
+    public void setCategoryId(String categoryId) {
+        this.categoryId = categoryId;
+    }
+
+    public String getTagNm() {
+        return this.tagNm;
+    }
+
+    public void setTagNm(String tagNm) {
+        this.tagNm = tagNm;
+    }
+
+    public String getTagCode() {
+        return this.tagCode;
+    }
+
+    public void setTagCode(String tagCode) {
+        this.tagCode = tagCode;
+    }
+
+    public String getTagRemark() {
+        return this.tagRemark;
+    }
+
+    public void setTagRemark(String tagRemark) {
+        this.tagRemark = tagRemark;
+    }
+
+    public String getParentCode() {
+        return this.parentCode;
+    }
+
+    public void setParentCode(String parentCode) {
+        this.parentCode = parentCode;
+    }
+
+    public String getReg() {
+        return this.reg;
+    }
+
+    public void setReg(String reg) {
+        this.reg = reg;
+    }
+
+    public Integer getLevel() {
+        return this.level;
+    }
+
+    public void setLevel(Integer level) {
+        this.level = level;
+    }
+
+    public String getTagPath() {
+        return this.tagPath;
+    }
+
+    public void setTagPath(String tagPath) {
+        this.tagPath = tagPath;
+    }
+
+    public Integer getIsDelete() {
+        return this.isDelete;
+    }
+
+    public void setIsDelete(Integer isDelete) {
+        this.isDelete = isDelete;
+    }
+
+    public Integer getState() {
+        return this.state;
+    }
+
+    public void setState(Integer state) {
+        this.state = state;
+    }
+
+    public String getTagPrompt() {
+        return this.tagPrompt;
+    }
+
+    public void setTagPrompt(String tagPrompt) {
+        this.tagPrompt = tagPrompt;
+    }
+
+}

+ 135 - 0
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/domain/entity/AitagTagLogEntity.java

@@ -0,0 +1,135 @@
+package cn.com.yusys.yusp.domain.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.IdType;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+/**
+ * 
+ *
+ * @author 2507040827
+ * @date 2026-02-25 14:56:45
+ */
+
+@Data
+@TableName("aitag_tag_log")
+@ApiModel(value = "AitagTagLogEntity", description = "")
+public class AitagTagLogEntity {
+
+    /**
+     * id
+     **/
+    @ApiModelProperty(value="id")
+    @TableId(type=IdType.UUID)
+    private String id;
+
+    /**
+     * 应用ID
+     **/
+    @ApiModelProperty(value = "应用ID")
+    private String appId;
+
+    /**
+     * 发起时间
+     **/
+    @ApiModelProperty(value = "发起时间")
+    private LocalDateTime insertTime;
+
+    /**
+     * 业务属性,贷款编号
+     **/
+    @ApiModelProperty(value = "业务属性,贷款编号")
+    private String businessAttr;
+
+    /**
+     * 输入短语
+     **/
+    @ApiModelProperty(value = "输入短语")
+    private String phrase;
+
+    /**
+     * 附件名称
+     **/
+    @ApiModelProperty(value = "附件名称")
+    private String attachment;
+
+    /**
+     * 附件路径
+     **/
+    @ApiModelProperty(value = "附件路径")
+    private String attachmentUrl;
+
+    /**
+     * 打标结果,JSON
+[{
+label:xxx,
+label_code:xxx,
+desc:xxx
+passr: true/false
+}]
+     **/
+    @ApiModelProperty(value = "打标结果,JSON [{ label:xxx, label_code:xxx, desc:xxx passr: true/false }]")
+    private String result;
+
+    /**
+     * 反馈人ID
+     **/
+    @ApiModelProperty(value = "反馈人ID")
+    private String feedbackUserId;
+
+    /**
+     * 反馈人名字
+     **/
+    @ApiModelProperty(value = "反馈人名字")
+    private String feedbackUserNm;
+
+    /**
+     * 反馈时间
+     **/
+    @ApiModelProperty(value = "反馈时间")
+    private LocalDateTime feedbackTime;
+
+    /**
+     * 反馈,agree/reject
+     **/
+    @ApiModelProperty(value = "反馈,agree/reject")
+    private String feedback;
+
+    /**
+     * JSON
+[
+{
+ label:xxx,
+ label_code:xxx,
+ desc:xxx
+ passr: true/false
+}
+]
+     **/
+    @ApiModelProperty(value = "JSON [ { label:xxx, label_code:xxx, desc:xxx passr: true/false } ]")
+    private String feedbackResult;
+
+    /**
+     * 0:打标执行中;1:打标完成; 2:客户经理已经确认;3,结果已推送
+     **/
+    @ApiModelProperty(value = "0:打标执行中;1:打标完成; 2:客户经理已经确认;3,结果已推送")
+    private Integer state;
+
+    /**
+     * 打标耗时,秒
+     **/
+    @ApiModelProperty(value = "打标耗时,秒")
+    private String consumingTime;
+
+    /**
+     * 标签类别
+     **/
+    @ApiModelProperty(value = "标签类别")
+    private String categoryCode;
+
+}

+ 171 - 0
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/domain/vo/AitagTagInfoQueryVo.java

@@ -0,0 +1,171 @@
+package cn.com.yusys.yusp.domain.vo;
+
+import cn.com.yusys.yusp.commons.module.adapter.query.PageQuery;
+
+
+/**
+ * 
+ *
+ * @author 2507040827
+ * @date 2026-02-26 14:34:56
+ */
+public class AitagTagInfoQueryVo extends PageQuery {
+
+    /**
+     * id
+     **/
+    private String id;
+
+    /**
+     * 所属大类
+     **/
+    private String categoryId;
+
+    /**
+     * 标签名称
+     **/
+    private String tagNm;
+
+    /**
+     * 标签代码
+     **/
+    private String tagCode;
+
+    /**
+     * 标签备注
+     **/
+    private String tagRemark;
+
+    /**
+     * 父级ID
+     **/
+    private String parentCode;
+
+    /**
+     * 标签规则
+     **/
+    private String reg;
+
+    /**
+     * 标签等级
+     **/
+    private Integer level;
+
+    /**
+     * tag1/tag2/tag3/...
+     **/
+    private String tagPath;
+
+    /**
+     * 0未删除;1删除
+     **/
+    private Integer isDelete;
+
+    /**
+     * 0 正常;1 停用
+     **/
+    private Integer state;
+
+    /**
+     * 标签提示词
+     **/
+    private String tagPrompt;
+
+
+    public String getId() {
+        return this.id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getCategoryId() {
+        return this.categoryId;
+    }
+
+    public void setCategoryId(String categoryId) {
+        this.categoryId = categoryId;
+    }
+
+    public String getTagNm() {
+        return this.tagNm;
+    }
+
+    public void setTagNm(String tagNm) {
+        this.tagNm = tagNm;
+    }
+
+    public String getTagCode() {
+        return this.tagCode;
+    }
+
+    public void setTagCode(String tagCode) {
+        this.tagCode = tagCode;
+    }
+
+    public String getTagRemark() {
+        return this.tagRemark;
+    }
+
+    public void setTagRemark(String tagRemark) {
+        this.tagRemark = tagRemark;
+    }
+
+    public String getParentCode() {
+        return this.parentCode;
+    }
+
+    public void setParentCode(String parentCode) {
+        this.parentCode = parentCode;
+    }
+
+    public String getReg() {
+        return this.reg;
+    }
+
+    public void setReg(String reg) {
+        this.reg = reg;
+    }
+
+    public Integer getLevel() {
+        return this.level;
+    }
+
+    public void setLevel(Integer level) {
+        this.level = level;
+    }
+
+    public String getTagPath() {
+        return this.tagPath;
+    }
+
+    public void setTagPath(String tagPath) {
+        this.tagPath = tagPath;
+    }
+
+    public Integer getIsDelete() {
+        return this.isDelete;
+    }
+
+    public void setIsDelete(Integer isDelete) {
+        this.isDelete = isDelete;
+    }
+
+    public Integer getState() {
+        return this.state;
+    }
+
+    public void setState(Integer state) {
+        this.state = state;
+    }
+
+    public String getTagPrompt() {
+        return this.tagPrompt;
+    }
+
+    public void setTagPrompt(String tagPrompt) {
+        this.tagPrompt = tagPrompt;
+    }
+
+}

+ 24 - 0
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/mapper/AitagTagDailyAggDao.java

@@ -0,0 +1,24 @@
+package cn.com.yusys.yusp.mapper;
+
+import cn.com.yusys.yusp.commons.mybatisplus.mapper.BaseMapper;
+import cn.com.yusys.yusp.domain.vo.IconResVo;
+import cn.com.yusys.yusp.domain.entity.AitagTagDailyAggEntity;
+import cn.com.yusys.yusp.domain.vo.TagDistStatsReqVo;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+
+/**
+ * 智能标签按天汇总信息
+ *
+ * @author 2507040827
+ * @date 2026-02-26 11:07:40
+ */
+
+@Mapper
+public interface AitagTagDailyAggDao extends BaseMapper<AitagTagDailyAggEntity> {
+
+    List<IconResVo> selectTagDistStats(TagDistStatsReqVo taggingResult);
+
+}

+ 17 - 0
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/mapper/AitagTagInfoDao.java

@@ -0,0 +1,17 @@
+package cn.com.yusys.yusp.mapper;
+
+import cn.com.yusys.yusp.commons.mybatisplus.mapper.BaseMapper;
+import cn.com.yusys.yusp.domain.entity.AitagTagInfoEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 
+ *
+ * @author 2507040827
+ * @date 2026-02-26 14:34:56
+ */
+
+@Mapper
+public interface AitagTagInfoDao extends BaseMapper<AitagTagInfoEntity> {
+
+}

+ 35 - 0
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/mapper/AitagTagLogDao.java

@@ -0,0 +1,35 @@
+package cn.com.yusys.yusp.mapper;
+
+import cn.com.yusys.yusp.commons.mybatisplus.mapper.BaseMapper;
+import cn.com.yusys.yusp.domain.vo.IconResVo;
+import cn.com.yusys.yusp.domain.vo.SmartTaggingResultVo;
+import cn.com.yusys.yusp.domain.dto.TagSumDto;
+import cn.com.yusys.yusp.domain.entity.AitagTagLogEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 
+ *
+ * @author 2507040827
+ * @date 2026-02-25 14:56:45
+ */
+
+@Mapper
+public interface AitagTagLogDao extends BaseMapper<AitagTagLogEntity> {
+
+    TagSumDto selectTagCount(SmartTaggingResultVo taggingResult);
+
+
+    List<IconResVo> selectTagReportByDay(SmartTaggingResultVo taggingResult);
+
+
+    List<IconResVo> selectTagReportByMonth(SmartTaggingResultVo taggingResult);
+
+
+    List<IconResVo> selectTagReportByWeek(SmartTaggingResultVo taggingResult);
+
+    List<AitagTagLogEntity> selectByInsertTime(@Param("insertTime") String insertTime);
+}

+ 25 - 0
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/service/AitagTagInfoService.java

@@ -0,0 +1,25 @@
+package cn.com.yusys.yusp.service;
+
+import cn.com.yusys.yusp.domain.entity.AitagTagInfoEntity;
+import cn.com.yusys.yusp.domain.vo.AitagTagInfoQueryVo;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 
+ *
+ * @author 2507040827
+ * @date 2026-02-26 14:34:56
+ */
+
+public interface AitagTagInfoService extends IService<AitagTagInfoEntity> {
+
+    /**
+     * 分页查询
+     *
+     * @param aitagTagInfoQueryVo
+     * @return IPage
+     */
+    IPage<AitagTagInfoEntity> queryPage(AitagTagInfoQueryVo aitagTagInfoQueryVo);
+}
+

+ 29 - 0
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/service/AitagTagLogService.java

@@ -0,0 +1,29 @@
+package cn.com.yusys.yusp.service;
+
+import cn.com.yusys.yusp.domain.entity.AitagTagLogEntity;
+import cn.com.yusys.yusp.domain.vo.*;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+
+/**
+ * 
+ *
+ * @author 2507040827
+ * @date 2026-02-25 14:56:45
+ */
+
+public interface AitagTagLogService extends IService<AitagTagLogEntity> {
+
+    DataOverviewVo dataOverview(SmartTaggingResultVo markingResult);
+
+    List<IconResVo> taggingTrend(TaggingTrendReqVo TaggingTrendReqVo);
+
+    IPage<AitagTagLogEntity> taggingDetails(TaggingTransactionReqVo aitagTagLogEntity);
+
+    AitagTagLogEntity show(String id);
+
+    List<IconResVo> tagDistStats(TagDistStatsReqVo resultDTO);
+}
+

+ 72 - 0
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/service/impl/AitagTagInfoServiceImpl.java

@@ -0,0 +1,72 @@
+package cn.com.yusys.yusp.service.impl;
+
+import cn.com.yusys.yusp.mapper.AitagTagInfoDao;
+import cn.com.yusys.yusp.domain.entity.AitagTagInfoEntity;
+import cn.com.yusys.yusp.domain.vo.AitagTagInfoQueryVo;
+import cn.com.yusys.yusp.service.AitagTagInfoService;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 
+ *
+ * @author 2507040827
+ * @date 2026-02-26 14:34:56
+ */
+
+@Service("aitagTagInfoService")
+public class AitagTagInfoServiceImpl extends ServiceImpl<AitagTagInfoDao, AitagTagInfoEntity> implements AitagTagInfoService {
+
+    /**
+     * 分页查询
+     *
+     * @param aitagTagInfoQueryVo
+     * @return IPage
+     */
+    @Override
+    public IPage<AitagTagInfoEntity> queryPage(AitagTagInfoQueryVo aitagTagInfoQueryVo) {
+        LambdaQueryWrapper<AitagTagInfoEntity> queryWrapper = new LambdaQueryWrapper<>();
+        if (aitagTagInfoQueryVo.getId() != null) {
+            queryWrapper.eq(AitagTagInfoEntity::getId, aitagTagInfoQueryVo.getId());
+        }
+        if (aitagTagInfoQueryVo.getCategoryId() != null) {
+            queryWrapper.eq(AitagTagInfoEntity::getCategoryId, aitagTagInfoQueryVo.getCategoryId());
+        }
+        if (aitagTagInfoQueryVo.getTagNm() != null) {
+            queryWrapper.eq(AitagTagInfoEntity::getTagNm, aitagTagInfoQueryVo.getTagNm());
+        }
+        if (aitagTagInfoQueryVo.getTagCode() != null) {
+            queryWrapper.eq(AitagTagInfoEntity::getTagCode, aitagTagInfoQueryVo.getTagCode());
+        }
+        if (aitagTagInfoQueryVo.getTagRemark() != null) {
+            queryWrapper.eq(AitagTagInfoEntity::getTagRemark, aitagTagInfoQueryVo.getTagRemark());
+        }
+        if (aitagTagInfoQueryVo.getParentCode() != null) {
+            queryWrapper.eq(AitagTagInfoEntity::getParentCode, aitagTagInfoQueryVo.getParentCode());
+        }
+        if (aitagTagInfoQueryVo.getReg() != null) {
+            queryWrapper.eq(AitagTagInfoEntity::getReg, aitagTagInfoQueryVo.getReg());
+        }
+        if (aitagTagInfoQueryVo.getLevel() != null) {
+            queryWrapper.eq(AitagTagInfoEntity::getLevel, aitagTagInfoQueryVo.getLevel());
+        }
+        if (aitagTagInfoQueryVo.getTagPath() != null) {
+            queryWrapper.eq(AitagTagInfoEntity::getTagPath, aitagTagInfoQueryVo.getTagPath());
+        }
+        if (aitagTagInfoQueryVo.getIsDelete() != null) {
+            queryWrapper.eq(AitagTagInfoEntity::getIsDelete, aitagTagInfoQueryVo.getIsDelete());
+        }
+        if (aitagTagInfoQueryVo.getState() != null) {
+            queryWrapper.eq(AitagTagInfoEntity::getState, aitagTagInfoQueryVo.getState());
+        }
+        if (aitagTagInfoQueryVo.getTagPrompt() != null) {
+            queryWrapper.eq(AitagTagInfoEntity::getTagPrompt, aitagTagInfoQueryVo.getTagPrompt());
+        }
+
+        IPage<AitagTagInfoEntity> page = this.page(new Page<>(aitagTagInfoQueryVo.getPage(), aitagTagInfoQueryVo.getSize()), queryWrapper);
+        return page;
+    }
+}

+ 196 - 0
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/service/impl/AitagTagLogServiceImpl.java

@@ -0,0 +1,196 @@
+package cn.com.yusys.yusp.service.impl;
+
+import cn.com.yusys.yusp.commons.exception.BizException;
+import cn.com.yusys.yusp.config.DataDictionary;
+import cn.com.yusys.yusp.domain.dto.TagSumDto;
+import cn.com.yusys.yusp.domain.entity.AitagTagInfoEntity;
+import cn.com.yusys.yusp.domain.vo.*;
+import cn.com.yusys.yusp.mapper.AitagTagDailyAggDao;
+import cn.com.yusys.yusp.mapper.AitagTagInfoDao;
+import cn.com.yusys.yusp.mapper.AitagTagLogDao;
+import cn.com.yusys.yusp.domain.entity.AitagTagLogEntity;
+import cn.com.yusys.yusp.service.AitagTagLogService;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.List;
+import java.util.Map;
+
+import static cn.com.yusys.yusp.config.DataDictionary.*;
+
+/**
+ * 
+ *
+ * @author 2507040827
+ * @date 2026-02-25 14:56:45
+ */
+
+@Service("aitagTagLogService")
+public class AitagTagLogServiceImpl extends ServiceImpl<AitagTagLogDao, AitagTagLogEntity> implements AitagTagLogService {
+
+    @Autowired
+    private AitagTagInfoDao tagInfoDao;
+
+    @Autowired
+    private AitagTagDailyAggDao aggDao;
+
+    @Override
+    public DataOverviewVo dataOverview(SmartTaggingResultVo taggingResult) {
+        DataOverviewVo dataOverview = new DataOverviewVo();
+        TagSumDto tagSumVo = this.baseMapper.selectTagCount(taggingResult);
+        dataOverview.setCountNum(tagSumVo.getTotalCount());
+        if(tagSumVo.getTotalDuration() !=0){
+            BigDecimal result = new BigDecimal(tagSumVo.getTotalDuration())
+                    .divide(new BigDecimal(tagSumVo.getTotalCount()), 10, RoundingMode.HALF_UP);
+            dataOverview.setAvgProcessingDuration(result.toString());
+        }else{
+            dataOverview.setAvgProcessingDuration("0");
+        }
+
+        LambdaQueryWrapper<AitagTagLogEntity> queryCount = new LambdaQueryWrapper<>();
+        LambdaQueryWrapper<AitagTagLogEntity> queryAccurateMarks = new LambdaQueryWrapper<>();
+        if (StringUtils.isNotBlank(taggingResult.getCategoryCode())) {
+            queryCount.eq(AitagTagLogEntity::getCategoryCode, taggingResult.getCategoryCode());
+            queryAccurateMarks.eq(AitagTagLogEntity::getCategoryCode, taggingResult.getCategoryCode());
+        }
+        if (StringUtils.isNotBlank(taggingResult.getStartTaggingTime())){
+            queryCount.ge(AitagTagLogEntity::getInsertTime, taggingResult.getStartTaggingTime());
+            queryAccurateMarks.ge(AitagTagLogEntity::getInsertTime, taggingResult.getStartTaggingTime());
+        }
+        if (StringUtils.isNotBlank(taggingResult.getEndTaggingTime())){
+            queryCount.le(AitagTagLogEntity::getInsertTime, taggingResult.getEndTaggingTime());
+            queryAccurateMarks.le(AitagTagLogEntity::getInsertTime, taggingResult.getEndTaggingTime());
+        }
+        queryCount.in(AitagTagLogEntity::getState, DataDictionary.RESULT_PUSHED,DataDictionary.MANAGER_CONFIRMED);
+        queryAccurateMarks.in(AitagTagLogEntity::getState, DataDictionary.RESULT_PUSHED,DataDictionary.MANAGER_CONFIRMED);
+
+        Integer countNum = this.baseMapper.selectCount(queryCount);
+
+        queryAccurateMarks.eq(AitagTagLogEntity::getFeedback,FEEDBACK_RESULT_AGREE);
+        Integer accurateMarksNum = this.baseMapper.selectCount(queryAccurateMarks);
+        BigDecimal accurateRate = calculateAccuracy(accurateMarksNum, countNum);
+
+        dataOverview.setAccurateNum(countNum);
+        dataOverview.setAccurateRate(accurateRate+"%");
+        if(countNum == 0){
+            dataOverview.setManualAdjustRate("0%");
+        }else{
+            dataOverview.setManualAdjustRate(BigDecimal.valueOf(100).subtract(accurateRate)
+                    .setScale(2, RoundingMode.HALF_UP)+"%");
+        }
+        dataOverview.setManualAdjustCount(countNum-accurateMarksNum);
+
+        return dataOverview;
+    }
+
+    @Override
+    public List<IconResVo> taggingTrend(TaggingTrendReqVo taggingTrendReqVo) {
+        String statisticalPeriod = taggingTrendReqVo.getStatisticalPeriod();
+        List<IconResVo> taggingTrendResVo = null;
+                switch (statisticalPeriod){
+            case DAY:
+                taggingTrendResVo = this.baseMapper.selectTagReportByDay(taggingTrendReqVo);
+                break;
+            case MONTH:
+                taggingTrendResVo = this.baseMapper.selectTagReportByMonth(taggingTrendReqVo);
+                break;
+            default:
+                throw BizException.of("NO_DATA_PERIOD");
+        }
+        return taggingTrendResVo;
+    }
+
+    @Override
+    public IPage<AitagTagLogEntity> taggingDetails(TaggingTransactionReqVo aitagTagLogEntity) {
+        LambdaQueryWrapper<AitagTagLogEntity> queryCount = new LambdaQueryWrapper<>();
+        if (StringUtils.isNotBlank(aitagTagLogEntity.getCategoryCode())) {
+            queryCount.eq(AitagTagLogEntity::getCategoryCode, aitagTagLogEntity.getCategoryCode());
+        }
+        if (StringUtils.isNotBlank(aitagTagLogEntity.getStartTaggingTime())){
+            queryCount.ge(AitagTagLogEntity::getInsertTime, aitagTagLogEntity.getStartTaggingTime());
+        }
+        if (StringUtils.isNotBlank(aitagTagLogEntity.getEndTaggingTime())){
+            queryCount.le(AitagTagLogEntity::getInsertTime, aitagTagLogEntity.getEndTaggingTime());
+        }
+        if (StringUtils.isNotBlank(aitagTagLogEntity.getLoanApplicationNo())){
+            queryCount.le(AitagTagLogEntity::getBusinessAttr, aitagTagLogEntity.getLoanApplicationNo());
+        }
+        return this.baseMapper.selectPage(new Page<>(aitagTagLogEntity.getPage(),
+                aitagTagLogEntity.getSize()),queryCount);
+    }
+
+    @Override
+    public AitagTagLogEntity show(String id) {
+        AitagTagLogEntity aitagTagLog = this.baseMapper.selectById(id);
+        if(aitagTagLog !=null){
+            String result = "";
+            String feedback = aitagTagLog.getFeedback();
+            if(FEEDBACK_RESULT_REJECT.equals(feedback)){
+                result = aitagTagLog.getFeedbackResult();
+                result = this.getTagPath(result);
+                aitagTagLog.setFeedbackResult(result);
+            }else{
+                result = aitagTagLog.getResult();
+                result = getTagPath(result);
+                aitagTagLog.setResult(result);
+            }
+        }
+        return aitagTagLog;
+    }
+
+    private String getTagPath(String result) {
+        List<Map> results = JSONArray.parseArray(result, Map.class);
+        for (Map resultMap: results){
+            String tagCode = resultMap.getOrDefault("tag_code","").toString();
+            LambdaQueryWrapper<AitagTagInfoEntity> queryCount = new LambdaQueryWrapper<>();
+            queryCount.eq(AitagTagInfoEntity::getTagCode,tagCode);
+            List<AitagTagInfoEntity> aitagTagInfoEntities = tagInfoDao.selectList(queryCount);
+            if(!aitagTagInfoEntities.isEmpty()){
+                AitagTagInfoEntity aitagTagInfoEntity = aitagTagInfoEntities.get(0);
+                resultMap.put("tag_path",aitagTagInfoEntity.getTagPath());
+            }
+        }
+        return JSONArray.toJSONString(results);
+    }
+
+    @Override
+    public List<IconResVo> tagDistStats(TagDistStatsReqVo resultVo) {
+        return aggDao.selectTagDistStats(resultVo);
+    }
+
+
+    /**
+     * 计算准确率
+     * @param correctCount 正确数
+     * @param totalCount 总数
+     * @return 准确率(百分比形式,保留两位小数)
+     * @throws IllegalArgumentException 当总数为0时抛出异常
+     */
+    public static BigDecimal calculateAccuracy(int correctCount, int totalCount) {
+        if (totalCount == 0) {
+            return new BigDecimal(0);
+        }
+
+        // 将整数转换为BigDecimal
+        BigDecimal correct = BigDecimal.valueOf(correctCount);
+        BigDecimal total = BigDecimal.valueOf(totalCount);
+
+        // 计算准确率:(正确数 / 总数) * 100,保留两位小数,四舍五入
+        BigDecimal accuracy = correct.divide(total, 4, RoundingMode.HALF_UP)
+                .multiply(BigDecimal.valueOf(100))
+                .setScale(2, RoundingMode.HALF_UP);
+
+        return accuracy;
+    }
+
+
+}

+ 37 - 0
server/yusp-tagging-core/src/main/resources/mapper/AitagTagDailyAggMapper.xml

@@ -0,0 +1,37 @@
+<?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="cn.com.yusys.yusp.mapper.AitagTagDailyAggDao">
+    <resultMap id="aitagTagDailyAgg" type="cn.com.yusys.yusp.domain.entity.AitagTagDailyAggEntity">
+        <id column="id" jdbcType="VARCHAR" property="id"/>
+        <result column="agg_date" jdbcType="VARCHAR" property="aggDate"/>
+        <result column="category_nm" jdbcType="VARCHAR" property="categoryNm"/>
+        <result column="tag_nm" jdbcType="VARCHAR" property="tagNm"/>
+        <result column="tag_count" jdbcType="INTEGER" property="tagCount"/>
+    </resultMap>
+
+
+    <select id="selectTagDistStats" resultType="cn.com.yusys.yusp.domain.vo.IconResVo" parameterType="cn.com.yusys.yusp.domain.vo.TagDistStatsReqVo">
+        SELECT
+        tag_nm as stat,
+        tag_count AS val
+        FROM aitag_tag_daily_agg
+        <where>
+            <if test="startTaggingTime != null">
+                AND agg_date >= #{startTaggingTime}
+            </if>
+            <if test="endTaggingTime != null">
+                AND #{endTaggingTime} >= agg_date
+            </if>
+            <if test="categoryCode != null">
+                AND #{categoryCode} = category_code
+            </if>
+            <if test="sort == 'ase'">
+                order by tag_count
+            </if>
+            <if test="sort == 'desc' ">
+                order by tag_count desc
+            </if>
+        </where>
+        Limit 6
+    </select>
+</mapper>

+ 18 - 0
server/yusp-tagging-core/src/main/resources/mapper/AitagTagInfoMapper.xml

@@ -0,0 +1,18 @@
+<?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="cn.com.yusys.yusp.mapper.AitagTagInfoDao">
+    <resultMap id="aitagTagInfo" type="cn.com.yusys.yusp.domain.entity.AitagTagInfoEntity">
+        <id column="id" jdbcType="VARCHAR" property="id"/>
+        <result column="category_id" jdbcType="VARCHAR" property="categoryId"/>
+        <result column="tag_nm" jdbcType="VARCHAR" property="tagNm"/>
+        <result column="tag_code" jdbcType="VARCHAR" property="tagCode"/>
+        <result column="tag_remark" jdbcType="VARCHAR" property="tagRemark"/>
+        <result column="parent_code" jdbcType="VARCHAR" property="parentCode"/>
+        <result column="reg" jdbcType="VARCHAR" property="reg"/>
+        <result column="level" jdbcType="INTEGER" property="level"/>
+        <result column="tag_path" jdbcType="VARCHAR" property="tagPath"/>
+        <result column="is_delete" jdbcType="INTEGER" property="isDelete"/>
+        <result column="state" jdbcType="INTEGER" property="state"/>
+        <result column="tag_prompt" jdbcType="VARCHAR" property="tagPrompt"/>
+    </resultMap>
+</mapper>

+ 110 - 0
server/yusp-tagging-core/src/main/resources/mapper/AitagTagLogMapper.xml

@@ -0,0 +1,110 @@
+<?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="cn.com.yusys.yusp.mapper.AitagTagLogDao">
+    <resultMap id="aitagTagLog" type="cn.com.yusys.yusp.domain.entity.AitagTagLogEntity">
+        <id column="id" jdbcType="VARCHAR" property="id"/>
+        <result column="app_id" jdbcType="VARCHAR" property="appId"/>
+        <result column="insert_time" jdbcType="TIMESTAMP" property="insertTime"/>
+        <result column="business_attr" jdbcType="VARCHAR" property="businessAttr"/>
+        <result column="phrase" jdbcType="VARCHAR" property="phrase"/>
+        <result column="attachment" jdbcType="VARCHAR" property="attachment"/>
+        <result column="attachment_url" jdbcType="VARCHAR" property="attachmentUrl"/>
+        <result column="result" jdbcType="VARCHAR" property="result"/>
+        <result column="feedback_user_id" jdbcType="VARCHAR" property="feedbackUserId"/>
+        <result column="feedback_user_nm" jdbcType="VARCHAR" property="feedbackUserNm"/>
+        <result column="feedback_time" jdbcType="TIMESTAMP" property="feedbackTime"/>
+        <result column="feedback" jdbcType="VARCHAR" property="feedback"/>
+        <result column="feedback_result" jdbcType="VARCHAR" property="feedbackResult"/>
+        <result column="state" jdbcType="INTEGER" property="state"/>
+        <result column="consuming_time" jdbcType="LONGVARCHAR" property="consumingTime"/>
+        <result column="category_code" jdbcType="VARCHAR" property="categoryCode"/>
+    </resultMap>
+
+
+    <select id="selectTagCount" resultType="cn.com.yusys.yusp.domain.dto.TagSumDto" parameterType="cn.com.yusys.yusp.domain.vo.SmartTaggingResultVo">
+        SELECT
+        COUNT(1) as totalCount,
+        SUM(consuming_time) as totalDuration
+        FROM aitag_tag_log
+        <where>
+            <if test="startTaggingTime != null and startTaggingTime != ''">
+                AND insert_time >= #{startTaggingTime}
+            </if>
+            <if test="endTaggingTime != null and endTaggingTime != ''">
+                AND #{endTaggingTime} >= insert_time
+            </if>
+            <if test="categoryCode != null and categoryCode != ''">
+                AND #{categoryCode} = category_code
+            </if>
+        </where>
+    </select>
+
+    <select id="selectTagReportByDay" resultType="cn.com.yusys.yusp.domain.vo.IconResVo" parameterType="cn.com.yusys.yusp.domain.vo.SmartTaggingResultVo">
+        SELECT
+        DATE_FORMAT(insert_time, '%Y年%m月%d日') AS stat,
+        COUNT(1) AS val
+        FROM aitag_tag_log
+        <where>
+            <if test="startTaggingTime != null and startTaggingTime != ''">
+                AND insert_time >= #{startTaggingTime}
+            </if>
+            <if test="endTaggingTime != null and endTaggingTime != ''">
+                AND #{endTaggingTime} >= insert_time
+            </if>
+            <if test="categoryCode != null and categoryCode != ''">
+                AND #{categoryCode} = category_code
+            </if>
+        </where>
+        GROUP BY DATE(insert_time)
+        ORDER BY stat;
+    </select>
+
+    <select id="selectTagReportByMonth" resultType="cn.com.yusys.yusp.domain.vo.IconResVo" parameterType="cn.com.yusys.yusp.domain.vo.SmartTaggingResultVo">
+        SELECT
+        DATE_FORMAT(insert_time, '%Y年%m月') AS stat,
+        COUNT(1) AS val
+        FROM aitag_tag_log
+        <where>
+            <if test="startTaggingTime != null and startTaggingTime != ''">
+                AND insert_time >= #{startTaggingTime}
+            </if>
+            <if test="endTaggingTime != null and endTaggingTime != ''">
+                AND #{endTaggingTime} >= insert_time
+            </if>
+            <if test="categoryCode != null and categoryCode != ''">
+                AND #{categoryCode} = category_code
+            </if>
+        </where>
+        GROUP BY DATE_FORMAT(insert_time, '%Y-%m')
+        ORDER BY stat;
+    </select>
+
+    <select id="selectTagReportByWeek" resultType="cn.com.yusys.yusp.domain.vo.IconResVo" parameterType="cn.com.yusys.yusp.domain.vo.SmartTaggingResultVo">
+        SELECT
+        YEARWEEK(insert_time, 1) AS stat,
+        COUNT(1) AS val
+        FROM aitag_tag_log
+        <where>
+            <if test="startTaggingTime != null and  startTaggingTime != ''">
+                AND insert_time >= #{startTaggingTime}
+            </if>
+            <if test="endTaggingTime != null and  endTaggingTime != ''">
+                AND #{endTaggingTime} >= insert_time
+            </if>
+            <if test="categoryCode != null and categoryCode != ''">
+                AND #{categoryCode} = category_code
+            </if>
+        </where>
+        GROUP BY YEARWEEK(insert_time, 1)
+        ORDER BY stat;
+    </select>
+
+    <select id="selectByInsertTime" resultType="cn.com.yusys.yusp.domain.entity.AitagTagLogEntity">
+        SELECT id, app_id, insert_time, business_attr, phrase, attachment, attachment_url, `result`, feedback_user_id, feedback_user_nm, feedback_time, feedback, feedback_result, state, consuming_time, category_code
+        FROM aitag_tag_log
+            where
+            DATE(insert_time) = #{insertTime}
+        AND state in ("2","3")
+    </select>
+
+</mapper>