Преглед изворни кода

新增 水肥机操作记录功能

zhaiyifei пре 8 месеци
родитељ
комит
56401277a4

+ 16 - 0
src/main/java/com/yunfeiyun/agmp/iotm/device/sf/controller/IotDeviceSfController.java

@@ -439,4 +439,20 @@ public class IotDeviceSfController extends BaseController {
         return iotDeviceCommonService.func(iotDeviceBaseFunReqVo);
     }
 
+    /**
+     * 获取水肥机灌溉操作记录
+     * @param
+     * @return
+     */
+    @GetMapping("/op/record/list")
+    public TableDataInfo getOpRecordList(IotSfIrrigationOprecordListReqVo reqVo){
+        String devBid = reqVo.getDevBid();
+        ValidateUtil.validateDevBid(devBid);
+        IotDeviceBaseFunReqVo iotDeviceBaseFunReqVo = new IotDeviceBaseFunReqVo();
+        iotDeviceBaseFunReqVo.setDevBid(devBid);
+        iotDeviceBaseFunReqVo.setMethodName("getOpRecordList");
+        iotDeviceBaseFunReqVo.setParam(reqVo);
+        return iotDeviceCommonService.func(iotDeviceBaseFunReqVo);
+    }
+
 }

+ 23 - 0
src/main/java/com/yunfeiyun/agmp/iotm/device/sf/domain/IotSfIrrigationOprecordListReqVo.java

@@ -0,0 +1,23 @@
+package com.yunfeiyun.agmp.iotm.device.sf.domain;
+
+import com.yunfeiyun.agmp.iot.common.domain.IotBaseEntity;
+import lombok.Data;
+
+@Data
+public class IotSfIrrigationOprecordListReqVo extends IotBaseEntity {
+
+    private String oprcdBid; // 唯一标识
+    private String devBid; // 设备标识
+    private String oprecdName; // 操作名称
+    private String oprecdContent; // 操作内容
+    private Character oprecdStatus; // 操作状态 0 关闭 1 打开
+    private String oprcdCreatorName; // 操作用户名称
+    private String oprcdCreateddate; // 创建时间
+    private String tid;
+
+    // 开始时间
+    private String startTime;
+
+    // 结束时间
+    private String endTime;
+}

+ 33 - 0
src/main/java/com/yunfeiyun/agmp/iotm/device/sf/service/IIotSfCommService.java

@@ -50,6 +50,9 @@ public class IIotSfCommService extends IotDeviceBaseServiceImpl implements IotDe
     @Autowired
     private IIotSfIrrigationRecordService iIotSfIrrigationRecordService;
 
+    @Autowired
+    private IIotSfIrrigationOprecordService iIotSfIrrigationOprecordService;
+
 
     public Class getTableClass(String devtypeBid) {
         Class tableClass = null;
@@ -451,4 +454,34 @@ public class IIotSfCommService extends IotDeviceBaseServiceImpl implements IotDe
         return rspData;
     }
 
+    /**
+     * 获取灌溉记录列表
+     *
+     * @param reqVo 包含设备添加请求的参数,包括设备标识(devBid)等
+     * @param reqVo
+     */
+    public TableDataInfo getOpRecordList(IotSfIrrigationOprecordListReqVo reqVo) {
+        TableDataInfo rspData = new TableDataInfo();
+        rspData.setCode(ErrorCode.SUCCESS.getCode());
+        rspData.setMsg(ErrorCode.SUCCESS.getMessage());
+        rspData.setData(new ArrayList<>());
+        rspData.setTotal(0);
+
+        String devBid = reqVo.getDevBid();
+        if (StringUtils.isEmpty(devBid)) {
+            throw new IotBizException(IotErrorCode.INVALID_DEVICE_ID.getCode(), "设备标识不能为空");
+        }
+        IotDevice iotDevice = iotDeviceService.selectIotDeviceByDevBid(reqVo.getDevBid());
+        if (iotDevice == null) {
+            throw new IotBizException(IotErrorCode.INVALID_DEVICE_ID.getCode(), "设备不存在");
+        }
+
+        List<IotSfIrrigationOprecord> recordList = iIotSfIrrigationOprecordService.selectIrrigationOprecordList(reqVo);
+        if (recordList != null && !recordList.isEmpty()){
+            rspData.setData(recordList);
+            rspData.setTotal(recordList.size());
+        }
+        return rspData;
+    }
+
 }

