Browse Source

[chg]维保计划查询列表接口

别傲 5 years ago
parent
commit
841691c42b
14 changed files with 255 additions and 81 deletions
  1. 57 0
      lift-business-service/src/main/java/cn/com/ty/lift/business/common/CommonController.java
  2. 0 14
      lift-business-service/src/main/java/cn/com/ty/lift/business/library/controller/LiftController.java
  3. 7 2
      lift-business-service/src/main/java/cn/com/ty/lift/business/library/dao/entity/ProjectLiftRelevance.java
  4. 0 11
      lift-business-service/src/main/java/cn/com/ty/lift/business/library/service/LiftService.java
  5. 1 1
      lift-business-service/src/main/java/cn/com/ty/lift/business/library/service/ProjectLiftRelevanceService.java
  6. 14 2
      lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/controller/MaintenanceController.java
  7. 0 10
      lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/dao/entity/MaintenancePlan.java
  8. 46 1
      lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/dao/entity/model/MaintenancePlanRequest.java
  9. 48 0
      lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/dao/entity/model/MaintenancePlanResponse.java
  10. 1 1
      lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/dao/entity/model/UpdateMaintenancePlanReq.java
  11. 38 9
      lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/service/MaintenancePlanService.java
  12. 0 15
      lift-business-service/src/main/java/cn/com/ty/lift/business/project/controller/ProjectController.java
  13. 0 15
      lift-business-service/src/main/java/cn/com/ty/lift/business/project/service/ProjectService.java
  14. 43 0
      lift-business-service/src/main/resources/mapper/maintenance/MaintenancePlanMapper.xml

+ 57 - 0
lift-business-service/src/main/java/cn/com/ty/lift/business/common/CommonController.java

@@ -0,0 +1,57 @@
+package cn.com.ty.lift.business.common;
+
+import cn.com.ty.lift.business.framework.util.MessageUtils;
+import cn.com.ty.lift.business.library.dao.entity.LiftBrand;
+import cn.com.ty.lift.common.constants.ApiConstants;
+import cn.com.ty.lift.common.constants.RedisConstants;
+import cn.com.ty.lift.common.model.AreaCode;
+import cn.com.xwy.boot.web.dto.RestResponse;
+import cn.hutool.core.util.ObjectUtil;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * @author bieao
+ * @date 2019/12/19
+ * @description 公共初始化数据
+ */
+@RestController
+@RequestMapping("common")
+public class CommonController {
+
+    @Resource
+    private RedisTemplate redisTemplate;
+
+    /**
+     * @return RestResponse 省、市、区树形结构列表
+     * @description 查询省、市、区树形结构列表
+     * @date 2019/12/4 10:23 AM
+     */
+    @PostMapping("area/list")
+    public RestResponse areaList() {
+        List<AreaCode> areaCodeList = (List<AreaCode>) redisTemplate.opsForValue().get(RedisConstants.RK_AREA_LIST);
+        if (ObjectUtil.isEmpty(areaCodeList)) {
+            return RestResponse.ok(null, ApiConstants.RESULT_NO_DATA, MessageUtils.get("msg.data.empty"));
+        }
+        return RestResponse.ok(areaCodeList, ApiConstants.RESULT_SUCCESS, MessageUtils.get("msg.query.success"));
+    }
+
+    /**
+     * @return RestResponse 电梯品牌列表
+     * @description 查询电梯品牌列表
+     * @date 2019/12/10 10:23 AM
+     */
+    @PostMapping("brand/list")
+    public RestResponse list(){
+        List<LiftBrand> liftBrandList = (List<LiftBrand>) redisTemplate.opsForValue().get(RedisConstants.RK_LIFT_BRAND_LIST);
+        if (ObjectUtil.isEmpty(liftBrandList)) {
+            return RestResponse.ok(null, ApiConstants.RESULT_NO_DATA, MessageUtils.get("msg.data.empty"));
+        }
+        return RestResponse.ok(liftBrandList, ApiConstants.RESULT_SUCCESS, MessageUtils.get("msg.query.success"));
+    }
+}

