소스 검색

调阅基础代码

luowei 2 년 전
부모
커밋
637e49064e

+ 96 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/TMonitoringRetrievalPlanController.java

@@ -0,0 +1,96 @@
+package com.xunmei.system.controller;
+
+import java.util.List;
+import java.io.IOException;
+import javax.servlet.http.HttpServletResponse;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.xunmei.common.log.annotation.Log;
+import com.xunmei.common.log.enums.BusinessType;
+import com.xunmei.common.security.annotation.RequiresPermissions;
+import com.xunmei.system.domain.TMonitoringRetrievalPlan;
+import com.xunmei.system.service.ITMonitoringRetrievalPlanService;
+import com.xunmei.common.core.web.controller.BaseController;
+import com.xunmei.common.core.web.domain.AjaxResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xunmei.common.core.web.page.TableDataInfo;
+
+/**
+ * 监控调阅计划Controller
+ *
+ * @author xunmei
+ * @date 2023-08-24
+ */
+@Api(tags = {"TMonitoringRetrievalPlan" })
+@RestController
+@RequestMapping("/plan")
+public class TMonitoringRetrievalPlanController extends BaseController {
+    @Autowired
+    private ITMonitoringRetrievalPlanService tMonitoringRetrievalPlanService;
+
+/**
+ * 查询监控调阅计划列表
+ */
+@ApiOperation(value = "查询TMonitoringRetrievalPlan列表")
+@RequiresPermissions("system:plan:list")
+@GetMapping("/list")
+    public TableDataInfo list(TMonitoringRetrievalPlan tMonitoringRetrievalPlan) {
+
+        return tMonitoringRetrievalPlanService.selectPage( tMonitoringRetrievalPlan);
+    }
+
+
+
+    /**
+     * 获取监控调阅计划详细信息
+     */
+    @ApiOperation(value = "获取TMonitoringRetrievalPlan详细信息")
+    @RequiresPermissions("system:plan:query")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return success(tMonitoringRetrievalPlanService.selectTMonitoringRetrievalPlanById(id));
+    }
+
+    /**
+     * 新增监控调阅计划
+     */
+    @ApiOperation(value = "新增TMonitoringRetrievalPlan")
+    @RequiresPermissions("system:plan:add")
+    @Log(title = "监控调阅计划" , businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TMonitoringRetrievalPlan tMonitoringRetrievalPlan) {
+        return toAjax(tMonitoringRetrievalPlanService.insertTMonitoringRetrievalPlan(tMonitoringRetrievalPlan));
+    }
+
+    /**
+     * 修改监控调阅计划
+     */
+    @ApiOperation(value = "修改TMonitoringRetrievalPlan")
+    @RequiresPermissions("system:plan:edit")
+    @Log(title = "监控调阅计划" , businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TMonitoringRetrievalPlan tMonitoringRetrievalPlan) {
+        return toAjax(tMonitoringRetrievalPlanService.updateTMonitoringRetrievalPlan(tMonitoringRetrievalPlan));
+    }
+
+    /**
+     * 删除监控调阅计划
+     */
+    @ApiOperation(value = "删除TMonitoringRetrievalPlan")
+    @RequiresPermissions("system:plan:remove")
+    @Log(title = "监控调阅计划" , businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(tMonitoringRetrievalPlanService.deleteTMonitoringRetrievalPlanByIds(ids));
+    }
+}

+ 158 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/domain/TMonitoringRetrievalPlan.java