+ 39 - 38
src/main/java/com/yunfeiyun/agmp/iotm/device/sf/service/impl/IotRunHaoSfServiceImpl.java

@@ -13,7 +13,6 @@ import com.yunfeiyun.agmp.iot.common.constant.devicetype.ServiceNameConst;
 import com.yunfeiyun.agmp.iot.common.domain.IotDevice;
 import com.yunfeiyun.agmp.iot.common.domain.IotRunHaoSfdata;
 import com.yunfeiyun.agmp.iot.common.domain.IotSfElementfactor;
-import com.yunfeiyun.agmp.iot.common.domain.IotSfIrrigationRecord;
 import com.yunfeiyun.agmp.iot.common.enums.EnumIrrigationRecord;
 import com.yunfeiyun.agmp.iot.common.enums.EnumSfElementType;
 import com.yunfeiyun.agmp.iot.common.exception.IotBizException;
@@ -24,6 +23,7 @@ import com.yunfeiyun.agmp.iotm.device.sf.domain.*;
 import com.yunfeiyun.agmp.iotm.device.sf.service.IIotSfCommService;
 import com.yunfeiyun.agmp.iotm.web.service.IIotDeviceService;
 import com.yunfeiyun.agmp.iotm.web.service.IIotSfElementfactorService;
+import com.yunfeiyun.agmp.iotm.web.service.IIotSfIrrigationOprecordService;
 import com.yunfeiyun.agmp.iotm.web.service.IIotSfIrrigationRecordService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