+ 0 - 14
lift-business-service/src/main/java/cn/com/ty/lift/business/library/controller/LiftController.java

@@ -51,20 +51,6 @@ public class LiftController {
         return RestResponse.ok(page, ApiConstants.RESULT_SUCCESS, MessageUtils.get("msg.query.success"));
     }
 
-    /**
-     * @return RestResponse 电梯品牌列表
-     * @description 查询电梯品牌列表
-     * @date 2019/12/10 10:23 AM
-     */
-    @PostMapping("brand/list")
-    public RestResponse list(){
-        List<LiftBrand> liftBrandList = liftService.list();
-        if (ObjectUtil.isEmpty(liftBrandList)) {
-            return RestResponse.ok(null, ApiConstants.RESULT_NO_DATA, MessageUtils.get("msg.data.empty"));
-        }
-        return RestResponse.ok(liftBrandList, ApiConstants.RESULT_SUCCESS, MessageUtils.get("msg.query.success"));
-    }
-
     /**
      * @param request 电梯列表查询条件
      * @return RestResponse 项目下电梯列表

+ 7 - 2
lift-business-service/src/main/java/cn/com/ty/lift/business/library/dao/entity/ProjectLiftRelevance.java

@@ -34,9 +34,14 @@ public class ProjectLiftRelevance {
     private Long relevanceId;
 
     /**
-     * 用户ID(维保负责人)
+     * 维保工id
      */
