gongdecai 3 年之前
父节点
当前提交
95d7e87240

+ 60 - 2
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/CollectionWarehousingRecordController.java

@@ -1,9 +1,16 @@
 package com.yh.saas.plugin.yiliangyiyun.controller;
 
 
-import org.springframework.web.bind.annotation.RequestMapping;
+import com.baomidou.mybatisplus.plugins.Page;
+import com.yh.saas.plugin.yiliangyiyun.entity.CollectionWarehousingRecord;
+import com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo;
+import com.yh.saas.plugin.yiliangyiyun.service.ICollectionWarehousingRecordService;
+import com.yh.saas.plugin.yiliangyiyun.service.IContractManagementInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
 
-import org.springframework.web.bind.annotation.RestController;
+import javax.validation.Valid;
+import java.util.List;
 
 /**
  * <p>
@@ -17,5 +24,56 @@ import org.springframework.web.bind.annotation.RestController;
 @RequestMapping("/collectionWarehousingRecord")
 public class CollectionWarehousingRecordController {
 
+    @Autowired
+    private ICollectionWarehousingRecordService collectionWarehousingRecordService;
+
+    /**
+     * 新增信息
+     */
+    @PostMapping("/api/insertCollectionWarehousingRecord")
+    public String insertCollectionWarehousingRecord(@RequestBody @Valid CollectionWarehousingRecord collectionWarehousingRecord) {
+        return collectionWarehousingRecordService.insertCollectionWarehousingRecord(collectionWarehousingRecord);
+    }
+
+    /**
+     * 编辑合同信息
+     */
+    @PostMapping("/editCollectionWarehousingRecord")
+    public String editCollectionWarehousingRecord(@RequestBody CollectionWarehousingRecord collectionWarehousingRecord) {
+        return collectionWarehousingRecordService.editCollectionWarehousingRecord(collectionWarehousingRecord);
+    }
+
+    /**
+     * 查看信息
+     */
+    @GetMapping("/getCollectionWarehousingRecord")
+    public CollectionWarehousingRecord getCollectionWarehousingRecord(@RequestParam String id) {
+        return collectionWarehousingRecordService.getCollectionWarehousingRecord(id);
+    }
+
+    /**
+     * 信息分页列表查询
+     *
+     * @param collectionWarehousingRecord
+     * @return
+     */
+    @GetMapping("/selectCollectionWarehousingRecordPage")
+    public Page<CollectionWarehousingRecord> selectCollectionWarehousingRecordPage(CollectionWarehousingRecord collectionWarehousingRecord) {
+        return collectionWarehousingRecordService.selectCollectionWarehousingRecordPage(collectionWarehousingRecord);
+    }
+
+
+
+
+    /**
+     * 删除
+     *
+     * @param example
+     * @return
+     */
+    @PostMapping("/deleteCollectionWarehousingRecord")
+    public void deleteCollectionWarehousingRecord(@RequestBody  CollectionWarehousingRecord example) {
+        collectionWarehousingRecordService.deleteCollectionWarehousingRecord(example.getId());
+    }
 }
 

+ 35 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/CollectionWarehousingRecord.java

@@ -3,16 +3,20 @@ package com.yh.saas.plugin.yiliangyiyun.entity;
 import java.util.Date;
 import com.baomidou.mybatisplus.activerecord.Model;
 import java.io.Serializable;
+import java.util.List;
 
+import com.baomidou.mybatisplus.annotations.TableField;
 import com.baomidou.mybatisplus.annotations.TableId;
 import com.baomidou.mybatisplus.annotations.TableName;
 import com.baomidou.mybatisplus.annotations.Version;
 
 import com.baomidou.mybatisplus.enums.IdType;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.yh.saas.common.support.entity.BaseModel;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
+import org.springframework.format.annotation.DateTimeFormat;
 
 /**
  * <p>
@@ -171,7 +175,37 @@ public class CollectionWarehousingRecord extends BaseModel<CollectionWarehousing
      * 审核流id
      */
     private String workflowId;