@@ -51,6 +51,9 @@ public class IotRunHaoSfServiceImpl extends IIotSfCommService {
     @Autowired
     private IIotSfIrrigationRecordService iotSfIrrigationRecordService;
 
+    @Autowired
+    private IIotSfIrrigationOprecordService iotSfIrrigationOprecordService;
+
     /**
      * 获取设备状态
      *
@@ -741,6 +744,8 @@ public class IotRunHaoSfServiceImpl extends IIotSfCommService {
         sfTypeMap.put(runMode, null);
 
         Map<EnumSfElementType, Integer> sfTypeValueMap = new HashMap<>();
+        IotSfElementfactorAlreadyListResVo groupResVo = null;
+
         for(IotSfElementfactorInfoVo element : resultList){
             EnumSfElementType elementType = EnumSfElementType.findEnumByCode(element.getSfType());
             if(elementType == null){
@@ -757,6 +762,18 @@ public class IotRunHaoSfServiceImpl extends IIotSfCommService {
                     if(childType == null || !typeSet.contains(childType)){
                         continue;
                     }
+
+                    if(childType == EnumSfElementType.SOLENOID_VALVE) {
+                        groupResVo = new IotSfElementfactorAlreadyListResVo();
+                        BeanUtils.copyProperties(element, groupResVo);
+                        groupResVo.setChildrenList(new ArrayList<>());
+
+                        IotSfElementfactorAlreadyListResVo childResVo = new IotSfElementfactorAlreadyListResVo();
+                        BeanUtils.copyProperties(child, childResVo);
+
+                        groupResVo.getChildrenList().add(childResVo);
+                    }
+
                     sfTypeValueMap.put(childType, sfTypeValueMap.getOrDefault(childType, 0) + Integer.parseInt(child.getValue()));
                     sfTypeMap.put(child.getSfCode(), childType);
                 }
@@ -810,6 +827,23 @@ public class IotRunHaoSfServiceImpl extends IIotSfCommService {
 
             }
         }
+//
+//        if(groupResVo != null){
+//            String v = "0";
+//            for(IotSfElementfactorAlreadyListResVo child : groupResVo.getChildrenList()){
+//                String key = child.getSfCode();
+//                v = devConfig.getString(key);
+//            }
+//
+//            if(Objects.equals(v, "1")){
+//                String sfdataBid = runStatusData.getString("sfdataBid");
+//                List<IotSfElementfactorAlreadyListResVo> groupList = new ArrayList<>();
+//                groupList.add(groupResVo);
+//                iotSfIrrigationRecordService.createIotSfIrrigationRecordList(groupList, EnumIrrigationRecord.MODE_MANUAL.getCode(), sfdataBid);
+//            }
+//        }
+
+
         // 切换到自动模式,先重置状态
         String value = devConfig.getString(runMode);
         if("1".equals(value)){
@@ -1039,43 +1073,8 @@ public class IotRunHaoSfServiceImpl extends IIotSfCommService {
             }
         }
 
-        String tid = SecurityUtils.getTid();
-        String userId = SecurityUtils.getUserId();
-        String userLoginName = SecurityUtils.getLoginLogName();
-        String rcdStartdate = DateUtils.dateTimeNow();
-        List<IotSfIrrigationRecord> irrigationRecordList = new ArrayList<>();
-        for(IotSfElementfactorAlreadyListResVo group : groupList){
-            StringBuilder rcdContent = new StringBuilder();
-            List<IotSfElementfactorAlreadyListResVo> childrenList = group.getChildrenList();
-            for(IotSfElementfactorAlreadyListResVo child : childrenList){
-                rcdContent.append(child.getSfDisplayname()).append(",");
-            }
-            if(rcdContent.length() > 0){
-                rcdContent.deleteCharAt(rcdContent.length() - 1);
-            }
-            rcdContent.append(EnumIrrigationRecord.STATUS_RUNNING.getName());
-
-            IotSfIrrigationRecord record = new IotSfIrrigationRecord();
-            record.setRcdBid(record.getUUId());
-            record.setDevBid(devBid);
-            record.setRcdGroupbid(group.getSfBid());
-            record.setRcdGroupName(group.getSfDisplayname());
-            record.setRcdStatus(EnumIrrigationRecord.STATUS_RUNNING.getCode());
-            record.setRcdMode(EnumIrrigationRecord.MODE_AUTO.getCode());
-            record.setRcdContent(rcdContent.toString());
-            record.setSfdataBid(runStatusData.getString("sfdataBid"));
-            record.setRcdCreator(userId);
-            record.setRcdCreatorName(userLoginName);
-            record.setRcdStartdate(rcdStartdate);
-            record.setRcdCreateddate(rcdStartdate);
-            record.setTid(tid);
-
-            irrigationRecordList.add(record);
-        }
-
-        if(!irrigationRecordList.isEmpty()){
-            iotSfIrrigationRecordService.batchInsertIotSfIrrigationRecord(irrigationRecordList);
-        }
+        String sfdataBid = runStatusData.getString("sfdataBid");
+        iotSfIrrigationRecordService.createIotSfIrrigationRecordList(groupList, EnumIrrigationRecord.MODE_AUTO.getCode(), sfdataBid);
 
         IotSfConfigCmdReqVo cmdReqVo = new IotSfConfigCmdReqVo();
         cmdReqVo.setDevBid(devBid);
@@ -1138,6 +1137,8 @@ public class IotRunHaoSfServiceImpl extends IIotSfCommService {
         JSONObject sendJson = resetStatus(devBid);
         sendJson.put("Btn-yjqd", "0");
 
+        iotSfIrrigationOprecordService.createIotSfIrrigationOprecord(devBid, "自动灌溉", "停止", "0");
+
         IotSfConfigCmdReqVo cmdReqVo = new IotSfConfigCmdReqVo();
         cmdReqVo.setDevBid(devBid);
         cmdReqVo.setCmd(CmdDef.RunHaoSfCmdDef.CMD_CONFIG);

+ 33 - 0
src/main/java/com/yunfeiyun/agmp/iotm/web/mapper/IotSfIrrigationOprecordMapper.java

@@ -0,0 +1,33 @@
+package com.yunfeiyun.agmp.iotm.web.mapper;
+
+import com.yunfeiyun.agmp.iot.common.domain.IotSfIrrigationOprecord;
+import com.yunfeiyun.agmp.iotm.device.sf.domain.IotSfIrrigationOprecordListReqVo;
+
+import java.util.List;
+
+public interface IotSfIrrigationOprecordMapper {
+    // 添加灌溉记录
+    public int insertIrrigationOprecord(IotSfIrrigationOprecord record);
+
+//    public int batchInsertIotSfIrrigationOprecord(List<IotSfIrrigationOprecord> recordList);
+//
+//    // 根据唯一标识查询灌溉记录
+//    public IotSfIrrigationOprecord selectIrrigationOprecordByBid(String rcdBid);
+//
+//    // 更新灌溉记录
+//    public int updateIrrigationOprecord(IotSfIrrigationOprecord record);
+//
+//    // 删除灌溉记录
+//    public void deleteIrrigationOprecord(String rcdBid);
+//
+    // 查询所有灌溉记录
+    public List<IotSfIrrigationOprecord> selectIrrigationOprecordList(IotSfIrrigationOprecordListReqVo record);
+//
+//    /**
+//     * 生成灌溉记录列表
+//     * @param groupList  灌区要素列表
+//     * @param runMode  运行模式 0 手动 1 自动
+//     * @return
+//     */
+//    public void createIotSfIrrigationOprecordList(List<IotSfIrrigationOprecordListReqVo> groupList, String runMode, String sfdataBid);
+}