-    private Long userId;
+    private Long workerId;
+
+    /**
+     * 公司id
+     */
+    private Long companyId;
 
     /**
      * 是否锁定 0否 1是

+ 0 - 11
lift-business-service/src/main/java/cn/com/ty/lift/business/library/service/LiftService.java

@@ -2,7 +2,6 @@ package cn.com.ty.lift.business.library.service;
 
 import cn.com.ty.lift.business.framework.util.MessageUtils;
 import cn.com.ty.lift.business.library.dao.entity.Lift;
-import cn.com.ty.lift.business.library.dao.entity.LiftBrand;
 import cn.com.ty.lift.business.library.dao.entity.LiftExtension;
 import cn.com.ty.lift.business.library.dao.entity.PlatformCompanyLiftRelevance;
 import cn.com.ty.lift.business.library.dao.entity.model.LiftExtensionRequest;
@@ -14,7 +13,6 @@ import cn.com.ty.lift.business.maintenance.dao.entity.MaintenanceCompany;
 import cn.com.ty.lift.business.maintenance.service.MaintenanceService;
 import cn.com.ty.lift.common.base.ExportRequest;
 import cn.com.ty.lift.common.constants.ApiConstants;
-import cn.com.ty.lift.common.constants.RedisConstants;
 import cn.com.ty.lift.common.export.ExportUtils;
 import cn.com.ty.lift.common.utils.DateUtils;
 import cn.com.xwy.boot.web.dto.RestResponse;
@@ -72,15 +70,6 @@ public class LiftService {
         return liftMapper.findByCondition(page, request);
     }
 
-    /**
-     * @return List<LiftBrand> 电梯品牌列表
-     * @description 查询电梯品牌列表
-     * @date 2019/12/10 10:23 AM
-     */
-    public List<LiftBrand> list() {
-        return (List<LiftBrand>) redisTemplate.opsForValue().get(RedisConstants.RK_LIFT_BRAND_LIST);
-    }
-
     /**
      * @param request 电梯列表查询条件
      * @return IPage<LiftResponse> 项目下电梯列表

+ 1 - 1
lift-business-service/src/main/java/cn/com/ty/lift/business/library/service/ProjectLiftRelevanceService.java

@@ -47,7 +47,7 @@ public class ProjectLiftRelevanceService extends ServiceImpl<ProjectLiftRelevanc
         projectLiftEntry.setProjectId(extension.getProjectId());
         projectLiftEntry.setLiftId(extension.getId());
         projectLiftEntry.setRelevanceId(id);
-        projectLiftEntry.setUserId(workerId);
+        projectLiftEntry.setWorkerId(workerId);
         return save(projectLiftEntry);
     }
 

+ 14 - 2
lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/controller/MaintenanceController.java

@@ -5,6 +5,7 @@ import cn.com.ty.lift.business.maintenance.dao.entity.model.BatchMaintenancePlan
 import cn.com.ty.lift.business.maintenance.dao.entity.model.MaintenancePlanRequest;
 import cn.com.ty.lift.business.maintenance.dao.entity.model.UpdateMaintenancePlanReq;
 import cn.com.ty.lift.business.maintenance.service.MaintenancePlanService;
+import cn.com.ty.lift.common.base.ExportRequest;
 import cn.com.ty.lift.common.constants.ApiConstants;
 import cn.com.xwy.boot.web.dto.RestResponse;
 import cn.hutool.core.util.ObjectUtil;
@@ -36,7 +37,7 @@ public class MaintenanceController {
      */
     @PostMapping("generate/plan")
     public RestResponse generatePlan(@RequestBody MaintenancePlanRequest request) {
-        boolean result = maintenancePlanService.insertBatch(request.getPlanList());
+        boolean result = maintenancePlanService.insertBatch(request);
         if (result) {
             return RestResponse.ok(null, ApiConstants.RESULT_SUCCESS, MessageUtils.get("msg.add.success"));
         } else {
@@ -47,7 +48,7 @@ public class MaintenanceController {
     /**
      * @param request 电梯列表
      * @return 1.成功, 0.失败, 消息描述
-     * @description 制定维保计划
+     * @description 修改维保计划
      * @date 2019/12/16 2:36 PM
      */
     @PostMapping("modify/plan")
@@ -79,4 +80,15 @@ public class MaintenanceController {
             return RestResponse.error(ApiConstants.RESULT_ERROR, MessageUtils.get("msg.modify.fail"));
         }
     }
+
+    /**
+     * @param request 导出项目数据列表
+     * @return 1.成功, 0.失败, 消息描述
+     * @description 导出维保计划
+     * @date 2019/12/19 11:28 AM
+     */
+    @PostMapping("export/plan")
+    public void export(@RequestBody ExportRequest request) {
+        maintenancePlanService.export(request);
+    }
 }

+ 0 - 10
lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/dao/entity/MaintenancePlan.java

@@ -63,14 +63,4 @@ public class MaintenancePlan {
      * 状态 0:待完成,1:已完成,2:超期
      */
 	private Byte status;
-
-    /**
-     * 间隔 1-15
-     */
-    private Integer interval;
-
-    /**
-     * 期数 1-24
-     */
-    private Integer periods;
 }

+ 46 - 1
lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/dao/entity/model/MaintenancePlanRequest.java

@@ -8,7 +8,7 @@ import java.util.List;
 /**
  * @author bieao
  * @date 2019/12/16
- * @description
+ * @description 维保计划列表请求体
  */
 @Data
 public class MaintenancePlanRequest {
@@ -16,4 +16,49 @@ public class MaintenancePlanRequest {
      * 电梯列表
      */
     private List<MaintenancePlan> planList;
+    /**
+     * 项目id
+     */
+    private Long projectId;
+    /**
+     * 区域id
+     */
+    private Long regionId;
+    /**
+     * 维保工id
+     */
+    private String workerId;
+    /**
+     * 维保公司id
+     */
+    private String mtCompanyId;
+    /**
+     * 维保间隔 1-15
+     */
+    private Integer planInterval;
+    /**
+     * 开始时间
+     */
+    private String beginTime;
+    /**
+     * 结束时间
+     */
+    private String endTime;
+    /**
+     * 电梯注册代码
+     */
+    private String registrationCode;
+
+    /**
+     * 首保时间
+     */
+    private String firstTime;
+    /**
+     * 期数 1-24
+     */
+    private Integer periods;
+    /**
+     * 间隔 1-15
+     */
+    private Integer interval;
 }

+ 48 - 0
lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/dao/entity/model/MaintenancePlanResponse.java

@@ -0,0 +1,48 @@
+package cn.com.ty.lift.business.maintenance.dao.entity.model;
+
+import lombok.Data;
+
+/**
+ * @author bieao
+ * @date 2019/12/19
+ * @description 维保计划列表返回体
+ */
+@Data
+public class MaintenancePlanResponse {
+    /**
+     * 维保计划id
+     */
+    private Long id;
+    /**
+     * 电梯id
+     */
+    private Long liftId;
+    /**
+     * 计划保养时间
+     */
+    private String planDate;
+    /**
+     * 电梯注册代码
+     */
+    private String registrationCode;
+    /**
+     * 电梯位置
+     */
+    private String devicePosition;
+    /**
+     * 项目名称
+     */
+    private String projectName;
+    /**
+     * 项目编号
+     */
+    private String projectCode;
+    /**
+     * 电梯状态
+     */
+    private String liftStatus;
+    /**
+     * 区域名称
+     */
+    private String regionName;
+}

+ 1 - 1
lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/dao/entity/model/UpdateMaintenancePlanReq.java

@@ -7,7 +7,7 @@ import java.util.Date;
 /**
  * @author bieao
  * @date 2019/12/16
- * @description
+ * @description 修改维保计划请求
  */
 @Data
 public class UpdateMaintenancePlanReq {

+ 38 - 9
lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/service/MaintenancePlanService.java

@@ -2,10 +2,13 @@ package cn.com.ty.lift.business.maintenance.service;
 
 import cn.com.ty.lift.business.maintenance.dao.entity.MaintenancePlan;
 import cn.com.ty.lift.business.maintenance.dao.entity.model.BatchMaintenancePlanRequest;
+import cn.com.ty.lift.business.maintenance.dao.entity.model.MaintenancePlanRequest;
 import cn.com.ty.lift.business.maintenance.dao.entity.model.UpdateMaintenancePlanReq;
 import cn.com.ty.lift.business.maintenance.dao.mapper.MaintenancePlanMapper;
 import cn.com.ty.lift.business.project.dao.entity.Project;
 import cn.com.ty.lift.business.project.service.ProjectService;
+import cn.com.ty.lift.common.base.ExportRequest;
+import cn.com.ty.lift.common.export.ExportUtils;
 import cn.hutool.core.date.DateUtil;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
@@ -29,14 +32,27 @@ public class MaintenancePlanService extends ServiceImpl<MaintenancePlanMapper, M
     @Resource
     private MaintenancePlanMapper planMapper;
 
+
+    private Map<String, String> paramMap = new HashMap<String, String>() {{
+        put("projectCode", "项目编号");
+        put("projectName", "项目名称");
+        put("regionName", "区域名称");
+        put("registrationCode", "注册代码");
+        put("devicePosition", "电梯位置");
+        put("workerName", "维保工");
+        put("", "间隔");
+        put("liftStatus", "电梯维保状态");
+        put("planDate", "计划时间");
+    }};
+
     /**
-     * @param planList 电梯列表
+     * @param request 电梯列表
      * @return 是否成功
      * @description 批量生成维保计划
      * @date 2019/12/16 2:14 PM
      */
-    public boolean insertBatch(List<MaintenancePlan> planList) {
-        List<MaintenancePlan> resultList = generatePlan(planList);
+    public boolean insertBatch(MaintenancePlanRequest request) {
+        List<MaintenancePlan> resultList = generatePlan(request);
         return saveBatch(resultList, resultList.size());
     }
 
@@ -55,12 +71,13 @@ public class MaintenancePlanService extends ServiceImpl<MaintenancePlanMapper, M
     }
 
     /**
-     * @param plans 需要保养的电梯
+     * @param request 需要保养的电梯
      * @return List<MaintenancePlan> 维保计划列表
      * @description 生成维保计划
      * @date 2019/12/16 1:21 PM
      */
-    public List<MaintenancePlan> generatePlan(List<MaintenancePlan> plans) {
+    public List<MaintenancePlan> generatePlan(MaintenancePlanRequest request) {
+        List<MaintenancePlan> plans = request.getPlanList();
         //返回维保计划列表
         List<MaintenancePlan> planList = new ArrayList<>();
         //保养类型 1.半月,2.季度,3.半年,4.全年
@@ -68,9 +85,9 @@ public class MaintenancePlanService extends ServiceImpl<MaintenancePlanMapper, M
         int times = 0;
         for (MaintenancePlan plan : plans) {
             //获取从第几期开始
-            int periods = plan.getPeriods();
+            int periods = request.getPeriods();
             //获取保养间隔
-            int interval = plan.getInterval();
+            int interval = request.getInterval();
             Project project = projectService.detail(plan.getProjectId());
             if (project != null) {
                 Date beginTime = project.getStartDate();
@@ -122,7 +139,7 @@ public class MaintenancePlanService extends ServiceImpl<MaintenancePlanMapper, M
         //获取时间间隔
         Long interval = DateUtil.betweenDay(currentTime, updateTime, false);
         int offset = interval.intValue();
-        //获取当前时间后的保养时间
+        //获取当前时间后的维保计划id列表
         List<MaintenancePlan> idList = planMapper.findIdList(currentTime);
         for (MaintenancePlan entry : idList) {
             Date planDate;
@@ -134,7 +151,7 @@ public class MaintenancePlanService extends ServiceImpl<MaintenancePlanMapper, M
             entry.setPlanDate(planDate);
             resultList.add(entry);
         }
-       return updateBatchById(resultList, resultList.size());
+        return updateBatchById(resultList, resultList.size());
     }
 
     /**
@@ -147,4 +164,16 @@ public class MaintenancePlanService extends ServiceImpl<MaintenancePlanMapper, M
         log.info("批量清空维保计划");
         return removeByIds(request.getIds());
     }
+
+    /**
+     * @param request 导出项目数据列表
+     * @return RestResponse 状态码和返回消息
+     * @description 导出维保计划
+     * @date 2019/12/19 11:27 AM
+     */
+    public void export(ExportRequest request) {
+        List<MaintenancePlan> projectList = planMapper.selectBatchIds(request.getIds());
+        ExportUtils utils = new ExportUtils();
+        utils.export(projectList, paramMap, request.getExportPath());
+    }
 }

+ 0 - 15
lift-business-service/src/main/java/cn/com/ty/lift/business/project/controller/ProjectController.java

@@ -15,7 +15,6 @@ import cn.com.ty.lift.business.project.dao.entity.model.ProjectResponse;
 import cn.com.ty.lift.business.project.service.ProjectService;
 import cn.com.ty.lift.common.base.ExportRequest;
 import cn.com.ty.lift.common.constants.ApiConstants;
-import cn.com.ty.lift.common.model.AreaCode;
 import cn.com.xwy.boot.web.dto.RestResponse;
 import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -133,20 +132,6 @@ public class ProjectController {
         return RestResponse.ok(project, ApiConstants.RESULT_SUCCESS, MessageUtils.get("msg.query.detail.success"));
     }
 
-    /**
-     * @return RestResponse 省、市、区树形结构列表
-     * @description 查询省、市、区树形结构列表
-     * @date 2019/12/4 10:23 AM
-     */
-    @PostMapping("area/list")
-    public RestResponse areaList() {
-        List<AreaCode> areaCodeList = projectService.areaList();
-        if (ObjectUtil.isEmpty(areaCodeList)) {
-            return RestResponse.ok(null, ApiConstants.RESULT_NO_DATA, MessageUtils.get("msg.data.empty"));
-        }
-        return RestResponse.ok(areaCodeList, ApiConstants.RESULT_SUCCESS, MessageUtils.get("msg.query.success"));
-    }
-
     /**
      * @param project 新增项目数据项
      * @return 1.成功, 0.失败, 消息描述

+ 0 - 15
lift-business-service/src/main/java/cn/com/ty/lift/business/project/service/ProjectService.java

@@ -13,15 +13,12 @@ import cn.com.ty.lift.business.project.dao.mapper.ProjectMapper;
 import cn.com.ty.lift.business.project.dao.mapper.ProjectUserMapper;
 import cn.com.ty.lift.common.base.ExportRequest;
 import cn.com.ty.lift.common.constants.ApiConstants;
-import cn.com.ty.lift.common.constants.RedisConstants;
 import cn.com.ty.lift.common.export.ExportUtils;
-import cn.com.ty.lift.common.model.AreaCode;
 import cn.com.ty.lift.common.utils.DateUtils;
 import cn.com.xwy.boot.web.dto.RestResponse;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -44,9 +41,6 @@ public class ProjectService {
     @Resource
     private ProjectHistoryMapper projectHistoryMapper;
 
-    @Resource
-    private RedisTemplate redisTemplate;
-
 
     private Map<String, String> paramMap = new HashMap<String, String>() {{
         put("projectCode", "项目编号");
@@ -135,15 +129,6 @@ public class ProjectService {
         return projectMapper.selectById(id);
     }
 
-    /**
-     * @return RestResponse 省、市、区树形结构列表
-     * @description 查询省、市、区树形结构列表
-     * @date 2019/12/4 10:23 AM
-     */
-    public List<AreaCode> areaList() {
-        return (List<AreaCode>) redisTemplate.opsForValue().get(RedisConstants.RK_AREA_LIST);
-    }
-
     /**
      * @param project 新增项目数据项
      * @return Integer 成功1或失败0

+ 43 - 0
lift-business-service/src/main/resources/mapper/maintenance/MaintenancePlanMapper.xml

@@ -19,6 +19,49 @@
 		status
 	</sql>
 
+	<select id="findByCondition" resultType="cn.com.ty.lift.business.maintenance.dao.entity.model.MaintenancePlanResponse" parameterType="cn.com.ty.lift.business.maintenance.dao.entity.model.MaintenancePlanRequest">
+		SELECT
+		  mp.id                    AS id,
+		  mp.plan_date             AS planDate,
+		  l.id                     AS liftId,
+		  l.registration_code      AS registrationCode,
+		  l.device_position        AS devicePosition,
+		  p.project_name           AS projectName,
+		  p.project_code           AS projectCode,
+		  pclr.lift_company_status AS liftStatus,
+		  r.area_name              AS regionName,
+		  ui.name                  AS workerName
+		FROM platform_company_lift_relevance pclr
+		LEFT JOIN maintenance_plan mp ON pclr.lift_id = mp.lift_id AND pclr.company_id = mp.mt_company_id
+		LEFT JOIN lift l ON l.id = pclr.lift_id AND l.id = mp.lift_id
+		LEFT JOIN lift_extension le ON l.id = le.id AND pclr.company_id = le.mt_company_id
+		LEFT JOIN project p ON pclr.company_id = p.mt_company_id AND mp.project_id = p.id
+		LEFT JOIN user_info ui ON le.worker_id = ui.user_id
+		LEFT JOIN region r ON p.region_id = r.id
+		WHERE 1=1
+		<if test="request.mtCompanyId!=null and request.mtCompanyId!=''">
+			AND mp.mt_company_id = #{request.mtCompanyId,jdbcType=VARCHAR}
+		</if>
+		<if test="request.projectId!=null and request.projectId!=''">
+			AND p.id = #{request.projectId,jdbcType=BIGINT}
+		</if>
+		<if test="request.workerId!=null and request.workerId!=''">
+			AND mp.worker_id = #{request.workerId,jdbcType=BIGINT}
+		</if>
+		<if test="request.regionId!=null and request.regionId!=''">
+			AND p.region_id = #{request.regionId,jdbcType=BIGINT}
+		</if>
+		<if test="request.beginTime!=null and request.beginTime!=''">
+			AND mp.plan_date > #{request.beginTime,jdbcType=VARCHAR}
+		</if>
+		<if test="request.endTime!=null and request.endTime!=''">
+			AND <![CDATA[mp.plan_date < #{request.endTime,jdbcType=VARCHAR}]]>
+		</if>
+		<if test="request.registrationCode!=null and request.registrationCode!=''">
+			AND l.registration_code like #{request.registrationCode,jdbcType=VARCHAR}
+		</if>
+	</select>
+
 	<select id="findIdList" resultMap="BaseResultMap" parameterType="java.util.Date">
 		SELECT
 		id,