luowei 2 gadi atpakaļ
vecāks
revīzija
2a1bbf7b18

+ 7 - 0
project_data/sql/0.0.2/soc/soc.sql

@@ -1027,6 +1027,13 @@ IF
         ALTER TABLE `core_safecheck_plan` ADD COLUMN `distribute` VARCHAR ( 2 ) DEFAULT NULL COMMENT '是否已下发';
 
     END IF;
+
+	-- 调阅计划是否立即生成任务
+    IF
+NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'core_monitoring_retrieval_plan' AND COLUMN_NAME = 'immediately' ) THEN
+ALTER TABLE `core_monitoring_retrieval_plan` ADD COLUMN `immediately` VARCHAR ( 2 ) DEFAULT NULL COMMENT '是否立即生成任务1是2否';
+
+END IF;
 	-- 履职计划是否下发标识
     IF
         NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'core_resumption_plan' AND COLUMN_NAME = 'distribute' ) THEN

+ 5 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/SocCoreApplication.java

@@ -8,6 +8,11 @@ import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 
+import java.text.SimpleDateFormat;
+import java.time.LocalDate;
+import java.util.Calendar;
+import java.util.Date;
+
 
 @MapperScan("com.xunmei.core.**.mapper")
 @EnableCustomConfig

+ 4 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/controller/TMonitoringRetrievalPlanController.java

@@ -19,6 +19,7 @@ import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.text.ParseException;
 import java.util.Set;
 
 /**
@@ -37,6 +38,7 @@ public class TMonitoringRetrievalPlanController extends BaseController {
     private RemoteRoleService remoteRoleService;
     @Autowired
     private RemoteOrgService remoteOrgService;
+
     /**
      * 查询监控调阅计划列表
      */
@@ -67,7 +69,7 @@ public class TMonitoringRetrievalPlanController extends BaseController {
             admin = true;
         }
         ajax.put("check", admin);
-        ajax.put("isEdit",sysOrg.getId());
+        ajax.put("isEdit", sysOrg.getId());
         return ajax;
     }
 