+ 33 - 0
src/main/java/com/yunfeiyun/agmp/iotm/web/service/IIotSfIrrigationOprecordService.java

@@ -0,0 +1,33 @@
+package com.yunfeiyun.agmp.iotm.web.service;
+
+import com.yunfeiyun.agmp.iot.common.domain.IotSfIrrigationOprecord;
+import com.yunfeiyun.agmp.iotm.device.sf.domain.IotSfIrrigationOprecordListReqVo;
+
+import java.util.List;
+
+public interface IIotSfIrrigationOprecordService {
+    // 添加灌溉操作记录
+    public int insertIrrigationOprecord(IotSfIrrigationOprecord record);
+
+    public int batchInsertIotSfIrrigationOprecord(List<IotSfIrrigationOprecord> recordList);
+
+    // 根据唯一标识查询灌溉操作记录
+    public IotSfIrrigationOprecord selectIrrigationOprecordByBid(String rcdBid);
+
+    // 更新灌溉操作记录
+    public int updateIrrigationOprecord(IotSfIrrigationOprecord record);
+
+    // 删除灌溉操作记录
+    public void deleteIrrigationOprecord(String rcdBid);
+
+    // 查询所有灌溉操作记录
+    public List<IotSfIrrigationOprecord> selectIrrigationOprecordList(IotSfIrrigationOprecordListReqVo record);
+
+    /**
+     * 生成灌溉操作记录列表
+     * @param groupList  灌区要素列表
+     * @param runMode  运行模式 0 手动 1 自动
+     * @return
+     */
+    public void createIotSfIrrigationOprecord(String devBid, String oprecdName, String oprecdContent, String oprecdStatus);
+}

+ 9 - 0
src/main/java/com/yunfeiyun/agmp/iotm/web/service/IIotSfIrrigationRecordService.java

@@ -1,6 +1,7 @@
 package com.yunfeiyun.agmp.iotm.web.service;
 
 import com.yunfeiyun.agmp.iot.common.domain.IotSfIrrigationRecord;
+import com.yunfeiyun.agmp.iotm.device.sf.domain.IotSfElementfactorAlreadyListResVo;
 import com.yunfeiyun.agmp.iotm.device.sf.domain.IotSfIrrigationRecordListReqVo;
 
 import java.util.List;
@@ -22,4 +23,12 @@ public interface IIotSfIrrigationRecordService {
 
     // 查询所有灌溉记录
     public List<IotSfIrrigationRecord> selectIrrigationRecordList(IotSfIrrigationRecordListReqVo record);
+
+    /**
+     * 生成灌溉记录列表
+     * @param groupList  灌区要素列表
+     * @param runMode  运行模式 0 手动 1 自动
+     * @return
+     */
+    public void createIotSfIrrigationRecordList(List<IotSfElementfactorAlreadyListResVo> groupList, String runMode, String sfdataBid);
 }

+ 75 - 0
src/main/java/com/yunfeiyun/agmp/iotm/web/service/impl/IotSfIrrigationOprecordServiceImpl.java