@@ -0,0 +1,158 @@
+package com.xunmei.system.domain;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import com.xunmei.common.core.web.domain.BaseEntity;
+
+/**
+ * 监控调阅计划对象 t_monitoring_retrieval_plan
+ *
+ * @author xunmei
+ * @date 2023-08-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("t_monitoring_retrieval_plan")
+@ApiModel(value = "TMonitoringRetrievalPlan对象", description = "监控调阅计划")
+public class TMonitoringRetrievalPlan extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long id;
+
+    /**
+     * 计划名称
+     */
+    @ApiModelProperty(value = "计划名称")
+    private String planName;
+
+    /**
+     * 计划归属机构
+     */
+    @ApiModelProperty(value = "计划归属机构")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long orgId;
+
+    /**
+     * 计划归属机构
+     */
+    @ApiModelProperty(value = "计划归属机构")
+    private String orgPath;
+
+    /**
+     * 计划归属机构
+     */
+    @ApiModelProperty(value = "计划归属机构")
+    private String orgName;
+
+    /**
+     * 调阅机构类型
+     */
+    @ApiModelProperty(value = "调阅机构类型")
+    private Long orgType;
+
+    /**
+     * 调阅角色
+     */
+    @ApiModelProperty(value = "调阅角色")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long roleId;
+    private String roleName;
+    /**
+     * 调阅周期无周期、每日、每周、每月、每季度、每半年、每年(0-6)
+     */
+    @ApiModelProperty(value = "调阅周期无周期、每日、每周、每月、每季度、每半年、每年", notes = "0=-6")
+    private String planCycle;
+
+    /**
+     * 调阅频次
+     */
+    @ApiModelProperty(value = "调阅频次")
+    private Long planFrequency;
+
+    /**
+     * 计划状态(0启用、1禁用)
+     */
+    @ApiModelProperty(value = "计划状态", notes = "0=启用、1禁用")
+    private Long planStatus;
+
+    /**
+     * 备注
+     */
+    @ApiModelProperty(value = "备注")
+    private String description;
+
+    /**
+     * 是否删除(0正常,1删除)
+     */
+    @ApiModelProperty(value = "是否删除", notes = "0=正常,1删除")
+    private Long isDeleted;
+
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+
+
+                .append("id", getId())
+
+
+                .append("planName", getPlanName())
+
+
+                .append("orgId", getOrgId())
+
+
+                .append("orgPath", getOrgPath())
+
+
+                .append("orgName", getOrgName())
+
+                .append("orgType", getOrgType())
+
+
+                .append("roleId", getRoleId())
+
+
+                .append("planCycle", getPlanCycle())
+
+                .append("roleName", roleName)
+                .append("planFrequency", getPlanFrequency())
+
+
+                .append("planStatus", getPlanStatus())
+
+
+                .append("createTime", getCreateTime())
+
+
+                .append("createBy", getCreateBy())
+
+
+                .append("updateTime", getUpdateTime())
+
+
+                .append("updateBy", getUpdateBy())
+
+
+                .append("description", getDescription())
+
+
+                .append("isDeleted", getIsDeleted())
+                .toString();
+    }
+}

+ 64 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/mapper/TMonitoringRetrievalPlanMapper.java