-
+    @TableField(exist = false)
+    private String taskId;
+    /**
+     *查询类型
+     */
+    @TableField(exist = false)
+    private String searchType;
+    /**
+     * 模糊查询
+     */
+    @TableField(exist = false)
+    private String searchKeyWord;
+    /**
+     * 开始时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @TableField(exist = false)
+    private Date startDate;
+    /**
+     * 结束时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @TableField(exist = false)
+    private Date endDate;
+    /**
+     * 批量
+     */
+    @TableField(exist = false)
+    private List<CollectionWarehousingRecord> collectionWarehousingRecords;
 
     @Override
     protected Serializable pkVal() {

+ 19 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/CollectionWarehousingRecordMapper.java

@@ -2,6 +2,10 @@ package com.yh.saas.plugin.yiliangyiyun.mapper;
 
 import com.yh.saas.plugin.yiliangyiyun.entity.CollectionWarehousingRecord;
 import com.baomidou.mybatisplus.mapper.BaseMapper;
+import com.yh.saas.plugin.yiliangyiyun.entity.SalesDeliveryReport;
+
+import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -13,4 +17,19 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
  */
 public interface CollectionWarehousingRecordMapper extends BaseMapper<CollectionWarehousingRecord> {
 
+    /**
+     * 根据条件查询总数
+     *
+     * @param pageView
+     * @return
+     */
+    Integer getCountByCondition(Map<String, Object> pageView);
+
+    /**
+     * 根据条件查询列表
+     *
+     * @param pageView
+     * @return
+     */
+    List<CollectionWarehousingRecord> getListByCondition(Map<String, Object> pageView);
 }

+ 8 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/ICollectionWarehousingRecordService.java

@@ -1,5 +1,6 @@
 package com.yh.saas.plugin.yiliangyiyun.service;
 
+import com.baomidou.mybatisplus.plugins.Page;
 import com.yh.saas.plugin.yiliangyiyun.entity.CollectionWarehousingRecord;
 import com.baomidou.mybatisplus.service.IService;
 
@@ -13,4 +14,11 @@ import com.baomidou.mybatisplus.service.IService;
  */
 public interface ICollectionWarehousingRecordService extends IService<CollectionWarehousingRecord> {
 
+
+
+    Page<CollectionWarehousingRecord> selectCollectionWarehousingRecordPage(CollectionWarehousingRecord collectionWarehousingRecord);
+    String insertCollectionWarehousingRecord(CollectionWarehousingRecord collectionWarehousingRecord);
+    void deleteCollectionWarehousingRecord(String id);
+    String editCollectionWarehousingRecord(CollectionWarehousingRecord collectionWarehousingRecord);
+    CollectionWarehousingRecord getCollectionWarehousingRecord(String id);
 }

+ 223 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/CollectionWarehousingRecordServiceImpl.java

@@ -1,10 +1,37 @@
 package com.yh.saas.plugin.yiliangyiyun.service.impl;
 
+import com.alibaba.fastjson.JSONObject;
+import com.alipay.sofa.runtime.api.annotation.SofaReference;
+import com.baomidou.mybatisplus.plugins.Page;
+import com.google.common.collect.Lists;
+import com.winsea.svc.base.base.entity.CommonRoleResource;
+import com.winsea.svc.base.base.service.ICommonRoleResourceService;
+import com.winsea.svc.base.security.entity.User;
+import com.winsea.svc.base.security.util.AuthSecurityUtils;
+import com.winsea.svc.base.workflow.entity.Workflow;
+import com.yh.saas.common.support.util.IdGenerator;
+import com.yh.saas.plugin.yiliangyiyun.constant.NumberConstant;
+import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.CollectionWarehousingRecord;
+import com.yh.saas.plugin.yiliangyiyun.entity.SalePlanInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.SalesDeliveryReport;
+import com.yh.saas.plugin.yiliangyiyun.exception.YException;
+import com.yh.saas.plugin.yiliangyiyun.exception.YExceptionEnum;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CollectionWarehousingRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.ICollectionWarehousingRecordService;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import com.yh.saas.plugin.yiliangyiyun.service.INewWorkflowService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -17,4 +44,200 @@ import org.springframework.stereotype.Service;
 @Service
 public class CollectionWarehousingRecordServiceImpl extends ServiceImpl<CollectionWarehousingRecordMapper, CollectionWarehousingRecord> implements ICollectionWarehousingRecordService {
 
+    @Autowired
+    private INewWorkflowService workflowService;
+    @SofaReference
+    private ICommonRoleResourceService roleResourceService;
+
+
+    /**
+     * 销售出库统计列表
+     *
+     * @param collectionWarehousingRecord
+     */
+    @Override
+    public Page<CollectionWarehousingRecord> selectCollectionWarehousingRecordPage(CollectionWarehousingRecord collectionWarehousingRecord) {
+        Map<String, Object> pageView = new HashMap<>();
+        pageView.put("startRecord", (collectionWarehousingRecord.getCurrentPage() - 1)
+                * collectionWarehousingRecord.getPageSize());
+        List<String> businessKeys = null;
+        if ("2".equals(collectionWarehousingRecord.getSearchType())) {
+            businessKeys = workflowService.getTaskBusinessKeysByCode("COLLECTION-WAREHOUSING-RECORD");
+        }
+        List<String> statusSet = new ArrayList<>();
+        List<String> resourceIdList = this.getResourceIdList();
+        if (resourceIdList.contains("saleOutReport-Edit")) { // 填写,提交    权限做完以后替换
+            List<String> statusList = Lists.newArrayList(StatusEnum.PUR_RETURN.getFlag());
+            statusSet.addAll(statusList);
+        }
+        //公司id
+        pageView.put("compId", collectionWarehousingRecord.getCompId());
+        pageView.put("searchKeyWord", collectionWarehousingRecord.getSearchKeyWord());
+        pageView.put("searchType", collectionWarehousingRecord.getSearchType());
+        pageView.put("pageSize", collectionWarehousingRecord.getPageSize());
+        pageView.put("currentPage", collectionWarehousingRecord.getCurrentPage());
+        pageView.put("contractNo", collectionWarehousingRecord.getContractNo());
+        pageView.put("businessKeys", businessKeys);
+        pageView.put("statusSet", statusSet);
+        // 查询总数
+        Integer dataCount = baseMapper.getCountByCondition(pageView);
+        List<CollectionWarehousingRecord> dataList = baseMapper.getListByCondition(pageView);
+        if (!CollectionUtils.isEmpty(dataList)) {
+            dataList.forEach(collectionWarehousingRecord1 -> {
+
+                String taskId = "";
+                // 只有待审核状态才有taskId
+                if (StringUtils.isNotBlank(collectionWarehousingRecord1.getWorkflowId())) {
+                    JSONObject jsonObject = workflowService.getActiveTask(Lists.newArrayList(collectionWarehousingRecord1.getWorkflowId()), collectionWarehousingRecord1.getId());
+                    taskId = jsonObject.getString("taskId");
+                    collectionWarehousingRecord1.setTaskId(taskId);
+                }
+            });
+
+        }
+        Page<CollectionWarehousingRecord> page = new Page<>();
+        page.setRecords(dataList == null ? Lists.newArrayList() : dataList);
+        page.setTotal(dataCount == null ? 0 : dataCount);
+        page.setCurrent(collectionWarehousingRecord.getCurrentPage());
+        page.setSize(collectionWarehousingRecord.getPageSize());
+        return page;
+    }
+
+
+
+
+    private List<String> getResourceIdList() {
+        User currentUser = AuthSecurityUtils.getCurrentUserInfo();
+        // 当前登录人主要角色
+        return roleResourceService.getBindResourcesByUserId(currentUser.getUserId()).stream()
+                .map(CommonRoleResource::getResourceId).collect(Collectors.toList());
+
+    }
+    /**
+     * 添加代售合同入库记录
+     *
+     * @param collectionWarehousingRecord
+     * @return
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public String insertCollectionWarehousingRecord(CollectionWarehousingRecord collectionWarehousingRecord) {
+
+        List<CollectionWarehousingRecord> collectionWarehousingRecord1 = collectionWarehousingRecord.getCollectionWarehousingRecords();
+        if(!CollectionUtils.isEmpty(collectionWarehousingRecord1)){
+            for(int i =0;i<collectionWarehousingRecord1.size();i++){
+                CollectionWarehousingRecord warehousingRecord = collectionWarehousingRecord1.get(i);
+                //新增主键id
+                warehousingRecord.setId(IdGenerator.generateUUID());
+                this.insert(warehousingRecord);
+
+                boolean isStartWorkflow = org.apache.commons.lang3.StringUtils.isBlank(warehousingRecord.getWorkflowId());
+                // 不是退回的单子
+                if (isStartWorkflow) {
+                    Workflow workflow = workflowService
+                            .findLatestWorkflowByBusinessCodeByApp(warehousingRecord.getCompId(), "COLLECTION-WAREHOUSING-RECORD");
+                    // 没配置审核流程,直接结束并处理信息
+                    if (workflow == null) {
+                        throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
+                    }
+                    // 开启审核流
+                    else {
+
+                        // 设置状态 已提交审核
+                        warehousingRecord.setWorkflowId(workflow.getId());
+                        this.updateById(warehousingRecord);
+                        workflowService.startInstance(workflow.getId(), warehousingRecord.getId());
+                    }
+                }
+                // 退回的单子 再启用
+                else {
+
+                    this.updateById(warehousingRecord);
+                    workflowService.activateInstance(warehousingRecord.getWorkflowId(), warehousingRecord.getId());
+                }
+            }
+
+        }
+//        // 插入操作历史
+//        String staffName = this.billOperateHisService.getStaffAndName();
+        // 插入操作历史
+//        this.billOperateHisService.saveBillOperateHis(salePlanInfo.getId(), NumberConstant.CONSTANT_PURCHASE, staffName, null,
+//                salePlanInfo.getStatus(), null, "");
+        return "OK";
+    }
+
+    /**
+     * 删除
+     *
+     * @param id
+     * @return
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void deleteCollectionWarehousingRecord(String id) {
+        //查询销售计划信息
+        CollectionWarehousingRecord collectionWarehousingRecord = this.selectById(id);
+        if (collectionWarehousingRecord != null) {
+            //删除销售计划信息
+            this.deleteById(collectionWarehousingRecord.getId());
+        }
+    }
+
+
+    /**
+     * 编辑
+     *
+     * @param collectionWarehousingRecord
+     * @return
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public String editCollectionWarehousingRecord(CollectionWarehousingRecord collectionWarehousingRecord) {
+        boolean one = this.updateById(collectionWarehousingRecord);
+        if (collectionWarehousingRecord.getStatusFlag().equals(StatusEnum.TASK_RETURN.getFlag())) {
+            boolean isStartWorkflow = org.apache.commons.lang3.StringUtils.isBlank(collectionWarehousingRecord.getWorkflowId());
+            // 不是退回的单子
+            if (isStartWorkflow) {
+                Workflow workflow = workflowService
+                        .findLatestWorkflowByBusinessCodeByApp(collectionWarehousingRecord.getCompId(), "COLLECTION-WAREHOUSING-RECORD");
+                // 没配置审核流程,直接结束并处理信息
+                if (workflow == null) {
+                    throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
+                }
+                // 开启审核流
+                else {
+
+                    // 设置状态 已提交审核
+                    collectionWarehousingRecord.setWorkflowId(workflow.getId());
+                    this.updateById(collectionWarehousingRecord);
+                    workflowService.startInstance(workflow.getId(), collectionWarehousingRecord.getId());
+                }
+            }
+            // 退回的单子 再启用
+            else {
+
+                this.updateById(collectionWarehousingRecord);
+                workflowService.activateInstance(collectionWarehousingRecord.getWorkflowId(), collectionWarehousingRecord.getId());
+            }
+        }
+        if (one) {
+            return "OK";
+        } else {
+            return "NG";
+        }
+    }
+
+    /**
+     * 查看销售计划
+     *
+     * @param id
+     * @return
+     */
+    @Override
+    public CollectionWarehousingRecord getCollectionWarehousingRecord(String id) {
+        //查看销售计划信息
+        CollectionWarehousingRecord collectionWarehousingRecord = this.selectById(id);
+        return collectionWarehousingRecord;
+    }
+
 }

+ 165 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/CollectionWarehousingRecordMapper.xml

@@ -1,5 +1,169 @@
 <?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.yh.saas.plugin.yiliangyiyun.mapper.CollectionWarehousingRecordMapper">
-
+    <!-- 获得销售出库统计总数 -->
+    <select id="getCountByCondition" parameterType="Map" resultType="java.lang.Integer">
+        SELECT
+        COUNT(id)
+        FROM collection_warehousing_record
+        WHERE
+        delete_flag = '0'
+        AND comp_id = #{compId}
+        <if test="searchType != null and searchType != ''">
+            <if test="searchType == 1">
+                AND amount_ed_payable = 0
+            </if>
+            <if test="searchType == 3">
+                AND amount_ed_payable >0
+            </if>
+            <if test="searchType == 4">
+                AND amount_ed_collectionable=0
+            </if>
+            <if test="searchType == 5">
+                AND amount_ed_collectionable>0
+            </if>
+            <if test="searchType == 6">
+                AND invoicing='0'
+            </if>
+            <if test="searchType == 7">
+                AND invoicing_sale='0'
+            </if>
+        </if>
+        <if test="contractNo != null and contractNo != ''and contractNo != '全部合同'">
+            AND contract_no = #{contractNo}
+        </if>
+        <if test="startDate != null">
+            AND (DATE_FORMAT(create_date,"%Y%m%d") &gt;=
+            DATE_FORMAT(#{startDate},"%Y%m%d"))
+        </if>
+        <if test="endDate != null">
+            AND (DATE_FORMAT(create_date,"%Y%m%d") &lt;=
+            DATE_FORMAT(#{endDate},"%Y%m%d"))
+        </if>
+        <if test="searchKeyWord != null and searchKeyWord != ''">
+            AND (lower(customer_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
+            OR lower(car_no) like lower(CONCAT('%',#{searchKeyWord},'%'))
+           )
+        </if>
+        <if test="businessKeys != null and businessKeys.size > 0">
+            and(
+            <foreach collection="businessKeys" item="businessValue" open="(" close=")" separator="or">
+                id = #{businessValue}
+            </foreach>
+            )
+        </if>
+        <if test="statusSet != null and statusSet.size > 0">
+            or (
+            <foreach collection="statusSet" item="statusId" separator="or" open="(" close=")">
+                status_flag =
+                <if test="statusId != null">
+                    #{statusId}
+                </if>
+            </foreach>
+            )
+        </if>
+    </select>
+    <!-- 获得销售出库统计列表 -->
+    <select id="getListByCondition" parameterType="Map"
+            resultType="com.yh.saas.plugin.yiliangyiyun.entity.CollectionWarehousingRecord">
+        SELECT
+        id,
+        comp_id as compId,
+        payment_no as paymentNo,
+        warehouse_name as warehouseName,
+        goods_name as goodsName,
+        car_no as carNo,
+        relation_id as relationId,
+        type,
+        contract_no as contractNo,
+        net_weight as netWeight,
+        invoicing_sale as invoicingSale,
+        tare,
+        unit_deduction as unitDeduction,
+        unit_have as unithave,
+        solid_grain_price as solidGrainPrice,
+        amount_ing_payable as amountIngPayable,
+        amount_ed_payable as amountEdPayable,
+        amount_not_payable as amountNotPayable,
+        remarks,
+        payment_screenshot as paymentScreenshot,
+        collection_screenshot as collectionScreenshot,
+        amount_ed_collectionable as amountEdCollectionable,
+        amount_not_collectable as amountNotCollectable,
+        customer_name as customerName,
+        customer_phone as customerPhone,
+        collection_date as collectionDate,
+        status,
+        picture_address as pictureAddress,
+        approve_status as approveStatus,
+        status_flag as statusFlag,
+        update_date as updateDate,
+        workflow_id as workflowId,
+        create_date as createDate,
+        unit_deduction as unitDeduction,
+        picture_address as pictureAddress,
+        invoicing,
+        grade,
+        FROM collection_warehousing_record
+        WHERE
+        delete_flag = '0'
+        AND comp_id = #{compId}
+        <if test="searchType != null and searchType != ''">
+            <if test="searchType == 1">
+                AND amount_ed_payable = 0
+            </if>
+            <if test="searchType == 3">
+                AND amount_ed_payable >0
+            </if>
+            <if test="searchType == 4">
+                AND amount_ed_collectionable=0
+            </if>
+            <if test="searchType == 5">
+                AND amount_ed_collectionable>0
+            </if>
+            <if test="searchType == 6">
+                AND invoicing='0'
+            </if>
+            <if test="searchType == 7">
+                AND invoicing_sale='0'
+            </if>
+        </if>
+        <if test="contractNo != null and contractNo != ''and contractNo != '全部合同'">
+            AND contract_no = #{contractNo}
+        </if>
+        <if test="startDate != null">
+            AND (DATE_FORMAT(create_date,"%Y%m%d") &gt;=
+            DATE_FORMAT(#{startDate},"%Y%m%d"))
+        </if>
+        <if test="endDate != null">
+            AND (DATE_FORMAT(create_date,"%Y%m%d") &lt;=
+            DATE_FORMAT(#{endDate},"%Y%m%d"))
+        </if>
+        <if test="searchKeyWord != null and searchKeyWord != ''">
+            AND (lower(customer_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
+            OR lower(car_no) like lower(CONCAT('%',#{searchKeyWord},'%'))
+            )
+        </if>
+        <if test="businessKeys != null and businessKeys.size > 0">
+            and(
+            <foreach collection="businessKeys" item="businessValue" open="(" close=")" separator="or">
+                id = #{businessValue}
+            </foreach>
+            )
+        </if>
+        <if test="statusSet != null and statusSet.size > 0">
+            or (
+            <foreach collection="statusSet" item="statusId" separator="or" open="(" close=")">
+                status_flag =
+                <if test="statusId != null">
+                    #{statusId}
+                </if>
+            </foreach>
+            )
+        </if>
+        ORDER BY update_date DESC
+        <if test="currentPage != null and currentPage != ''">
+            LIMIT ${startRecord}, ${pageSize}
+        </if>
+    </select>
 </mapper>