Browse Source

切割机 新增可配置接口

zhangxin 5 months ago
parent
commit
18e42eb5c9

+ 2 - 1
prod-line-admin/src/main/resources/application-druid.yml

@@ -4,13 +4,14 @@ spring:
         type: com.alibaba.druid.pool.DruidDataSource
         druid:
             master:
-                driverClassName: com.mysql.cj.jdbc.Driver
+                driver-class-name: com.mysql.cj.jdbc.Driver
                 url: jdbc:mysql://121.204.164.209:3306/imes-dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                 username: imes-dev
                 password: GYESBwEaiypZXzkk
             # 从库数据源
             slave:
                 # 从数据源开关/默认关闭
+                driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
                 enabled: true
                 url: jdbc:sqlserver://47.102.130.19:1433;databaseName=HTYMS
                 username: HTYMS

+ 49 - 0
prod-line-comm/src/main/java/com/huaxia/comm/domain/imes/SysMeConfig.java

@@ -0,0 +1,49 @@
+package com.huaxia.comm.domain.imes;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.time.LocalTime;
+import java.util.Date;
+
+/**
+ * @author zx
+ * @since 2024年10月22日
+ * 切割机配置信息
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("sys_me_config")
+public class SysMeConfig implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+
+    @TableId(type = IdType.AUTO)
+    private Long id;//主键id
+
+    private String tblMachineNo;//机器编码
+
+    @JsonFormat(pattern = "HH:mm:ss")
+    private LocalTime confiTime; // 上班时间
+
+    private Double capacity;//产能
+
+    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date createTime;//创建时间
+    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date updateTime;//修改时间
+
+    private String createBy;//创建人
+
+    private String updateBy;//修改人
+}

+ 3 - 4
prod-line-imes/src/main/java/com/huaxia/imes/controller/CutpieceController.java

@@ -21,7 +21,7 @@ import java.util.List;
  * @since 2024年10月18日
  */
 @RestController