@@ -0,0 +1,64 @@
+package com.xunmei.system.mapper;
+
+import java.util.List;
+
+import com.xunmei.system.domain.TMonitoringRetrievalPlan;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 监控调阅计划Mapper接口
+ *
+ * @author xunmei
+ * @date 2023-08-24
+ */
+@Mapper
+public interface TMonitoringRetrievalPlanMapper extends BaseMapper<TMonitoringRetrievalPlan> {
+    /**
+     * 查询监控调阅计划
+     *
+     * @param id 监控调阅计划主键
+     * @return 监控调阅计划
+     */
+    public TMonitoringRetrievalPlan selectTMonitoringRetrievalPlanById(Long id);
+
+    /**
+     * 查询监控调阅计划列表
+     *
+     * @param tMonitoringRetrievalPlan 监控调阅计划
+     * @return 监控调阅计划集合
+     */
+    public List<TMonitoringRetrievalPlan> selectTMonitoringRetrievalPlanList(TMonitoringRetrievalPlan tMonitoringRetrievalPlan);
+
+    /**
+     * 新增监控调阅计划
+     *
+     * @param tMonitoringRetrievalPlan 监控调阅计划
+     * @return 结果
+     */
+    public int insertTMonitoringRetrievalPlan(TMonitoringRetrievalPlan tMonitoringRetrievalPlan);
+
+    /**
+     * 修改监控调阅计划
+     *
+     * @param tMonitoringRetrievalPlan 监控调阅计划
+     * @return 结果
+     */
+    public int updateTMonitoringRetrievalPlan(TMonitoringRetrievalPlan tMonitoringRetrievalPlan);
+
+    /**
+     * 删除监控调阅计划
+     *
+     * @param id 监控调阅计划主键
+     * @return 结果
+     */
+    public int deleteTMonitoringRetrievalPlanById(Long id);
+
+    /**
+     * 批量删除监控调阅计划
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTMonitoringRetrievalPlanByIds(Long[] ids);
+}

+ 72 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/ITMonitoringRetrievalPlanService.java

@@ -0,0 +1,72 @@
+package com.xunmei.system.service;
+
+import java.util.List;
+
+import com.xunmei.system.domain.TMonitoringRetrievalPlan;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xunmei.common.core.web.page.TableDataInfo;
+
+/**
+ * 监控调阅计划Service接口
+ *
+ * @author xunmei
+ * @date 2023-08-24
+ */
+public interface ITMonitoringRetrievalPlanService extends IService<TMonitoringRetrievalPlan> {
+    /**
+     * 查询监控调阅计划
+     *
+     * @param id 监控调阅计划主键
+     * @return 监控调阅计划
+     */
+    public TMonitoringRetrievalPlan selectTMonitoringRetrievalPlanById(Long id);
+
+    /**
+     * 查询监控调阅计划列表
+     *
+     * @param tMonitoringRetrievalPlan 监控调阅计划
+     * @return 监控调阅计划集合
+     */
+    public List<TMonitoringRetrievalPlan> selectTMonitoringRetrievalPlanList(TMonitoringRetrievalPlan tMonitoringRetrievalPlan);
+
+    /**
+     * 新增监控调阅计划
+     *
+     * @param tMonitoringRetrievalPlan 监控调阅计划
+     * @return 结果
+     */
+    public int insertTMonitoringRetrievalPlan(TMonitoringRetrievalPlan tMonitoringRetrievalPlan);
+
+    /**
+     * 修改监控调阅计划
+     *
+     * @param tMonitoringRetrievalPlan 监控调阅计划
+     * @return 结果
+     */
+    public int updateTMonitoringRetrievalPlan(TMonitoringRetrievalPlan tMonitoringRetrievalPlan);
+
+    /**
+     * 批量删除监控调阅计划
+     *
+     * @param ids 需要删除的监控调阅计划主键集合
+     * @return 结果
+     */
+    public int deleteTMonitoringRetrievalPlanByIds(Long[] ids);
+
+    /**
+     * 删除监控调阅计划信息
+     *
+     * @param id 监控调阅计划主键
+     * @return 结果
+     */
+    public int deleteTMonitoringRetrievalPlanById(Long id);
+
+    /**
+     * 查询监控调阅计划分页数据
+     *
+     * @param tMonitoringRetrievalPlan 查询条件对象
+     * @return Page
+     */
+    public TableDataInfo selectPage(TMonitoringRetrievalPlan tMonitoringRetrievalPlan);
+}

+ 7 - 1
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysAreaCheckServiceImpl.java

@@ -5,6 +5,7 @@ import java.util.List;
 
 import com.xunmei.common.core.exception.ServiceException;
 import com.xunmei.common.core.utils.DateUtils;
+import com.xunmei.common.core.utils.StringUtils;
 import com.xunmei.common.core.utils.bean.BeanUtils;
 import com.xunmei.common.security.utils.SecurityUtils;
 import com.xunmei.system.api.domain.SysArea;
@@ -63,7 +64,12 @@ public class SysAreaCheckServiceImpl extends ServiceImpl<SysAreaCheckMapper, Sys
         //下穿
         //先全部查出
         sysAreaCheck.setCheckSub(true);
-        sysAreaCheck.setOrgId(1L);
+        QueryWrapper queryWrapper=new QueryWrapper();
+        queryWrapper.eq("parent_id",-1);
+        SysOrg sysOrg1 = sysOrgMapper.selectOne(queryWrapper);
+        if (null==sysAreaCheck.getOrgId()){
+            sysAreaCheck.setOrgId(sysOrg1.getId());
+        }
         if (sysAreaCheck.getCheckSub()) {
             List<Long> ids = orgService.selectCheckSubOrgIdList(sysAreaCheck.getOrgId());
             //清空前端传递的org_id

+ 1 - 1
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysUserServiceImpl.java

@@ -183,7 +183,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
      */
     @Override
     public SysUser selectUserByUserName(String userName) {
-        return userMapper.selectOne(new QueryWrapper<SysUser>().eq("username", userName));
+        return userMapper.selectOne(new QueryWrapper<SysUser>().eq("username", userName).eq("deleted",0));
     }
 
     /**

+ 164 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/TMonitoringRetrievalPlanServiceImpl.java

@@ -0,0 +1,164 @@
+package com.xunmei.system.service.impl;
+
+import java.util.List;
+
+import com.xunmei.common.core.utils.DateUtils;
+import com.xunmei.common.security.utils.SecurityUtils;
+import com.xunmei.system.api.domain.SysOrg;
+import com.xunmei.system.api.domain.SysUser;
+import com.xunmei.system.mapper.SysOrgMapper;
+import com.xunmei.system.mapper.SysRoleMapper;
+import com.xunmei.system.mapper.SysUserMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.xunmei.system.service.ISysOrgService;
+
+import java.util.Arrays;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xunmei.common.core.web.page.TableDataInfo;
+import com.xunmei.system.mapper.TMonitoringRetrievalPlanMapper;
+import com.xunmei.system.domain.TMonitoringRetrievalPlan;
+import com.xunmei.system.service.ITMonitoringRetrievalPlanService;
+
+/**
+ * 监控调阅计划Service业务层处理
+ *
+ * @author xunmei
+ * @date 2023-08-24
+ */
+@Service
+public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoringRetrievalPlanMapper, TMonitoringRetrievalPlan> implements ITMonitoringRetrievalPlanService {
+    @Autowired
+    private TMonitoringRetrievalPlanMapper tMonitoringRetrievalPlanMapper;
+    @Autowired
+    private ISysOrgService orgService;
+    @Autowired
+    private SysOrgMapper sysOrgMapper;
+    @Autowired
+    private SysRoleMapper sysRoleMapper;
+@Autowired
+private SysUserMapper sysUserMapper;
+    @Override
+    public TableDataInfo selectPage(TMonitoringRetrievalPlan tMonitoringRetrievalPlan) {
+        //未删除
+        tMonitoringRetrievalPlan.setIsDeleted(0L);
+        Page<TMonitoringRetrievalPlan> page;
+        //分页
+        if (tMonitoringRetrievalPlan.getPageNum() != null && tMonitoringRetrievalPlan.getPageSize() != null) {
+            page = new Page<>(tMonitoringRetrievalPlan.getPageNum(), tMonitoringRetrievalPlan.getPageSize());
+        } else {
+            page = new Page<>();
+        }
+        //查询条件
+        QueryWrapper<TMonitoringRetrievalPlan> query = new QueryWrapper<>(tMonitoringRetrievalPlan);
+        //下穿
+        tMonitoringRetrievalPlan.setCheckSub(true);
+        QueryWrapper queryWrapper = new QueryWrapper();
+        queryWrapper.eq("parent_id", -1);
+        SysOrg sysOrg1 = sysOrgMapper.selectOne(queryWrapper);
+        if (null == tMonitoringRetrievalPlan.getOrgId()) {
+            tMonitoringRetrievalPlan.setOrgId(sysOrg1.getId());
+        }
+        if (tMonitoringRetrievalPlan.getCheckSub()) {
+            List<Long> ids = orgService.selectCheckSubOrgIdList(tMonitoringRetrievalPlan.getOrgId());
+            //清空前端传递的org_id
+            tMonitoringRetrievalPlan.setOrgId(null);
+            //添加in条件
+            query.in("org_id", ids);
+        }
+        //时间范围查询
+        if (tMonitoringRetrievalPlan.getParams().get("beginTime") != null && tMonitoringRetrievalPlan.getParams().get("endTime") != null) {
+            query.between("create_time", tMonitoringRetrievalPlan.getParams().get("beginTime"), tMonitoringRetrievalPlan.getParams().get("endTime"));
+        }
+        //获取数据
+        page = tMonitoringRetrievalPlanMapper.selectPage(page, query);
+        //抓换为TableDataInfo适配前端
+        TableDataInfo tableDataInfo = new TableDataInfo();
+        tableDataInfo.setMsg("操作成功");
+        tableDataInfo.setCode(200);
+        tableDataInfo.setTotal(page.getTotal());
+        tableDataInfo.setRows(page.getRecords());
+        return tableDataInfo;
+
+
+    }
+
+
+    /**
+     * 查询监控调阅计划
+     *
+     * @param id 监控调阅计划主键
+     * @return 监控调阅计划
+     */
+    @Override
+    public TMonitoringRetrievalPlan selectTMonitoringRetrievalPlanById(Long id) {
+        return tMonitoringRetrievalPlanMapper.selectById(id);
+    }
+
+    /**
+     * 查询监控调阅计划列表
+     *
+     * @param tMonitoringRetrievalPlan 监控调阅计划
+     * @return 监控调阅计划
+     */
+    @Override
+    public List<TMonitoringRetrievalPlan> selectTMonitoringRetrievalPlanList(TMonitoringRetrievalPlan tMonitoringRetrievalPlan) {
+        return tMonitoringRetrievalPlanMapper.selectList(new QueryWrapper<>(tMonitoringRetrievalPlan));
+    }
+
+    /**
+     * 新增监控调阅计划
+     *
+     * @param tMonitoringRetrievalPlan 监控调阅计划
+     * @return 结果
+     */
+    @Override
+    public int insertTMonitoringRetrievalPlan(TMonitoringRetrievalPlan tMonitoringRetrievalPlan) {
+        tMonitoringRetrievalPlan.setCreateTime(DateUtils.getNowDate());
+        SysUser sysUser = sysUserMapper.selectById(SecurityUtils.getUserId());
+        tMonitoringRetrievalPlan.setOrgName(sysOrgMapper.selectSysOrgById(sysUser.getOrgId()).getName());
+        tMonitoringRetrievalPlan.setOrgId(sysUser.getOrgId());
+        tMonitoringRetrievalPlan.setCreateBy(SecurityUtils.getUsername());
+        tMonitoringRetrievalPlan.setUpdateTime(DateUtils.getNowDate());
+        tMonitoringRetrievalPlan.setUpdateBy(SecurityUtils.getUsername());
+        tMonitoringRetrievalPlan.setRoleName(sysRoleMapper.selectRoleById(tMonitoringRetrievalPlan.getRoleId()).getRoleName());
+        return tMonitoringRetrievalPlanMapper.insert(tMonitoringRetrievalPlan);
+    }
+
+    /**
+     * 修改监控调阅计划
+     *
+     * @param tMonitoringRetrievalPlan 监控调阅计划
+     * @return 结果
+     */
+    @Override
+    public int updateTMonitoringRetrievalPlan(TMonitoringRetrievalPlan tMonitoringRetrievalPlan) {
+        tMonitoringRetrievalPlan.setUpdateTime(DateUtils.getNowDate());
+        return tMonitoringRetrievalPlanMapper.updateById(tMonitoringRetrievalPlan);
+    }
+
+    /**
+     * 批量删除监控调阅计划
+     *
+     * @param ids 需要删除的监控调阅计划主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTMonitoringRetrievalPlanByIds(Long[] ids) {
+        return tMonitoringRetrievalPlanMapper.deleteBatchIds(Arrays.asList((ids)));
+    }
+
+    /**
+     * 删除监控调阅计划信息
+     *
+     * @param id 监控调阅计划主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTMonitoringRetrievalPlanById(Long id) {
+        return tMonitoringRetrievalPlanMapper.deleteById(id);
+    }
+}

+ 212 - 0
soc-modules/soc-modules-system/src/main/resources/mapper/system/TMonitoringRetrievalPlanMapper.xml

@@ -0,0 +1,212 @@
+<?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.xunmei.system.mapper.TMonitoringRetrievalPlanMapper">
+
+    <resultMap type="com.xunmei.system.domain.TMonitoringRetrievalPlan" id="TMonitoringRetrievalPlanResult">
+                <result property="id" column="id"/>
+                <result property="planName" column="plan_name"/>
+                <result property="orgId" column="org_id"/>
+                <result property="orgPath" column="org_path"/>
+                <result property="orgName" column="org_name"/>
+                <result property="orgType" column="org_type"/>
+                <result property="roleId" column="role_id"/>
+                <result property="planCycle" column="plan_cycle"/>
+                <result property="planFrequency" column="plan_frequency"/>
+                <result property="planStatus" column="plan_status"/>
+                <result property="createTime" column="create_time"/>
+                <result property="createBy" column="create_by"/>
+                <result property="updateTime" column="update_time"/>
+                <result property="updateBy" column="update_by"/>
+                <result property="description" column="description"/>
+                <result property="isDeleted" column="is_deleted"/>
+    </resultMap>
+
+    <sql id="selectTMonitoringRetrievalPlanVo">
+        select id, plan_name, org_id, org_path, org_name, org_type, role_id, plan_cycle, plan_frequency, plan_status, create_time, create_by, update_time, update_by, description, is_deleted
+        from t_monitoring_retrieval_plan
+    </sql>
+
+    <select id="selectTMonitoringRetrievalPlanList" parameterType="com.xunmei.system.domain.TMonitoringRetrievalPlan"
+            resultMap="TMonitoringRetrievalPlanResult">
+        <include refid="selectTMonitoringRetrievalPlanVo"/>
+        <where>
+                        <if test="planName != null  and planName != ''">
+                            and plan_name like concat('%', #{planName}, '%')
+                        </if>
+                        <if test="orgId != null ">
+                            and org_id = #{orgId}
+                        </if>
+                        <if test="orgPath != null  and orgPath != ''">
+                            and org_path = #{orgPath}
+                        </if>
+                        <if test="orgName != null  and orgName != ''">
+                            and org_name like concat('%', #{orgName}, '%')
+                        </if>
+                        <if test="orgType != null ">
+                            and org_type = #{orgType}
+                        </if>
+                        <if test="roleId != null ">
+                            and role_id = #{roleId}
+                        </if>
+                        <if test="planCycle != null  and planCycle != ''">
+                            and plan_cycle = #{planCycle}
+                        </if>
+                        <if test="planFrequency != null ">
+                            and plan_frequency = #{planFrequency}
+                        </if>
+                        <if test="planStatus != null ">
+                            and plan_status = #{planStatus}
+                        </if>
+                        <if test="description != null  and description != ''">
+                            and description = #{description}
+                        </if>
+                        <if test="isDeleted != null ">
+                            and is_deleted = #{isDeleted}
+                        </if>
+        </where>
+    </select>
+
+    <select id="selectTMonitoringRetrievalPlanById" parameterType="Long"
+            resultMap="TMonitoringRetrievalPlanResult">
+            <include refid="selectTMonitoringRetrievalPlanVo"/>
+            where id = #{id}
+    </select>
+
+    <insert id="insertTMonitoringRetrievalPlan" parameterType="com.xunmei.system.domain.TMonitoringRetrievalPlan">
+        insert into t_monitoring_retrieval_plan
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+                    <if test="id != null">id,
+                    </if>
+                    <if test="planName != null">plan_name,
+                    </if>
+                    <if test="orgId != null">org_id,
+                    </if>
+                    <if test="orgPath != null">org_path,
+                    </if>
+                    <if test="orgName != null">org_name,
+                    </if>
+                    <if test="orgType != null">org_type,
+                    </if>
+                    <if test="roleId != null">role_id,
+                    </if>
+                    <if test="planCycle != null">plan_cycle,
+                    </if>
+                    <if test="planFrequency != null">plan_frequency,
+                    </if>
+                    <if test="planStatus != null">plan_status,
+                    </if>
+                    <if test="createTime != null">create_time,
+                    </if>
+                    <if test="createBy != null">create_by,
+                    </if>
+                    <if test="updateTime != null">update_time,
+                    </if>
+                    <if test="updateBy != null">update_by,
+                    </if>
+                    <if test="description != null">description,
+                    </if>
+                    <if test="isDeleted != null">is_deleted,
+                    </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+                    <if test="id != null">#{id},
+                    </if>
+                    <if test="planName != null">#{planName},
+                    </if>
+                    <if test="orgId != null">#{orgId},
+                    </if>
+                    <if test="orgPath != null">#{orgPath},
+                    </if>
+                    <if test="orgName != null">#{orgName},
+                    </if>
+                    <if test="orgType != null">#{orgType},
+                    </if>
+                    <if test="roleId != null">#{roleId},
+                    </if>
+                    <if test="planCycle != null">#{planCycle},
+                    </if>
+                    <if test="planFrequency != null">#{planFrequency},
+                    </if>
+                    <if test="planStatus != null">#{planStatus},
+                    </if>
+                    <if test="createTime != null">#{createTime},
+                    </if>
+                    <if test="createBy != null">#{createBy},
+                    </if>
+                    <if test="updateTime != null">#{updateTime},
+                    </if>
+                    <if test="updateBy != null">#{updateBy},
+                    </if>
+                    <if test="description != null">#{description},
+                    </if>
+                    <if test="isDeleted != null">#{isDeleted},
+                    </if>
+        </trim>
+    </insert>
+
+    <update id="updateTMonitoringRetrievalPlan" parameterType="com.xunmei.system.domain.TMonitoringRetrievalPlan">
+        update t_monitoring_retrieval_plan
+        <trim prefix="SET" suffixOverrides=",">
+                    <if test="planName != null">plan_name =
+                        #{planName},
+                    </if>
+                    <if test="orgId != null">org_id =
+                        #{orgId},
+                    </if>
+                    <if test="orgPath != null">org_path =
+                        #{orgPath},
+                    </if>
+                    <if test="orgName != null">org_name =
+                        #{orgName},
+                    </if>
+                    <if test="orgType != null">org_type =
+                        #{orgType},
+                    </if>
+                    <if test="roleId != null">role_id =
+                        #{roleId},
+                    </if>
+                    <if test="planCycle != null">plan_cycle =
+                        #{planCycle},
+                    </if>
+                    <if test="planFrequency != null">plan_frequency =
+                        #{planFrequency},
+                    </if>
+                    <if test="planStatus != null">plan_status =
+                        #{planStatus},
+                    </if>
+                    <if test="createTime != null">create_time =
+                        #{createTime},
+                    </if>
+                    <if test="createBy != null">create_by =
+                        #{createBy},
+                    </if>
+                    <if test="updateTime != null">update_time =
+                        #{updateTime},
+                    </if>
+                    <if test="updateBy != null">update_by =
+                        #{updateBy},
+                    </if>
+                    <if test="description != null">description =
+                        #{description},
+                    </if>
+                    <if test="isDeleted != null">is_deleted =
+                        #{isDeleted},
+                    </if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteTMonitoringRetrievalPlanById" parameterType="Long">
+        delete
+        from t_monitoring_retrieval_plan where id = #{id}
+    </delete>
+
+    <delete id="deleteTMonitoringRetrievalPlanByIds" parameterType="String">
+        delete from t_monitoring_retrieval_plan where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>