@@ -0,0 +1,75 @@
+package com.yunfeiyun.agmp.iotm.web.service.impl;
+
+import com.yunfeiyun.agmp.common.utils.DateUtils;
+import com.yunfeiyun.agmp.common.utils.SecurityUtils;
+import com.yunfeiyun.agmp.iot.common.domain.IotSfIrrigationOprecord;
+import com.yunfeiyun.agmp.iotm.device.sf.domain.IotSfIrrigationOprecordListReqVo;
+import com.yunfeiyun.agmp.iotm.web.mapper.IotSfIrrigationOprecordMapper;
+import com.yunfeiyun.agmp.iotm.web.service.IIotSfIrrigationOprecordService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class IotSfIrrigationOprecordServiceImpl implements IIotSfIrrigationOprecordService {
+
+    @Autowired
+    private IotSfIrrigationOprecordMapper iotSfIrrigationOprecordMapper;
+
+    @Override
+    public int insertIrrigationOprecord(IotSfIrrigationOprecord record) {
+        record.setTid(SecurityUtils.getTid());
+        return iotSfIrrigationOprecordMapper.insertIrrigationOprecord(record);
+    }
+
+    @Override
+    public int batchInsertIotSfIrrigationOprecord(List<IotSfIrrigationOprecord> recordList) {
+        return 0;
+    }
+
+    @Override
+    public IotSfIrrigationOprecord selectIrrigationOprecordByBid(String rcdBid) {
+        return null;
+    }
+
+    @Override
+    public int updateIrrigationOprecord(IotSfIrrigationOprecord record) {
+        return 0;
+    }
+
+    @Override
+    public void deleteIrrigationOprecord(String rcdBid) {
+
+    }
+
+    @Override
+    public List<IotSfIrrigationOprecord> selectIrrigationOprecordList(IotSfIrrigationOprecordListReqVo record) {
+        record.setTid(SecurityUtils.getTid());
+        return iotSfIrrigationOprecordMapper.selectIrrigationOprecordList(record);
+    }
+
+    /**
+     * 生成灌溉操作记录列表
+     *
+     * @param devBid
+     * @param oprecdName
+     * @param oprecdContent
+     * @param oprecdStatus
+     * @return
+     */
+    @Override
+    public void createIotSfIrrigationOprecord(String devBid, String oprecdName, String oprecdContent, String oprecdStatus) {
+        IotSfIrrigationOprecord oprecord = new IotSfIrrigationOprecord();
+        oprecord.setOprcdBid(oprecord.getUUId());
+        oprecord.setDevBid(devBid);
+        oprecord.setOprecdName(oprecdName);
+        oprecord.setOprecdContent(oprecdContent);
+        oprecord.setOprecdStatus(oprecdStatus);
+        oprecord.setOprcdCreatorName(SecurityUtils.getLoginLogName());
+        oprecord.setOprcdCreateddate(DateUtils.dateTimeNow());
+        oprecord.setTid(SecurityUtils.getTid());
+
+        insertIrrigationOprecord(oprecord);
+    }
+}

+ 51 - 0
src/main/java/com/yunfeiyun/agmp/iotm/web/service/impl/IotSfIrrigationRecordServiceImpl.java

@@ -1,13 +1,17 @@
 package com.yunfeiyun.agmp.iotm.web.service.impl;
 
+import com.yunfeiyun.agmp.common.utils.DateUtils;
 import com.yunfeiyun.agmp.common.utils.SecurityUtils;
 import com.yunfeiyun.agmp.iot.common.domain.IotSfIrrigationRecord;
+import com.yunfeiyun.agmp.iot.common.enums.EnumIrrigationRecord;
+import com.yunfeiyun.agmp.iotm.device.sf.domain.IotSfElementfactorAlreadyListResVo;
 import com.yunfeiyun.agmp.iotm.device.sf.domain.IotSfIrrigationRecordListReqVo;
 import com.yunfeiyun.agmp.iotm.web.mapper.IotSfIrrigationRecordMapper;
 import com.yunfeiyun.agmp.iotm.web.service.IIotSfIrrigationRecordService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
 import java.util.List;
 
 @Service
@@ -51,4 +55,51 @@ public class IotSfIrrigationRecordServiceImpl implements IIotSfIrrigationRecordS
         record.setTid(SecurityUtils.getTid());
         return irrigationRecordMapper.selectIrrigationRecordList(record);
     }