@@ -77,7 +79,7 @@ public class TMonitoringRetrievalPlanController extends BaseController {
     @ApiOperation(value = "下发")
     @RequiresPermissions("core:accessPlan:add")
     @GetMapping(value = "/distribute/{id}")
-    public AjaxResult distribute(@PathVariable(value = "id", required = false) Long id) {
+    public AjaxResult distribute(@PathVariable(value = "id", required = false) Long id) throws ParseException {
         return success(tMonitoringRetrievalPlanService.distribute(id));
     }
 

+ 5 - 3
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/domain/TMonitoringRetrievalPlan.java

@@ -50,7 +50,9 @@ public class TMonitoringRetrievalPlan extends BaseEntity {
     @ApiModelProperty(value = "计划名称")
     private String planName;
     @ApiModelProperty(value = "是否显示下发")
-private String isDistribute;
+    private String isDistribute;
+    @ApiModelProperty(value = "是否立即下发")
+    private String immediately;
     /**
      * 计划归属机构
      */
@@ -58,10 +60,10 @@ private String isDistribute;
     @JsonSerialize(using = ToStringSerializer.class)
     private Long orgId;
     @ApiModelProperty(value = "开始时间")
-   // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date startTime;
     @ApiModelProperty(value = "结束时间")
-   // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date endTime;
     @ApiModelProperty(value = "下发类型0不能做任务1可以直接做任务")
     private Integer createType;

+ 12 - 7
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/mapper/TMonitoringRetrievalPlanMapper.java

@@ -26,15 +26,17 @@ public interface TMonitoringRetrievalPlanMapper extends BaseMapper<TMonitoringRe
      * @param id 监控调阅计划主键
      * @return 监控调阅计划
      */
-     TMonitoringRetrievalPlan selectTMonitoringRetrievalPlanById(Long id);
+    TMonitoringRetrievalPlan selectTMonitoringRetrievalPlanById(Long id);
+
     Page<TMonitoringRetrievalPlanVO> selectPageList(@Param("page") Page<TMonitoringRetrievalPlanVO> page, @Param("request") TMonitoringRetrievalPlan request);
+
     /**
      * 查询监控调阅计划列表
      *
      * @param tMonitoringRetrievalPlan 监控调阅计划
      * @return 监控调阅计划集合
      */
-     List<TMonitoringRetrievalPlan> selectTMonitoringRetrievalPlanList(TMonitoringRetrievalPlan tMonitoringRetrievalPlan);
+    List<TMonitoringRetrievalPlan> selectTMonitoringRetrievalPlanList(TMonitoringRetrievalPlan tMonitoringRetrievalPlan);
 
     /**
      * 新增监控调阅计划
@@ -42,7 +44,7 @@ public interface TMonitoringRetrievalPlanMapper extends BaseMapper<TMonitoringRe
      * @param tMonitoringRetrievalPlan 监控调阅计划
      * @return 结果
      */
-     int insertTMonitoringRetrievalPlan(TMonitoringRetrievalPlan tMonitoringRetrievalPlan);
+    int insertTMonitoringRetrievalPlan(TMonitoringRetrievalPlan tMonitoringRetrievalPlan);
 
     /**
      * 修改监控调阅计划
@@ -50,10 +52,11 @@ public interface TMonitoringRetrievalPlanMapper extends BaseMapper<TMonitoringRe
      * @param tMonitoringRetrievalPlan 监控调阅计划
      * @return 结果
      */
-     int updateTMonitoringRetrievalPlan(TMonitoringRetrievalPlan tMonitoringRetrievalPlan);
+    int updateTMonitoringRetrievalPlan(TMonitoringRetrievalPlan tMonitoringRetrievalPlan);
 
     /**
      * 逻辑删除计划以及下面所有的子计划
+     *
      * @param tMonitoringRetrievalPlan
      * @return
      */
@@ -61,18 +64,20 @@ public interface TMonitoringRetrievalPlanMapper extends BaseMapper<TMonitoringRe
 
     /**
      * 根据父id修改状态
+     *
      * @param status
      * @param parentId
      * @return
      */
-    int updatePlanStatus(@Param("status") Integer status,@Param("parentId") Long parentId);
+    int updatePlanStatus(@Param("status") Integer status, @Param("parentId") Long parentId);
+
     /**
      * 删除监控调阅计划
      *
      * @param id 监控调阅计划主键
      * @return 结果
      */
-     int deleteTMonitoringRetrievalPlanById(Long id);
+    int deleteTMonitoringRetrievalPlanById(Long id);
 
     /**
      * 批量删除监控调阅计划
@@ -80,5 +85,5 @@ public interface TMonitoringRetrievalPlanMapper extends BaseMapper<TMonitoringRe
      * @param ids 需要删除的数据主键集合
      * @return 结果
      */
-     int deleteTMonitoringRetrievalPlanByIds(Long[] ids);
+    int deleteTMonitoringRetrievalPlanByIds(Long[] ids);
 }

+ 2 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/service/ITMonitoringRetrievalPlanService.java

@@ -5,6 +5,7 @@ import com.xunmei.common.core.web.page.TableDataInfo;
 import com.xunmei.core.access.domain.TMonitoringRetrievalPlan;
 import com.xunmei.core.access.vo.TMonitoringRetrievalPlanVO;
 
+import java.text.ParseException;
 import java.util.List;
 
 
@@ -29,7 +30,7 @@ public interface ITMonitoringRetrievalPlanService extends IService<TMonitoringRe
      * @param id
      * @return
      */
-    int distribute(Long id);
+    int distribute(Long id) throws ParseException;
 
     /**
      * 查询监控调阅计划列表

+ 62 - 21
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/service/impl/TMonitoringRetrievalPlanServiceImpl.java

@@ -38,7 +38,12 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.time.LocalDate;
 import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
 import java.util.List;
 
 import java.util.stream.Collectors;
@@ -81,7 +86,7 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
         }
         //查询条件
         String planName = tMonitoringRetrievalPlan.getPlanName();
-       // tMonitoringRetrievalPlan.setPlanName(null);
+        // tMonitoringRetrievalPlan.setPlanName(null);
 
         QueryWrapper<TMonitoringRetrievalPlan> query = new QueryWrapper<>(tMonitoringRetrievalPlan);
         //下穿
@@ -107,18 +112,6 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
         //获取数据
 
         page = tMonitoringRetrievalPlanMapper.selectPageList(page, tMonitoringRetrievalPlan);
-       /* List<TMonitoringRetrievalPlan> records = page.getRecords();
-        List<TMonitoringRetrievalPlanVO>tMonitoringRetrievalPlanVOS = null;
-        SysOrg sysOrg = remoteOrgService.selectSysOrgById(SecurityUtils.getLoginUser().getOrgId(), SecurityConstants.INNER);*/
-  /*      for (TMonitoringRetrievalPlan r:records){
-            TMonitoringRetrievalPlanVO tMonitoringRetrievalPlanVO=new TMonitoringRetrievalPlanVO();
-            BeanUtils.copyProperties(r,tMonitoringRetrievalPlanVO);
-            if (r.getOrgId().equals(sysOrg.getId())||r.getParentId().equals(sysOrg.getId())){
-                tMonitoringRetrievalPlanVO.setIsEdit(Boolean.TRUE);
-            }
-            tMonitoringRetrievalPlanVOS.add(tMonitoringRetrievalPlanVO);
-        }*/
-      //  page.setRecords(tMonitoringRetrievalPlanVOS);
         return TableDataInfo.build(page);
     }
 
@@ -134,11 +127,8 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
         TMonitoringRetrievalPlanVO tMonitoringRetrievalPlanVO = new TMonitoringRetrievalPlanVO();
         TMonitoringRetrievalPlan plan = tMonitoringRetrievalPlanMapper.selectById(id);
         BeanUtils.copyProperties(plan, tMonitoringRetrievalPlanVO);
-        //1:
-        SysOrg sysOrg = remoteOrgService.selectSysOrgById(plan.getOrgId(), SecurityConstants.INNER);
-        SysOrg sysOrg1 = remoteOrgService.selectSysOrgById(SecurityUtils.getLoginUser().getOrgId(), SecurityConstants.INNER);
         boolean isEdit = false;
-        if (plan.getParentId()!=null) {
+        if (plan.getParentId() != null) {
             isEdit = true;
         }
         tMonitoringRetrievalPlanVO.setIsEdit(isEdit);
@@ -147,7 +137,7 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
 
     @Transactional
     @Override
-    public int distribute(Long id) {
+    public int distribute(Long id) throws ParseException {
         //查询
         TMonitoringRetrievalPlan tMonitoringRetrievalPlan = tMonitoringRetrievalPlanMapper.selectById(id);
         tMonitoringRetrievalPlan.setIsDistribute("1");
@@ -211,14 +201,45 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
                 plan.setCreateTime(DateUtils.getNowDate());
                 plan.setDescription(tMonitoringRetrievalPlan.getDescription());
                 plan.setCreateType(1);
-                plan.setId(tMonitoringRetrievalPlan.getId());
+                //      plan.setId(tMonitoringRetrievalPlan.getId());
                 plan.setParentId(tMonitoringRetrievalPlan.getId());
                 plan.setIsDistribute("1");
-                //   i = tMonitoringRetrievalPlanMapper.insert(plan);
+                if (!tMonitoringRetrievalPlan.getPlanCycle().equals(ZERO.toString()) && tMonitoringRetrievalPlan.getImmediately().equals("1")) {
+                    plan.setStartTime(new Date());
+                    int amount = 0;
+                    LocalDate lastDayOfMonth;
+                    switch (tMonitoringRetrievalPlan.getPlanCycle()) {
+                        case "1":
+                            amount = 1;
+                            break;
+                        case "2":
+                            amount = 7;
+                            break;
+                        case "3":
+                            LocalDate currentDate = LocalDate.now();
+                            lastDayOfMonth = currentDate.withDayOfMonth(currentDate.lengthOfMonth());
+                            amount = lastDayOfMonth.getDayOfMonth() - currentDate.getDayOfMonth();
+                            break;
+                        case "4":
+                            amount = getDayNum(3);
+                            break;
+                        case "5":
+                            amount = getDayNum(6);
+                            break;
+                        case "6":
+                            amount = getDayNum(12);
+                            break;
+                    }
+                    Calendar cal = Calendar.getInstance();
+                    cal.setTime(new Date());
+                    cal.add(Calendar.DATE, amount);
+                    Date time = cal.getTime();
+                    plan.setEndTime(time);
+                }
                 tMonitoringRetrievalPlans.add(plan);
             }
         }
-        if (tMonitoringRetrievalPlan.getPlanCycle().equals(ZERO.toString()) && CollectionUtils.isNotEmpty(tMonitoringRetrievalPlans)) {
+        if ((tMonitoringRetrievalPlan.getImmediately().equals("1") || tMonitoringRetrievalPlan.getPlanCycle().equals(ZERO.toString())) && CollectionUtils.isNotEmpty(tMonitoringRetrievalPlans)) {
             try {
                 iCoreMonitoringRetrievalTaskService.noCycleTask(tMonitoringRetrievalPlans);
             } catch (Exception e) {
@@ -228,6 +249,26 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
         return i;
     }
 
+    private int getDayNum(int monthsToAdd) {
+        LocalDate lastDayOfMonth;
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        LocalDate localDate = LocalDate.now();
+        LocalDate nextMonthFirstDay = null;
+        nextMonthFirstDay = localDate.plusMonths(monthsToAdd).withDayOfMonth(1);
+        lastDayOfMonth = nextMonthFirstDay.minusDays(1);
+        int dayNum = 0;
+        try {
+            Date d1 = sdf.parse(lastDayOfMonth.toString());
+            Date d2 = sdf.parse(localDate.toString());
+            long date_interval = Math.abs(d1.getTime() - d2.getTime());//绝对值
+            long day = 1000 * 24 * 60 * 60;//1000*24*60*60毫秒是一天
+            dayNum = new Long(date_interval / day).intValue();
+        } catch (Exception e) {
+            e.getMessage();
+        }
+        return dayNum;
+    }
+
     /**
      * 查询监控调阅计划列表
      *

+ 1 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/vo/TMonitoringRetrievalPlanVO.java

@@ -14,4 +14,5 @@ import java.util.List;
 public class TMonitoringRetrievalPlanVO extends TMonitoringRetrievalPlan {
     @ApiModelProperty(value = "是否可以编辑")
     private Boolean isEdit;
+    private Long parentOrgId;
 }

+ 39 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/retrieval/service/impl/CoreMonitoringRetrievalTaskServiceImpl.java

@@ -41,6 +41,7 @@ import com.xunmei.system.api.domain.SysDictData;
 import com.xunmei.system.api.domain.SysOrg;
 import com.xunmei.system.api.function.RemoteCallHandlerExecutor;
 import com.xunmei.system.api.model.LoginUser;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.scheduling.annotation.Async;
@@ -77,6 +78,8 @@ public class CoreMonitoringRetrievalTaskServiceImpl extends ServiceImpl<CoreMoni
     private ITMonitoringRetrievalPlanService itMonitoringRetrievalPlanService;
     @Autowired
     private CoreMonitoringTaskRegistrationMapper coreMonitoringTaskRegistrationMapper;
+    @Autowired
+    private RemoteOrgService remoteOrgService;
 
     @Override
     public TableDataInfo selectPage(RetrievalTaskPageDto request) {
@@ -400,7 +403,37 @@ public class CoreMonitoringRetrievalTaskServiceImpl extends ServiceImpl<CoreMoni
         queryWrapper.lambda().eq(TMonitoringRetrievalPlan::getPlanStatus, 0);
         queryWrapper.lambda().eq(TMonitoringRetrievalPlan::getIsDeleted, 0);
         queryWrapper.lambda().eq(TMonitoringRetrievalPlan::getCreateType, 1);
-        List<TMonitoringRetrievalPlan> planList = itMonitoringRetrievalPlanService.list(queryWrapper);
+        List<TMonitoringRetrievalPlan> plans = itMonitoringRetrievalPlanService.list(queryWrapper);
+        List<TMonitoringRetrievalPlan> planList = new ArrayList<>(16);
+        for (TMonitoringRetrievalPlan p : plans) {
+            SysOrg sysOrg = new SysOrg();
+            sysOrg.setPath(p.getOrgPath());
+            sysOrg.setType(Integer.valueOf(p.getOrgType()));
+            List<SysOrg> sysOrgs = remoteOrgService.listByParentIdAndType(sysOrg, SecurityConstants.INNER);
+            for (SysOrg s : sysOrgs) {
+                TMonitoringRetrievalPlan plan = new TMonitoringRetrievalPlan();
+                BeanUtils.copyProperties(p, plan);
+                plan.setPlanName(p.getPlanName());
+                plan.setOrgId(s.getId());
+                plan.setOrgName(s.getShortName());
+                plan.setRoleId(p.getRoleId());
+                plan.setRoleName(p.getRoleName());
+                plan.setOrgPath(s.getPath());
+                plan.setOrgType(p.getOrgType());
+                plan.setPlanCycle(p.getPlanCycle());
+                plan.setPlanFrequency(p.getPlanFrequency());
+                plan.setPlanStatus(0);
+                plan.setCreateBy(SecurityUtils.getUsername());
+                plan.setUpdateTime(DateUtils.getNowDate());
+                plan.setUpdateBy(SecurityUtils.getUsername());
+                plan.setCreateTime(DateUtils.getNowDate());
+                plan.setDescription(p.getDescription());
+                plan.setCreateType(1);
+                plan.setParentId(p.getId());
+                plan.setIsDistribute("1");
+                planList.add(plan);
+            }
+        }
         //按计划生成任务
         for (TMonitoringRetrievalPlan plan : planList) {
             //获取计划关联的机构
@@ -468,7 +501,11 @@ public class CoreMonitoringRetrievalTaskServiceImpl extends ServiceImpl<CoreMoni
         }*/
         CoreMonitoringRetrievalTask task = new CoreMonitoringRetrievalTask();
         task.setId(IdWorker.getId());
-        task.setTaskName(plan.getPlanName() + "第" + frequency + "次调阅");
+        if (frequency>1){
+            task.setTaskName(plan.getPlanName() + "第" + frequency + "次调阅");
+        }else {
+            task.setTaskName(plan.getPlanName() +"调阅任务");
+        }
         task.setCycle(plan.getPlanCycle());
         task.setOrgId(sysOrg.getId());
         task.setOrgPath(sysOrg.getPath());

+ 28 - 13
soc-modules/soc-modules-core/src/main/resources/mapper/access/TMonitoringRetrievalPlanMapper.xml

@@ -27,7 +27,7 @@
     </resultMap>
 
     <sql id="selectTMonitoringRetrievalPlanVo">
-        select id,create_type,start_time,end_time, 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
+        select id,create_type,start_time,end_time, 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,immediately
         from core_monitoring_retrieval_plan
     </sql>
 
@@ -78,35 +78,50 @@
     </select>
     <select id="selectPageList" resultType="com.xunmei.core.access.vo.TMonitoringRetrievalPlanVO">
         SELECT
-            *
+        IFNULL( b.org_id, a.org_id ) AS parentOrgId,
+        a.id,
+        a.plan_name,
+        a.org_id,
+        a.org_name,
+        a.org_type,
+        a.role_id,
+        a.role_name,
+        a.plan_cycle,
+        a.start_time,
+        a.plan_frequency,
+        a.plan_status,
+        a.end_time,
+        a.description,
+        a.is_distribute
         FROM
-            core_monitoring_retrieval_plan
+        core_monitoring_retrieval_plan a
+        LEFT JOIN core_monitoring_retrieval_plan b ON a.parent_id = b.id
         WHERE
-            is_deleted=0
+        a.is_deleted =0
         <if test="request.planName != null  and request.planName != ''">
-            AND    plan_name like concat('%', #{request.planName}, '%')
+            AND        a.plan_name like concat('%', #{request.planName}, '%')
         </if>
         <if test="request.orgId != null  and request.orgId != ''">
-            AND    org_id = #{request.orgId}
+            AND        a.org_id = #{request.orgId}
         </if>
 
         <if test="request.orgPath != null  and request.orgPath != ''">
-            and  org_path like concat( #{request.orgPath}, '%')
+            and      a.org_path like concat( #{request.orgPath}, '%')
         </if>
         <if test="request.orgType != null  and request.orgType != ''">
-            AND    org_type = #{request.orgType}
+            AND        a.org_type = #{request.orgType}
         </if>
         <if test="request.roleId != null  and request.roleId != ''">
-            AND    role_id = #{request.roleId}
+            AND        a.role_id = #{request.roleId}
         </if>
         <if test="request.planCycle != null  and request.planCycle != ''">
-            AND    plan_cycle = #{request.planCycle}
+            AND        a.plan_cycle = #{request.planCycle}
         </if>
         <if test="request.planStatus != null  and request.planStatus != ''">
-            AND    plan_status = #{request.planStatus}
+            AND        a.plan_status = #{request.planStatus}
         </if>
-        ORDER BY parent_id ASC,
-        create_time desc
+        ORDER BY     a.parent_id ASC,
+        a.create_time desc
     </select>
 
     <insert id="insertTMonitoringRetrievalPlan" parameterType="com.xunmei.core.access.domain.TMonitoringRetrievalPlan">

+ 8 - 1
soc-modules/soc-modules-core/src/main/resources/mapper/retrieval/CoreMonitoringRetrievalTaskMapper.xml

@@ -110,10 +110,17 @@
         <if test="request.cycle != null ">
             and a.cycle = #{request.cycle}
         </if>
-        <if test="request.dateRange != null and request.dateRange.length>0">
+<!--        <if test="request.dateRange != null and request.dateRange.length>0">
             and a.ymd_date >= #{request.dateRange[0]}
             and #{request.dateRange[1]}>=a.ymd_date
+        </if>-->
+        <if test="request.dateRange != null and request.dateRange.length>0">
+            and a.plan_start_time BETWEEN #{request.dateRange[0]}
+            and #{request.dateRange[1]}
+           OR a.plan_end_time BETWEEN #{request.dateRange[0]}
+            and #{request.dateRange[1]}
         </if>
+
         <if test="request.status != null ">
             and a.status = #{request.status}
         </if>