-@RequestMapping("prod/line/imes")
+@RequestMapping("open/prod/line/imes")
 @Slf4j
 public class CutpieceController extends BaseController {
 
@@ -34,10 +34,9 @@ public class CutpieceController extends BaseController {
      *
      * @return
      */
-    @PreAuthorize("@ss.hasPermi('prod:line:imes:query')")
     @GetMapping("query")
-    public R<List<Cutpiece>> query(@Validated CutpieceDTO dto) {
-        return R.ok(service.queryList(dto));
+    public R<List<Cutpiece>> query() {
+        return R.ok(service.queryList());
 
     }
 }

+ 65 - 0
prod-line-imes/src/main/java/com/huaxia/imes/controller/SysMeConfigController.java

@@ -0,0 +1,65 @@
+package com.huaxia.imes.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.huaxia.comm.domain.imes.SysMeConfig;
+import com.huaxia.imes.service.SysMeConfigService;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.core.page.TableDataInfo;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @author zx
+ * @since 2024年10月22日
+ * 雨田 可配置信息
+ */
+@RestController
+@RequestMapping("open/prod/line/imes")
+@Slf4j
+@AllArgsConstructor
+public class SysMeConfigController extends BaseController {
+
+    private SysMeConfigService service;
+
+
+    /**
+     * 查询列表
+     *
+     * @param boy
+     * @return
+     */
+    @GetMapping("/list")
+    public AjaxResult queryList(SysMeConfig boy, @RequestParam(defaultValue = "1") int page,
+                                @RequestParam(defaultValue = "10") int size) {
+        IPage<SysMeConfig> list = service.queryList(boy, page, size);
+        return AjaxResult.success(new TableDataInfo(list.getRecords(), (int) list.getTotal()));
+    }
+
+    /**
+     * 添加数据
+     *
+     * @param boy
+     * @return
+     */
+    @PostMapping("/add")
+    public R<Void> add(@RequestBody SysMeConfig boy) {
+        service.add(boy);
+        return R.ok();
+    }
+
+    /**
+     * 修改数据
+     *
+     * @param boy
+     * @return
+     */
+    @PutMapping("/update")
+    public R<Void> update(@RequestBody SysMeConfig boy) {
+        service.updateBoy(boy);
+        return R.ok();
+    }
+}

+ 13 - 2
prod-line-imes/src/main/java/com/huaxia/imes/mapper/CutpieceMapper.java

@@ -2,18 +2,29 @@ package com.huaxia.imes.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.huaxia.comm.domain.imes.Cutpiece;
-import com.huaxia.imes.dto.CutpieceDTO;
+import com.ruoyi.common.annotation.DataSource;
+import com.ruoyi.common.enums.DataSourceType;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
+import java.time.LocalDateTime;
 import java.util.List;
 
 /**
  * @author zx
  * @since 2024年10月18日
  */
+@DataSource(DataSourceType.SLAVE)
 @Mapper
 public interface CutpieceMapper extends BaseMapper<Cutpiece> {
 
 
-    List<Cutpiece> queryList(CutpieceDTO dto);
+    /*List<Cutpiece> queryList(CutpieceDTO dto);*/
+
+    /**
+     * 通过机器编号去查询数据
+     * @param cutrecordNo
+     * @return
+     */
+    Cutpiece selectBoy(@Param("tbl_machine_no")String cutrecordNo, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);
 }

+ 44 - 0
prod-line-imes/src/main/java/com/huaxia/imes/mapper/SysMeConfigMapper.java

@@ -0,0 +1,44 @@
+package com.huaxia.imes.mapper;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.huaxia.comm.domain.imes.SysMeConfig;
+import com.ruoyi.common.annotation.DataSource;
+import com.ruoyi.common.enums.DataSourceType;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author zx
+ * @since 2024年10月22日
+ */
+@Mapper
+@DataSource(DataSourceType.SLAVE)
+public interface SysMeConfigMapper extends BaseMapper<SysMeConfig> {
+
+    /**
+     * 查询列表
+     * @param boy
+     * @return
+     */
+    List<SysMeConfig> queryList(SysMeConfig boy);
+
+    /**
+     * 分页查询列表
+     * @param params
+     * @return
+     */
+    List<SysMeConfig> queryListPage(@Param("params") Map<String, Object> params);
+
+    /**
+     * 根据条件获取总记录数
+     * @param params
+     * @return
+     */
+    int countByParams(@Param("params") Map<String, Object> params);
+}

+ 45 - 41
prod-line-imes/src/main/java/com/huaxia/imes/service/CutpieceService.java

@@ -3,14 +3,16 @@ package com.huaxia.imes.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.huaxia.comm.domain.imes.Cutpiece;
-import com.huaxia.imes.dto.CutpieceDTO;
+import com.huaxia.comm.domain.imes.SysMeConfig;
 import com.huaxia.imes.mapper.CutpieceMapper;
+import com.huaxia.imes.mapper.SysMeConfigMapper;
 import com.ruoyi.common.annotation.DataSource;
 import com.ruoyi.common.enums.DataSourceType;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.Assert;
 
 import java.math.BigDecimal;
 import java.math.RoundingMode;
@@ -20,6 +22,7 @@ import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.LocalTime;
 import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -29,59 +32,57 @@ import java.util.List;
 @Service
 @Slf4j
 @AllArgsConstructor
-@DataSource(DataSourceType.SLAVE)
 @Transactional(rollbackFor = Exception.class)
+@DataSource(DataSourceType.SLAVE)
 public class CutpieceService extends ServiceImpl<CutpieceMapper, Cutpiece> implements IService<Cutpiece> {
 
     private CutpieceMapper cutpieceMapper;
 
+    private SysMeConfigMapper sysMeConfigMapper;//配置信息
+
 
     /**
      * 获取生产
      *
      * @return
      */
-    public List<Cutpiece> queryList(CutpieceDTO dto) {
-
-        //获取上班时间
-        LocalTime time = dto.getWorkTime();
-        //获取目标产能
-        double targetCapacity = dto.getTargetCapacity();
-        // 获取当前日期
-        LocalDate currDate = LocalDate.now();
-        //减三天 todo(用来获取测试数据)
-        currDate = currDate.minusDays(3);
-
-        // 当天零点零分
-        LocalDateTime startTime = currDate.atTime(LocalTime.MIN);
-        //获取当天 23:59:59
-        LocalDateTime endTime = currDate.atTime(LocalTime.MAX);
-        if (dto.getWorkStartTime() == null) {
-            dto.setWorkStartTime(startTime);
-        }
-        if (dto.getWorkEndTime() == null) {
-            dto.setWorkEndTime(endTime);
-        }
-        // 查询当天数据
-        List<Cutpiece> bo = cutpieceMapper.queryList(dto);
-        //有数据 开始逻辑处理
-        if (bo != null && bo.size() > 0) {
-            for (Cutpiece cutpiece : bo) {
+    public List<Cutpiece> queryList() {
+        //获取机器配置信息
+        List<SysMeConfig> configs = sysMeConfigMapper.queryList(new SysMeConfig());
+        Assert.isTrue(configs!=null&&configs.size()>0,"500-机器配置信息不存在,请先配置");
+        //遍历配置信息
+        List<Cutpiece> cutpieces =new ArrayList<>();
+        for (SysMeConfig config : configs) {
+            //获取机器编号 获取目标产量 获取上班时间
+            String cutrecordNo = config.getTblMachineNo();//机器编号
+            Double capacity = config.getCapacity();//目标产能
+            LocalTime confiTime = config.getConfiTime();//上班时间
+            // 获取当前日期
+            LocalDate currDate = LocalDate.now();
+            //减三天 todo(用来获取测试数据)
+            currDate = currDate.minusDays(4);
+            // 当天零点零分
+            LocalDateTime startTime = currDate.atTime(LocalTime.MIN);
+            //获取当天 23:59:59
+            LocalDateTime endTime = currDate.atTime(LocalTime.MAX);
+            //通过机器编号
+            /*List<Cutpiece> bo = cutpieceMapper.queryList(dto);*/
+            Cutpiece boy = cutpieceMapper.selectBoy(config.getTblMachineNo(), startTime, endTime);
+            if (boy != null){
+                boy.setTarget(capacity);//目标产能
                 //获取切割用时  时间秒 换算成小时
-                Long count = cutpiece.getTotalTime();
+                Long count = boy.getTotalTime();
                 double totalTimeHoursWithFraction = count / 3600.0;
                 DecimalFormat Format = new DecimalFormat("#.##");
-                cutpiece.setRunTime(Double.valueOf(Format.format(totalTimeHoursWithFraction)));
-                /*log.info("机器运行时间:{}", totalTimeHoursWithFraction);*/
+                boy.setRunTime(Double.valueOf(Format.format(totalTimeHoursWithFraction)));
                 //机器上班时间 通过当前年月日 拼接 时间
-                String workTimeString = currDate.format(DateTimeFormatter.ISO_LOCAL_DATE) + " " + time;
+                String workTimeString = currDate.format(DateTimeFormatter.ISO_LOCAL_DATE) + " " + confiTime;
                 LocalDateTime workTime = LocalDateTime.parse(workTimeString, DateTimeFormatter.ofPattern("yyyy-MM-dd H:mm"));
-                cutpiece.setWorkingTime(workTime);
-                /*log.info("上班时间:{}", workTime);*/
+                boy.setWorkingTime(workTime);
                 //机器 开始运作时间
-                LocalDateTime workStartTime = cutpiece.getStartTime();
+                LocalDateTime workStartTime = boy.getStartTime();
                 //机器 结束运作时间
-                LocalDateTime workEndTime = cutpiece.getEndTime();
+                LocalDateTime workEndTime = boy.getEndTime();
                 //计算机器运作时间致机器上班时间的差值
                 Duration duration = Duration.between(workStartTime, workEndTime);
                 //差值换算成秒
@@ -92,15 +93,18 @@ public class CutpieceService extends ServiceImpl<CutpieceMapper, Cutpiece> imple
                 double idleTimeHoursWithFraction = idleTime / 3600.0;
                 //保留小数点后两位
                 DecimalFormat format = new DecimalFormat("#.##");
-                cutpiece.setFreeTime(Double.valueOf(format.format(idleTimeHoursWithFraction)));
+                boy.setFreeTime(Double.valueOf(format.format(idleTimeHoursWithFraction)));
                 /*log.info("机器闲置时间:{}", idleTimeHoursWithFraction);*/
-                cutpiece.setTarget(targetCapacity);
+                boy.setTarget(capacity);
                 //换算百分比
-                double completeRatePercentage = (cutpiece.getCount() / targetCapacity) * 100;
-                cutpiece.setFinish(completeRatePercentage);
+                double completeRatePercentage = (boy.getCount() / capacity) * 100;
+                BigDecimal bd = new BigDecimal(completeRatePercentage).setScale(2, RoundingMode.HALF_UP);
+                double roundedCompleteRatePercentage = bd.doubleValue();
+                boy.setFinish(roundedCompleteRatePercentage);
                 /*log.info("完成率:{}%", completeRatePercentage);*/
+                cutpieces.add(boy);
             }
         }
-        return bo;
+        return cutpieces;
     }
 }

+ 110 - 0
prod-line-imes/src/main/java/com/huaxia/imes/service/SysMeConfigService.java

@@ -0,0 +1,110 @@
+package com.huaxia.imes.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.huaxia.comm.domain.imes.Cutpiece;
+import com.huaxia.comm.domain.imes.SysMeConfig;
+import com.huaxia.imes.mapper.CutpieceMapper;
+import com.huaxia.imes.mapper.SysMeConfigMapper;
+import com.ruoyi.common.annotation.DataSource;
+import com.ruoyi.common.enums.DataSourceType;
+import com.ruoyi.common.utils.StringUtils;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.Assert;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author zx
+ * @since 2024年10月22日
+ */
+@Transactional(rollbackFor = Exception.class)
+@Service
+@AllArgsConstructor
+@DataSource(DataSourceType.SLAVE)
+public class SysMeConfigService extends ServiceImpl<SysMeConfigMapper, SysMeConfig> implements IService<SysMeConfig> {
+
+
+    private SysMeConfigMapper sysMeConfigMapper;
+    private CutpieceMapper cutpieceMapper;
+
+
+    /**
+     * 分页查询可配置信息
+     *
+     * @param boy
+     * @param page
+     * @param size
+     * @return
+     */
+    public IPage<SysMeConfig> queryList(SysMeConfig boy, int page, int size) {
+        int offset = (page - 1) * size;
+        Map<String, Object> params = new HashMap<>();
+        params.put("boy", boy);
+        params.put("offset", offset);
+        params.put("pageSize", size);
+
+        // 获取总记录数
+        int total = sysMeConfigMapper.countByParams(params);
+
+        // 执行分页查询
+        List<SysMeConfig> records = sysMeConfigMapper.queryListPage(params);
+
+        // 创建并返回 Page 对象
+        return new Page<SysMeConfig>(page, size, total).setRecords(records);
+    }
+
+    /**
+     * 新增数据
+     *
+     * @param boy
+     */
+    public void add(SysMeConfig boy) {
+        //校验数据
+        this.check(boy);
+        //获取机器编号 检验机器编号的真实性
+        String cutrecordNo = boy.getTblMachineNo();
+        Long count = cutpieceMapper.selectCount(new LambdaQueryWrapper<Cutpiece>().eq(Cutpiece::getTblMachineNo, cutrecordNo));
+        Assert.isTrue(count > 0, "500-机器编号不存在");
+        //新增数据
+        boy.setCreateTime(new Date());
+        sysMeConfigMapper.insert(boy);
+    }
+
+    /**
+     * 修改数据
+     * @param boy
+     */
+    public void updateBoy(SysMeConfig boy) {
+        //校验数据
+        this.check(boy);
+        //获取机器编码
+        String cutrecordNo = boy.getTblMachineNo();
+        //校验机器编码的真实性
+        Long count = cutpieceMapper.selectCount(new LambdaQueryWrapper<Cutpiece>().eq(Cutpiece::getTblMachineNo, cutrecordNo));
+        Assert.isTrue(count > 0, "500-机器编号不存在");
+        boy.setUpdateTime(new Date());
+        sysMeConfigMapper.updateById(boy);
+    }
+
+    /**
+     * 新增数据时校验数据
+     *
+     * @param boy
+     */
+    private void check(SysMeConfig boy) {
+        Assert.isTrue(StringUtils.isNotBlank(boy.getTblMachineNo()), "500-机器编号不能为空");
+        Assert.isTrue(boy.getCapacity() != null && boy.getCapacity() > 0, "500-产能不能为空");
+        Assert.isTrue(boy.getConfiTime()!=null, "500-上班时间不能为空");
+    }
+
+
+}

+ 27 - 1
prod-line-imes/src/main/resources/mapper/CutpieceMapper.xml

@@ -4,7 +4,7 @@
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.huaxia.imes.mapper.CutpieceMapper">
 
-    <select id="queryList" resultType="com.huaxia.comm.domain.imes.Cutpiece">
+    <!--<select id="queryList" resultType="com.huaxia.comm.domain.imes.Cutpiece">
         SELECT COUNT(A.tbl_cutrecord_id) AS count,
         A.tbl_machine_no,
         min(A.tbl_cutrecord_cuttimestart) as startTime,
@@ -25,4 +25,30 @@
         GROUP BY
         A.tbl_machine_no
     </select>
+-->
+    <!--通过机器编号去查询数据-->
+    <select id="selectBoy" resultType="com.huaxia.comm.domain.imes.Cutpiece">
+        SELECT COUNT(A.tbl_cutrecord_id) AS count,
+                A.tbl_machine_no,
+                min(A.tbl_cutrecord_cuttimestart) as startTime,
+                max(A.tbl_cutrecord_cuttimeend) as endTime,
+                sum(A.tbl_cutrecord_cuttime) as totalTime,
+        (select top 1 B.tbl_softwareopert_memo  from softopert as B where B.tbl_machine_no=A.tbl_machine_no and B.tbl_softwareopert_type=3
+        order by B.tbl_softwareopert_id desc) as tblSoftwareopertMemo
+        FROM
+            cutpiece AS A
+        <where>
+            <if test="startTime != null">
+                and A.tbl_cutrecord_cuttimestart <![CDATA[>=]]> #{startTime}
+            </if>
+            <if test="endTime != null">
+                and A.tbl_cutrecord_cuttimeend <![CDATA[<=]]> #{endTime}
+            </if>
+            <if test="tbl_machine_no != null and tbl_machine_no != ''">
+                and A.tbl_machine_no=#{tbl_machine_no}
+            </if>
+        </where>
+        GROUP BY
+            A.tbl_machine_no
+    </select>
 </mapper>

+ 99 - 0
prod-line-imes/src/main/resources/mapper/SysMeConfigMapper.xml

@@ -0,0 +1,99 @@
+<?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.huaxia.imes.mapper.SysMeConfigMapper">
+    <!--查询配置信息-->
+    <select id="queryList" resultType="com.huaxia.comm.domain.imes.SysMeConfig">
+        select *
+        from sys_me_config as A
+        <where>
+            <if test="confiTime != null and confiTime != ''">
+                and A.confi_time like concat('%', #{confiTime}, '%')
+            </if>
+            <if test="capacity != null">
+                and A.capacity = #{capacity}
+            </if>
+            <if test="tblMachineNo != null and tblMachineNo != ''">
+                and A.tbl_machine_no = #{tblMachineNo}
+            </if>
+            <if test="createTime != null">
+                and A.create_time = #{createTime}
+            </if>
+            <if test="updateTime != null">
+                and A.update_time = #{updateTime}
+            </if>
+            <if test="createBy != null and createBy != ''">
+                and A.create_by = #{createBy}
+            </if>
+            <if test="updateBy != null and updateBy != ''">
+                and A.update_by = #{updateBy}
+            </if>
+        </where>
+    </select>
+
+
+    <select id="countByParams" resultType="java.lang.Integer">
+        SELECT COUNT(*)
+        FROM sys_me_config
+        <where>
+            <if test="params.boy != null">
+                <if test="params.boy.tblMachineNo != null">
+                    AND tblMachineNo = #{params.boy.tblMachineNo}
+                </if>
+                <if test="params.boy.confiTime != null">
+                    AND confiTime = #{params.boy.confiTime}
+                </if>
+                <if test="params.boy.capacity != null">
+                    AND capacity = #{params.boy.capacity}
+                </if>
+                <if test="params.boy.createTime != null">
+                    AND createTime = #{params.boy.createTime}
+                </if>
+                <if test="params.boy.updateTime != null">
+                    AND updateTime = #{params.boy.updateTime}
+                </if>
+                <if test="params.boy.createBy != null">
+                    AND createBy = #{params.boy.createBy}
+                </if>
+                <if test="params.boy.updateBy != null">
+                    AND updateBy = #{params.boy.updateBy}
+                </if>
+            </if>
+        </where>
+    </select>
+
+    <!-- 分页查询列表 -->
+    <select id="queryListPage" resultType="com.huaxia.comm.domain.imes.SysMeConfig">
+        SELECT *
+        FROM sys_me_config
+        <where>
+            <if test="params.boy != null">
+                <if test="params.boy.tblMachineNo != null">
+                    AND tblMachineNo = #{params.boy.tblMachineNo}
+                </if>
+                <if test="params.boy.confiTime != null">
+                    AND confiTime = #{params.boy.confiTime}
+                </if>
+                <if test="params.boy.capacity != null">
+                    AND capacity = #{params.boy.capacity}
+                </if>
+                <if test="params.boy.createTime != null">
+                    AND createTime = #{params.boy.createTime}
+                </if>
+                <if test="params.boy.updateTime != null">
+                    AND updateTime = #{params.boy.updateTime}
+                </if>
+                <if test="params.boy.createBy != null">
+                    AND createBy = #{params.boy.createBy}
+                </if>
+                <if test="params.boy.updateBy != null">
+                    AND updateBy = #{params.boy.updateBy}
+                </if>
+            </if>
+        </where>
+        ORDER BY id
+        OFFSET #{params.offset} ROWS
+        FETCH NEXT #{params.pageSize} ROWS ONLY
+    </select>
+</mapper>