+
+    /**
+     * 生成灌溉记录列表
+     *
+     * @param groupList 灌区要素列表
+     * @param runMode   运行模式 0 手动 1 自动
+     * @return
+     */
+    @Override
+    public void createIotSfIrrigationRecordList(List<IotSfElementfactorAlreadyListResVo> groupList, String runMode, String sfdataBid) {
+        String tid = SecurityUtils.getTid();
+        String userId = SecurityUtils.getUserId();
+        String userLoginName = SecurityUtils.getLoginLogName();
+        String rcdStartdate = DateUtils.dateTimeNow();
+        List<IotSfIrrigationRecord> irrigationRecordList = new ArrayList<>();
+        for(IotSfElementfactorAlreadyListResVo group : groupList){
+            StringBuilder rcdContent = new StringBuilder();
+            List<IotSfElementfactorAlreadyListResVo> childrenList = group.getChildrenList();
+            for(IotSfElementfactorAlreadyListResVo child : childrenList){
+                rcdContent.append(child.getSfDisplayname()).append(",");
+            }
+            if(rcdContent.length() > 0){
+                rcdContent.deleteCharAt(rcdContent.length() - 1);
+            }
+            rcdContent.append(EnumIrrigationRecord.STATUS_RUNNING.getName());
+
+            IotSfIrrigationRecord record = new IotSfIrrigationRecord();
+            record.setRcdBid(record.getUUId());
+            record.setDevBid(group.getDevBid());
+            record.setRcdGroupbid(group.getSfBid());
+            record.setRcdGroupName(group.getSfDisplayname());
+            record.setRcdStatus(EnumIrrigationRecord.STATUS_RUNNING.getCode());
+            record.setRcdMode(runMode);
+            record.setRcdContent(rcdContent.toString());
+            record.setSfdataBid(sfdataBid);
+            record.setRcdCreator(userId);
+            record.setRcdCreatorName(userLoginName);
+            record.setRcdStartdate(rcdStartdate);
+            record.setRcdCreateddate(rcdStartdate);
+            record.setTid(tid);
+
+            irrigationRecordList.add(record);
+        }
+        if(!irrigationRecordList.isEmpty()){
+            batchInsertIotSfIrrigationRecord(irrigationRecordList);
+        }
+    }
 }

+ 46 - 0
src/main/resources/mapper/IotSfIrrigationOprecordMapper.xml

@@ -0,0 +1,46 @@
+<?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.yunfeiyun.agmp.iotm.web.mapper.IotSfIrrigationOprecordMapper">
+
+    <insert id="insertIrrigationOprecord" parameterType="com.yunfeiyun.agmp.iot.common.domain.IotSfIrrigationOprecord">
+        INSERT INTO IotSfIrrigationOprecord
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="oprcdBid != null">oprcdBid,</if>
+            <if test="devBid != null">devBid,</if>
+            <if test="oprecdName != null">oprecdName,</if>
+            <if test="oprecdContent != null">oprecdContent,</if>
+            <if test="oprecdStatus!= null">oprecdStatus,</if>
+            <if test="oprcdCreatorName!= null">oprcdCreatorName,</if>
+            <if test="oprcdCreateddate!= null">oprcdCreateddate,</if>
+            <if test="tid!= null">tid,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="oprcdBid!= null">#{oprcdBid},</if>
+            <if test="devBid!= null">#{devBid},</if>
+            <if test="oprecdName!= null">#{oprecdName},</if>
+            <if test="oprecdContent!= null">#{oprecdContent},</if>
+            <if test="oprecdStatus!= null">#{oprecdStatus},</if>
+            <if test="oprcdCreatorName!= null">#{oprcdCreatorName},</if>
+            <if test="oprcdCreateddate!= null">#{oprcdCreateddate},</if>
+            <if test="tid!= null">#{tid},</if>
+        </trim>
+    </insert>
+    <select id="selectIrrigationOprecordList" parameterType="IotSfIrrigationOprecordListReqVo"
+            resultType="com.yunfeiyun.agmp.iot.common.domain.IotSfIrrigationOprecord">
+        SELECT * FROM IotSfIrrigationOprecord
+        <where>
+            tid = #{tid}
+            <if test="oprcdBid!= null"> AND oprcdBid = #{oprcdBid}</if>
+            <if test="devBid!= null"> AND devBid = #{devBid}</if>
+            <if test="oprecdName!= null"> AND oprcdName = #{oprecdName}</if>
+            <if test="oprecdContent!= null"> AND oprcdContent = #{oprecdContent}</if>
+            <if test="oprecdStatus!= null"> AND oprcdStatus = #{oprecdStatus}</if>
+            <if test="oprcdCreatorName!= null"> AND oprcdCreatorName = #{oprcdCreatorName}</if>
+            <if test="oprcdCreateddate!= null"> AND oprcdCreateddate = #{oprcdCreateddate}</if>
+            <if test="startTime!= null and startTime!= ''"> and oprcdCreateddate <![CDATA[ >= ]]> #{startTime}</if>
+            <if test="endTime!= null and endTime!= ''"> and oprcdCreateddate <![CDATA[ <= ]]> #{endTime}</if>
+        </where>
+    </select>
+</mapper>