Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
Conflicts:
pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/test/CommandCtrl.java
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.core.annotation.Order; |
| | | import org.springframework.http.HttpEntity; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.http.*; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.client.RestTemplate; |
| | | import org.springframework.web.util.UriComponentsBuilder; |
| | |
| | | .build() |
| | | .toUriString(); |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.setContentType(MediaType.parseMediaType("application/json;charset=UTF-8")); |
| | | |
| | | HttpEntity<?> httpEntity = new HttpEntity<>(headers); |
| | | ResponseEntity<SsoVo> response = null; |
| | | try { |
| | |
| | | bs[index++] = 0 ; |
| | | } |
| | | |
| | | index += 4 ; |
| | | strTemp = "" + cvo.moneyAlarm ; |
| | | bTemp = ByteUtil.string2BCD_LE(strTemp) ; |
| | | bTempLen = bTemp.length ; |
| | |
| | | bs[index++] = 0 ; |
| | | } |
| | | |
| | | index ++ ; |
| | | GlCreate.createPw(bs, index); |
| | | |
| | | index += 2 ; |
| | |
| | | throw new Exception("水位下限值必须是0~9999.99范围内的整数") ; |
| | | } |
| | | |
| | | byte[] bs = new byte[17] ; |
| | | byte[] bs = new byte[16] ; |
| | | int index = 0 ; |
| | | bs[index] = (byte)(Integer.parseInt(cvo.controllerType, 16)); |
| | | |
| | |
| | | bs[index++] = 0 ; |
| | | } |
| | | |
| | | index += 4 ; |
| | | strTemp = "" + (Double.valueOf(cvo.limitLevel * 100)).longValue() ; |
| | | bTemp = ByteUtil.string2BCD_LE(strTemp) ; |
| | | bTempLen = bTemp.length ; |
| | |
| | | bs[index++] = 0 ; |
| | | } |
| | | |
| | | index ++ ; |
| | | GlCreate.createPw(bs, index); |
| | | |
| | | index += 2 ; |
| | |
| | | import com.dy.common.mw.protocol.p206V202404.*; |
| | | import com.dy.common.mw.protocol.p206V202404.upVos.DataCd83Vo; |
| | | import com.dy.common.util.ByteUtil; |
| | | import com.dy.common.util.DateTime; |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | | |
| | |
| | | index += 4 ; |
| | | cdData.batteryVolt = ByteUtil.BCD2Int_LE(bs, index, index + 1)/100.0D ; |
| | | |
| | | index += 2 ; |
| | | String hh = ByteUtil.BCD2String_LE(bs, index, index) ; |
| | | index ++ ; |
| | | String dd = ByteUtil.BCD2String_LE(bs, index, index) ; |
| | | index ++ ; |
| | | String mm = ByteUtil.BCD2String_LE(bs, index, index) ; |
| | | index ++ ; |
| | | String yy = ByteUtil.BCD2String_LE(bs, index, index) ; |
| | | |
| | | String ymd = "20" + yy + "-" + mm + "-" + dd ; |
| | | |
| | | cdData.rtuDt = ymd + " " + hh ; |
| | | |
| | | cdData.dataDt = DateTime.lastXDay_yyyy_MM_dd(ymd, 1) ; |
| | | } |
| | | |
| | | } |
| | |
| | | if(!NumUtil.isPlusIntNumber(cvo.orderNo)){ |
| | | throw new Exception("订单号必须是16位数字") ; |
| | | } |
| | | if(cvo.orderNo.length() != 12){ |
| | | if(cvo.orderNo.length() != 16){ |
| | | throw new Exception("订单号必须是16位数字") ; |
| | | } |
| | | |
| | |
| | | GlCreate.createIcCardNo(cvo.icCardNo, bs, index); |
| | | |
| | | index += 8 ; |
| | | if(cvo.waterRemain != null){ |
| | | if(cvo.waterRemain == null){ |
| | | cvo.waterRemain = 0.0 ; |
| | | } |
| | | String strTemp = "" + Double.valueOf(cvo.waterRemain * 100).intValue() ; |
| | |
| | | bs[index++] = 0 ; |
| | | } |
| | | |
| | | if(cvo.moneyRemain != null){ |
| | | if(cvo.moneyRemain == null){ |
| | | cvo.moneyRemain = 0.0 ; |
| | | } |
| | | strTemp = "" + (Double.valueOf(cvo.moneyRemain * 100)).intValue() ; |
| | |
| | | } |
| | | |
| | | |
| | | if(cvo.waterPrice != null){ |
| | | if(cvo.waterPrice == null){ |
| | | cvo.waterPrice = 0.0 ; |
| | | } |
| | | strTemp = "" + (Double.valueOf(cvo.waterPrice * 100)).intValue() ; |
| | |
| | | } |
| | | |
| | | |
| | | if(cvo.elePrice != null){ |
| | | if(cvo.elePrice == null){ |
| | | cvo.elePrice = 0.0 ; |
| | | } |
| | | strTemp = "" + (Double.valueOf(cvo.elePrice * 100)).intValue() ; |
| | |
| | | sb.append(alarmEleLowVolt == null?"未知":(alarmEleLowVolt.byteValue() == 0 ? "正常":(alarmEleLowVolt.byteValue() == 1 ? "报警":"未知"))) ; |
| | | sb.append("\n") ; |
| | | sb.append(" IC卡功能 : ") ; |
| | | sb.append(stateIcEnable == null?"未知":(stateIcEnable.byteValue() == 0 ? "不支持":(stateIcEnable.byteValue() == 1 ? "支持":"未知"))) ; |
| | | sb.append(stateIcEnable == null?"未知":(stateIcEnable.byteValue() == 0 ? "无效":(stateIcEnable.byteValue() == 1 ? "有效":"未知"))) ; |
| | | sb.append("\n") ; |
| | | |
| | | return sb.toString() ; |
| | |
| | | sb.append(" 项目编号 : ") ; |
| | | sb.append(projectNo == null?"未知":projectNo) ; |
| | | sb.append("\n") ; |
| | | sb.append(" 剩余水量报警值 : ") ; |
| | | sb.append(" 剩余金额报警值 : ") ; |
| | | sb.append(moneyAlarm == null?"未知":moneyAlarm) ; |
| | | sb.append("\n") ; |
| | | sb.append(" 剩余水量报警值 : ") ; |
| | |
| | | public Double waterUserTotalAmountDay ;// 当日用户用水量 |
| | | public Double lossTotalAmountDay ;// 漏损水量 |
| | | public Double batteryVolt ;//后备电池电压 |
| | | public Double rtuDt ;//上报时间(yyyy-mm-dd HH) |
| | | public String dataDt ;//数据时间(yyyy-mm-dd) |
| | | public String rtuDt ;//RTU时钟(上报时刻)(yyyy-mm-dd HH:00:00) |
| | | |
| | | public String comName ;//命令名称 |
| | | |
| | |
| | | public String icCardAddr ;//IC卡地址(远程关闭时为0) |
| | | public String icCardNo ;//IC卡编号(17位数字) |
| | | public String orderNo ;//订单号(16位数字) |
| | | public String opDt ;//开泵/阀时间(分时日月) |
| | | public String opDt ;//开泵/阀时间(yyyy-mm-dd HH:MM:SS) |
| | | public Double waterTotalAmount ;//水表累计水量,单位0.01立方米 |
| | | public Double eleTotalAmount ;//电表累计电量,单位0.01度 |
| | | public Double moneyRemainUser ;//用户剩余金额, 单位0.01元 |
| | |
| | | public Byte opType1 ;//操作方式:0:刷卡开水泵/阀门;1:远程开水泵/阀门;2:APP开水泵/阀门 |
| | | public Byte opType2 ;//开启关闭:0: 开启 -1:关闭 |
| | | public Boolean success ;//执行结果(true成功, false失败) |
| | | public String rutDt ;//设备时钟 |
| | | public String rtuDt;//设备时钟 |
| | | |
| | | public String comName ;//命令名称 |
| | | |
| | |
| | | sb.append(opType2 == null?"未知":(opType2.byteValue()==0?"开启水泵/阀门":(opType2.byteValue()==1?"关闭水泵/阀门":"未知"))) ; |
| | | sb.append("\n") ; |
| | | sb.append(" 设备时钟 : ") ; |
| | | sb.append(rutDt == null?"未知":rutDt) ; |
| | | sb.append(rtuDt == null?"未知": rtuDt) ; |
| | | sb.append("\n") ; |
| | | sb.append(" 执行结果 : ") ; |
| | | sb.append(success == null?"未知":(success?"成功":"失败")) ; |
| | |
| | | |
| | | static int MAPPED_STATEMENT_INDEX = 0; |
| | | static int PARAMETER_INDEX = 1; |
| | | static String BASE_FIELD_SET_PRIMARY_KEY_FUNTION_NAME = "setId"; |
| | | static String BASE_FIELD_SET_PRIMARY_KEY_FUNTION_NAME2 = "setUserId"; |
| | | static String BASE_FIELD_SET_PRIMARY_KEY_FUNTION_SETID = "setId"; |
| | | static String BASE_FIELD_SET_PRIMARY_KEY_FUNTION_SETUSERID = "setUserId"; |
| | | static String BASE_FIELD_SET_PRIMARY_KEY_FUNTION_SETROLEID = "setRoleId"; |
| | | |
| | | /** |
| | | * 拦截逻辑实现 |
| | |
| | | if (entity instanceof BaseEntity) { |
| | | //Class<? extends Object> entityClass = entity.getClass(); |
| | | Class<?> entityClass = entity.getClass(); |
| | | Method setMt = null ; |
| | | Method setId = null ; |
| | | Method setUserId = null ; |
| | | Method setRoleId = null ; |
| | | try{ |
| | | /* |
| | | // 添加用户时userId为自动生成主键。roleId存在时是为用户绑角色 |
| | | String jsonString = JSONObject.toJSONString(entity, JSONWriter.Feature.WriteMapNullValue); |
| | | JSONObject jsonObject = JSONObject.parseObject(jsonString); |
| | | if(jsonObject.containsKey("userId") && !jsonObject.containsKey("roleId")) { |
| | | setMt = entityClass.getMethod(BASE_FIELD_SET_PRIMARY_KEY_FUNTION_NAME2, Long.class) ; |
| | | setUserId = entityClass.getMethod(BASE_FIELD_SET_PRIMARY_KEY_FUNTION_SETUSERID, Long.class) ; |
| | | setRoleId = entityClass.getMethod(BASE_FIELD_SET_PRIMARY_KEY_FUNTION_SETROLEID, Long.class) ; |
| | | }else { |
| | | //有一些实体没有id,例如中间表 |
| | | setMt = entityClass.getMethod(BASE_FIELD_SET_PRIMARY_KEY_FUNTION_NAME, Long.class) ; |
| | | setId = entityClass.getMethod(BASE_FIELD_SET_PRIMARY_KEY_FUNTION_SETID, Long.class) ; |
| | | } |
| | | */ |
| | | //有一些实体没有id,例如中间表 |
| | | setId = entityClass.getMethod(BASE_FIELD_SET_PRIMARY_KEY_FUNTION_SETID, Long.class) ; |
| | | // BaUser实体中是setUserId, BaUserRole实体中包含setUserId,和setRoleId |
| | | setUserId = entityClass.getMethod(BASE_FIELD_SET_PRIMARY_KEY_FUNTION_SETUSERID, Long.class) ; |
| | | setRoleId = entityClass.getMethod(BASE_FIELD_SET_PRIMARY_KEY_FUNTION_SETROLEID, Long.class) ; |
| | | }catch (Exception e){ |
| | | //当entityClass没有setId方法时,会抛出异常 |
| | | } |
| | | if(setMt != null){ |
| | | setMt.invoke(entity, new IDLongGenerator().generate()); |
| | | if(setUserId != null && setRoleId == null){ |
| | | setUserId.invoke(entity, new IDLongGenerator().generate()); |
| | | }else if(setId != null){ |
| | | setId.invoke(entity, new IDLongGenerator().generate()); |
| | | } |
| | | |
| | | invocation.getArgs()[PARAMETER_INDEX] = entity; |
| | | } |
| | | } |
| | |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 此接口拦截器(AutoGenerateIdInterceptor【自动什值ID】)中用到。 |
| | | */ |
| | | public interface BaseEntity extends Serializable { |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoIr; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoIr.IrGroupUnit; |
| | | import com.dy.pipIrrGlobal.pojoIr.IrIrrigateGroup; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/5/22 13:41 |
| | | * @LastEditTime :2024/5/22 13:41 |
| | | * @Description |
| | | */ |
| | | @Mapper |
| | | public interface IrGroupUnitMapper extends BaseMapper<IrGroupUnit> { |
| | | //增 |
| | | int insertSelective(IrGroupUnit record); |
| | | |
| | | //删 |
| | | int deleteLogicById(Long id); |
| | | |
| | | //删by unitId groupId |
| | | int deleteByUnitIdGroupId(IrGroupUnit record); |
| | | //删by unitId |
| | | int deleteByUnitId(Long unitId); |
| | | //删by groupId |
| | | int deleteByGroupId(Long groupId); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoIr; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoIr.IrIrrigateGroup; |
| | | import com.dy.pipIrrGlobal.pojoIr.IrIrrigateUnit; |
| | | import com.dy.pipIrrGlobal.voIr.VoGroup; |
| | | import com.dy.pipIrrGlobal.voIr.VoGroupOne; |
| | | import com.dy.pipIrrGlobal.voIr.VoUnit; |
| | | import com.dy.pipIrrGlobal.voIr.VoUnitOne; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/5/21 15:32 |
| | | * @LastEditTime :2024/5/21 15:32 |
| | | * @Description |
| | | */ |
| | | @Mapper |
| | | public interface IrIrrigateGroupMapper extends BaseMapper<IrIrrigateGroup> { |
| | | //增 |
| | | int insertSelective(IrIrrigateGroup record); |
| | | |
| | | //删 |
| | | int deleteLogicById(Long id); |
| | | |
| | | //改 |
| | | int updateByPrimaryKeySelective(IrIrrigateGroup record); |
| | | |
| | | //查一个 |
| | | VoGroupOne selectById(Long id); |
| | | |
| | | /** |
| | | * 根据指定条件获取取水口记录数 |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getRecordCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件获取取水口记录 |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoGroup> getIrrigateGroups(Map<?, ?> params); |
| | | } |
| | |
| | | package com.dy.pipIrrGlobal.daoIr; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoIr.IrIrrigateUnit; |
| | | import com.dy.pipIrrGlobal.voIr.VoProject; |
| | | import com.dy.pipIrrGlobal.voIr.VoProjectOne; |
| | | import com.dy.pipIrrGlobal.voIr.VoUnit; |
| | | import com.dy.pipIrrGlobal.voIr.VoUnitOne; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | |
| | | * @Description |
| | | */ |
| | | @Mapper |
| | | public interface IrIrrigateUnitMapper { |
| | | public interface IrIrrigateUnitMapper extends BaseMapper<IrIrrigateUnit> { |
| | | //增 |
| | | int insertSelective(IrIrrigateUnit record); |
| | | |
| | | //删 |
| | | int deleteLogicById(Long id); |
| | | |
| | | //改 |
| | | int updateByPrimaryKeySelective(IrIrrigateUnit record); |
| | | |
| | | //查一个 |
| | | VoUnitOne selectById(Long id); |
| | | |
| | | /** |
| | | * 根据指定条件获取取水口记录数 |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getRecordCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件获取取水口记录 |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoUnit> getUnits(Map<?, ?> params); |
| | | } |
| | |
| | | Long getSupperByVillageId(long vaId); |
| | | |
| | | /** |
| | | * 根据指定条件获取取水口记录数 |
| | | * 根据指定条件获取项目记录数 |
| | | * |
| | | * @param params |
| | | * @return |
| | |
| | | Long getRecordCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件获取取水口记录 |
| | | * 根据指定条件获取项目记录 |
| | | * |
| | | * @param params |
| | | * @return |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmAlarmStateHistory; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @Author liurunyu |
| | | * @Date 2024/1/16 11:18 |
| | | * @LastEditTime 2024/1/16 11:18 |
| | | * @Author: liurunyu |
| | | * @Date: 2024/5/20 20:20 |
| | | * @Description |
| | | */ |
| | | */ |
| | | @Mapper |
| | | public interface RmAlarmStateHistoryMapper extends BaseMapper<RmAlarmStateHistory> { |
| | | public interface RmAlarmStateHistoryMapper { |
| | | /** |
| | | * delete by primary key |
| | | * |
| | | * @param id primaryKey |
| | | * @return deleteCount |
| | | */ |
| | |
| | | |
| | | /** |
| | | * insert record to table |
| | | * |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | |
| | | |
| | | /** |
| | | * insert record to table selective |
| | | * |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | |
| | | |
| | | /** |
| | | * select by primary key |
| | | * |
| | | * @param id primary key |
| | | * @return object by primary key |
| | | */ |
| | |
| | | |
| | | /** |
| | | * update record selective |
| | | * |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | |
| | | |
| | | /** |
| | | * update record |
| | | * |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmAlarmStateLast; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author liurunyu |
| | | * @Date 2024/1/16 11:18 |
| | | * @LastEditTime 2024/1/16 11:18 |
| | | * @Author: liurunyu |
| | | * @Date: 2024/5/20 19:55 |
| | | * @Description |
| | | */ |
| | | */ |
| | | @Mapper |
| | | public interface RmAlarmStateLastMapper extends BaseMapper<RmAlarmStateLast> { |
| | | public interface RmAlarmStateLastMapper { |
| | | /** |
| | | * delete by primary key |
| | | * |
| | | * @param id primaryKey |
| | | * @return deleteCount |
| | | */ |
| | |
| | | |
| | | /** |
| | | * insert record to table |
| | | * |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | |
| | | |
| | | /** |
| | | * insert record to table selective |
| | | * |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | |
| | | |
| | | /** |
| | | * select by primary key |
| | | * |
| | | * @param id primary key |
| | | * @return object by primary key |
| | | */ |
| | | RmAlarmStateLast selectByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * select by rtuAddr |
| | | * @param rtuAddr rtuAddr |
| | | * @return object by rtuAddr |
| | | */ |
| | | List<RmAlarmStateLast> selectByRtuAddr(String rtuAddr); |
| | | |
| | | /** |
| | | * update record selective |
| | | * |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | |
| | | |
| | | /** |
| | | * update record |
| | | * |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKey(RmAlarmStateLast record); |
| | | |
| | | /** |
| | | * select by rtuAddr |
| | | * |
| | | * @param rtuAddr rtuAddr |
| | | * @return object by rtuAddr |
| | | */ |
| | | List<RmAlarmStateLast> selectByRtuAddr(String rtuAddr); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoIr; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.po.BaseEntity; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import lombok.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/5/22 13:43 |
| | | * @LastEditTime :2024/5/22 13:43 |
| | | * @Description |
| | | */ |
| | | /** |
| | | * 轮灌组灌溉单元中间表 |
| | | */ |
| | | |
| | | @TableName(value="ir_group_unit", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "轮灌组灌溉单元中间表实体") |
| | | public class IrGroupUnit implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202405221354001L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | @Schema(description = "实体id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 轮灌组ID |
| | | */ |
| | | @Schema(description = "轮灌组ID", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotNull(message = "轮灌组ID不能为空") |
| | | private Long groupId; |
| | | |
| | | /** |
| | | * 灌溉单元ID |
| | | */ |
| | | @Schema(description = "灌溉单元ID", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotNull(message = "灌溉单元ID不能为空") |
| | | private Long unitId; |
| | | |
| | | /** |
| | | * 操作人ID |
| | | */ |
| | | @Schema(description = "操作人ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotNull(message = "操作人ID不能为空") |
| | | private Long operator; |
| | | |
| | | /** |
| | | * 操作时间 |
| | | */ |
| | | @Schema(description = "操作时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Date operateDt; |
| | | |
| | | |
| | | /** |
| | | * 逻辑删除标识;0-未删除,1-删除 |
| | | */ |
| | | @Schema(description = "删除标识", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Byte deleted; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoIr; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.po.BaseEntity; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import lombok.*; |
| | | import org.apache.logging.log4j.core.config.plugins.validation.constraints.NotBlank; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/5/21 15:34 |
| | | * @LastEditTime :2024/5/21 15:34 |
| | | * @Description |
| | | */ |
| | | /** |
| | | * 轮灌组表 |
| | | */ |
| | | |
| | | @TableName(value="ir_irrigate_group", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "轮灌组实体") |
| | | public class IrIrrigateGroup implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202405211534001L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | @Schema(description = "实体id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 轮灌组编码 |
| | | */ |
| | | @Schema(description = "轮灌组编码", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotBlank(message = "轮灌组编码不能为空") |
| | | private String groupCode; |
| | | |
| | | /** |
| | | * 项目ID |
| | | */ |
| | | @Schema(description = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotNull(message = "项目ID不能为空") |
| | | private Long projectId; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | private String remarks; |
| | | |
| | | /** |
| | | * 操作人ID |
| | | */ |
| | | @Schema(description = "操作人ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotNull(message = "操作人ID不能为空") |
| | | private Long operator; |
| | | |
| | | /** |
| | | * 操作时间 |
| | | */ |
| | | @Schema(description = "操作时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Date operateDt; |
| | | |
| | | |
| | | /** |
| | | * 逻辑删除标识;0-未删除,1-删除 |
| | | */ |
| | | @Schema(description = "删除标识", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Byte deleted; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.po.BaseEntity; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import lombok.*; |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | import java.util.Date; |
| | | |
| | |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "项目实体") |
| | | public class IrIrrigateUnit { |
| | | @Schema(name = "灌溉单元实体") |
| | | public class IrIrrigateUnit implements BaseEntity { |
| | | public static final long serialVersionUID = 202405161833001L; |
| | | |
| | | /** |
| | |
| | | * 灌溉面积 |
| | | */ |
| | | @Schema(description = "灌溉面积", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @Length(message = "项目名称不大于{max}字",max = 12) |
| | | private float area; |
| | | private Float area; |
| | | /** |
| | | * 操作人ID |
| | | */ |
| | |
| | | package com.dy.pipIrrGlobal.pojoRm; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author liurunyu |
| | | * @Date 2024/1/16 11:03 |
| | | * @LastEditTime 2024/1/16 11:03 |
| | | * @Description 控制器报警与状态(历史) |
| | | */ |
| | | * @Author: liurunyu |
| | | * @Date: 2024/5/20 20:20 |
| | | * @Description |
| | | */ |
| | | |
| | | /** |
| | | * 控制器报警与状态(历史) |
| | | */ |
| | | @TableName(value="rm_alarm_state_history", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | |
| | | @AllArgsConstructor |
| | | @Schema(name = "控制器报警与状态(历史)") |
| | | public class RmAlarmStateHistory implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202401161104001L; |
| | | public static final long serialVersionUID = 202405202021001L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | public Long id; |
| | | |
| | | /** |
| | | * 控制器实体ID(外键) |
| | | */ |
| | | @Schema(description = "控制器实体外键", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long controllerid; |
| | | public Long controllerId; |
| | | |
| | | /** |
| | | * 取水口ID(外键) |
| | | */ |
| | | @Schema(description = "取水口实体外键", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long intakeid; |
| | | public Long intakeId; |
| | | |
| | | /** |
| | | * 控制器地址 |
| | | */ |
| | | @Schema(description = "控制器地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public String rtuaddr; |
| | | public String rtuAddr; |
| | | |
| | | /** |
| | | * 上报日期时间 |
| | | */ |
| | | @Schema(description = "上报日期时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | public Date dt; |
| | | |
| | | /** |
| | | * 控制器时钟 |
| | | */ |
| | | @Schema(description = "控制器时钟", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | public Date rtudt; |
| | | /** |
| | | * 报警-蓄电池电压(1报警,0正常) |
| | | */ |
| | | @Schema(description = "报警-蓄电池电压(1报警,0正常)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte bateryvolt; |
| | | public Date rtuDt; |
| | | |
| | | /** |
| | | * 报警-漏损(1报警,0正常) |
| | | * 状态-阀门/泵(1打开、0关闭) |
| | | */ |
| | | @Schema(description = "报警-蓄电池电压(1报警,0正常)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte loss; |
| | | public Byte valveState; |
| | | |
| | | /** |
| | | * 报警-仪表(1报警,0正常) |
| | | * 剩余水量小于报警上限报警报警(1:报警, 0:正常) |
| | | */ |
| | | @Schema(description = "报警-仪表(1报警,0正常)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte meter; |
| | | public Byte alarmRemainWater; |
| | | |
| | | /** |
| | | * 报警-阀门(1报警,0正常) |
| | | * 剩余水量为0关泵/阀(1:关泵,0:正常) |
| | | */ |
| | | @Schema(description = "报警-阀门(1报警,0正常)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte valve; |
| | | public Byte alarm0WaterRemain; |
| | | |
| | | /** |
| | | * 状态-IC卡功能(1有效、0无效) |
| | | * 年用水量大于限制水量报警(1:报警 0:正常) |
| | | */ |
| | | @Schema(description = "状态-IC卡功能(1有效、0无效)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte iccard; |
| | | public Byte alarmExceedYear; |
| | | |
| | | /** |
| | | * 状态-工作(1启动、0停止) |
| | | * 流量计故障(1:报警,0:正常) |
| | | */ |
| | | @Schema(description = "报警-仪表(1报警,0正常)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte working; |
| | | public Byte alarmWaterMeterFault; |
| | | |
| | | /** |
| | | * 状态-阀门(1打开、0关闭) |
| | | * 漏损(偷水)报警(1:报警, 0:正常) |
| | | */ |
| | | @Schema(description = "状态-阀门(1打开、0关闭)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte valvestate; |
| | | public Byte alarmLoss; |
| | | |
| | | /** |
| | | * 流量计损坏(正常通讯但瞬时为0)报警(1:报警,0:正常) |
| | | */ |
| | | public Byte alarmWaterMeterBreak; |
| | | |
| | | /** |
| | | * 电表故障报警(1:报警,0:正常) |
| | | */ |
| | | public Byte alarmEleMeterFault; |
| | | |
| | | /** |
| | | * 剩余金额为0(1:报警,0:正常) |
| | | */ |
| | | public Byte alarm0MoneyRemain; |
| | | |
| | | /** |
| | | * 控制器内门报警(1:报警,0:正常) |
| | | */ |
| | | public Byte alarmInnerDoor; |
| | | |
| | | /** |
| | | * 控制器外门打开报警(1:报警,0:正常) |
| | | */ |
| | | public Byte alarmOuterDoor; |
| | | |
| | | /** |
| | | * 交流缺项报警(1:报警,0:正常) |
| | | */ |
| | | public Byte alarmEleMiss; |
| | | |
| | | /** |
| | | * 交流过流报警(1:报警,0:正常) |
| | | */ |
| | | public Byte alarmEleExceed; |
| | | |
| | | /** |
| | | * 三相电欠压报警(1:报警,0:正常) |
| | | */ |
| | | public Byte alarmEleLowVolt; |
| | | |
| | | /** |
| | | * IC卡状态(1、有效,0:无效) |
| | | */ |
| | | public Byte stateIcEnable; |
| | | |
| | | } |
| | |
| | | package com.dy.pipIrrGlobal.pojoRm; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author liurunyu |
| | | * @Date 2024/1/16 10:39 |
| | | * @LastEditTime 2024/1/16 10:39 |
| | | * @Description 控制器报警与状态(最新) |
| | | */ |
| | | * @Author: liurunyu |
| | | * @Date: 2024/5/20 19:55 |
| | | * @Description |
| | | */ |
| | | |
| | | /** |
| | | * 控制器报警与状态(最新) |
| | | */ |
| | | @TableName(value="rm_alarm_state_last", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | |
| | | @AllArgsConstructor |
| | | @Schema(name = "控制器报警与状态(最新)") |
| | | public class RmAlarmStateLast implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202401161041001L; |
| | | public static final long serialVersionUID = 202405202021002L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | * 主键 |
| | | */ |
| | | public Long id; |
| | | |
| | | /** |
| | | * 控制器实体ID(外键) |
| | | */ |
| | | @Schema(description = "控制器实体外键", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long controllerid; |
| | | * 控制器实体ID(外键) |
| | | */ |
| | | public Long controllerId; |
| | | |
| | | /** |
| | | * 取水口ID(外键) |
| | | */ |
| | | @Schema(description = "取水口实体外键", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long intakeid; |
| | | public Long intakeId; |
| | | |
| | | /** |
| | | * 控制器地址 |
| | | */ |
| | | @Schema(description = "控制器地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public String rtuaddr; |
| | | * 控制器地址 |
| | | */ |
| | | public String rtuAddr; |
| | | |
| | | /** |
| | | * 上报日期时间 |
| | | */ |
| | | @Schema(description = "上报日期时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | * 上报日期时间 |
| | | */ |
| | | public Date dt; |
| | | |
| | | /** |
| | | * 控制器时钟 |
| | | */ |
| | | @Schema(description = "控制器时钟", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | public Date rtudt; |
| | | * 控制器时钟 |
| | | */ |
| | | public Date rtuDt; |
| | | |
| | | /** |
| | | * 报警-蓄电池电压(1报警,0正常) |
| | | */ |
| | | @Schema(description = "报警-蓄电池电压(1报警,0正常)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte bateryvolt; |
| | | * 状态-阀门/泵(1打开、0关闭) |
| | | */ |
| | | public Byte valveState; |
| | | |
| | | /** |
| | | * 报警-漏损(1报警,0正常) |
| | | */ |
| | | @Schema(description = "报警-蓄电池电压(1报警,0正常)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte loss; |
| | | * 剩余水量小于报警上限报警报警(1:报警, 0:正常) |
| | | */ |
| | | public Byte alarmRemainWater; |
| | | |
| | | /** |
| | | * 报警-仪表(1报警,0正常) |
| | | */ |
| | | @Schema(description = "报警-仪表(1报警,0正常)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte meter; |
| | | * 剩余水量为0关泵/阀(1:关泵,0:正常) |
| | | */ |
| | | public Byte alarm0WaterRemain; |
| | | |
| | | /** |
| | | * 报警-阀门(1报警,0正常) |
| | | */ |
| | | @Schema(description = "报警-阀门(1报警,0正常)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte valve; |
| | | * 年用水量大于限制水量报警(1:报警 0:正常) |
| | | */ |
| | | public Byte alarmExceedYear; |
| | | |
| | | /** |
| | | * 状态-IC卡功能(1有效、0无效) |
| | | */ |
| | | @Schema(description = "状态-IC卡功能(1有效、0无效)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte iccard; |
| | | * 流量计故障(1:报警,0:正常) |
| | | */ |
| | | public Byte alarmWaterMeterFault; |
| | | |
| | | /** |
| | | * 状态-工作(1启动、0停止) |
| | | */ |
| | | @Schema(description = "报警-仪表(1报警,0正常)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte working; |
| | | * 漏损(偷水)报警(1:报警, 0:正常) |
| | | */ |
| | | public Byte alarmLoss; |
| | | |
| | | /** |
| | | * 状态-阀门(1打开、0关闭) |
| | | */ |
| | | @Schema(description = "状态-阀门(1打开、0关闭)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Byte valvestate; |
| | | * 流量计损坏(正常通讯但瞬时为0)报警(1:报警,0:正常) |
| | | */ |
| | | public Byte alarmWaterMeterBreak; |
| | | |
| | | /** |
| | | * 电表故障报警(1:报警,0:正常) |
| | | */ |
| | | public Byte alarmEleMeterFault; |
| | | |
| | | /** |
| | | * 剩余金额为0(1:报警,0:正常) |
| | | */ |
| | | public Byte alarm0MoneyRemain; |
| | | |
| | | /** |
| | | * 控制器内门报警(1:报警,0:正常) |
| | | */ |
| | | public Byte alarmInnerDoor; |
| | | |
| | | /** |
| | | * 控制器外门打开报警(1:报警,0:正常) |
| | | */ |
| | | public Byte alarmOuterDoor; |
| | | |
| | | /** |
| | | * 交流缺项报警(1:报警,0:正常) |
| | | */ |
| | | public Byte alarmEleMiss; |
| | | |
| | | /** |
| | | * 交流过流报警(1:报警,0:正常) |
| | | */ |
| | | public Byte alarmEleExceed; |
| | | |
| | | /** |
| | | * 三相电欠压报警(1:报警,0:正常) |
| | | */ |
| | | public Byte alarmEleLowVolt; |
| | | |
| | | /** |
| | | * IC卡状态(1、有效,0:无效) |
| | | */ |
| | | public Byte stateIcEnable; |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voIr; |
| | | |
| | | import com.dy.common.po.BaseEntity; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/5/21 16:34 |
| | | * @LastEditTime :2024/5/21 16:34 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @Schema(name = "轮灌组视图") |
| | | public class VoGroup implements BaseEntity { |
| | | @Schema(description = "所属项目名称") |
| | | public String projectName; |
| | | |
| | | @Schema(description = "轮灌组编码") |
| | | private String groupCode; |
| | | |
| | | @Schema(description = "灌溉单元数量") |
| | | private Integer itemCount; |
| | | |
| | | @Schema(description = "轮灌组ID") |
| | | private String id; |
| | | |
| | | |
| | | @Schema(description = "备注") |
| | | private String remarks; |
| | | |
| | | @Schema(description = "所属项目Id") |
| | | public String projectId; |
| | | |
| | | /** |
| | | * 操作人名字 |
| | | */ |
| | | @Schema(description = "操作人名字") |
| | | private String operatorName; |
| | | |
| | | @Schema(description = "操作人Id") |
| | | private String operator; |
| | | |
| | | /** |
| | | * 操作时间 |
| | | */ |
| | | @Schema(description = "操作时间") |
| | | private Date operateDt; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voIr; |
| | | |
| | | import com.dy.common.po.BaseEntity; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/5/21 16:34 |
| | | * @LastEditTime :2024/5/21 16:34 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @Schema(name = "轮灌组视图(查一个)") |
| | | public class VoGroupOne implements BaseEntity { |
| | | @Schema(description = "所属项目名称") |
| | | public String projectName; |
| | | |
| | | @Schema(description = "轮灌组编码") |
| | | private String groupCode; |
| | | |
| | | @Schema(description = "灌溉单元数量") |
| | | private Integer itemCount; |
| | | |
| | | @Schema(description = "轮灌组ID") |
| | | private String id; |
| | | |
| | | |
| | | @Schema(description = "备注") |
| | | private String remarks; |
| | | |
| | | @Schema(description = "所属项目Id") |
| | | public String projectId; |
| | | |
| | | /** |
| | | * 操作人名字 |
| | | */ |
| | | @Schema(description = "操作人名字") |
| | | private String operatorName; |
| | | |
| | | @Schema(description = "操作人Id") |
| | | private String operator; |
| | | |
| | | /** |
| | | * 操作时间 |
| | | */ |
| | | @Schema(description = "操作时间") |
| | | private Date operateDt; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voIr; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.annotation.write.style.ColumnWidth; |
| | | import com.dy.common.po.BaseEntity; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/5/21 9:04 |
| | | * @LastEditTime :2024/5/21 9:04 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @Schema(title = "灌溉单元视图对象") |
| | | public class VoUnit implements BaseEntity { |
| | | @Schema(description = "所属项目名称") |
| | | public String projectName; |
| | | |
| | | @Schema(description = "轮灌组编码") |
| | | private int groupCode; |
| | | |
| | | @Schema(description = "灌溉单元ID") |
| | | private String unitId; |
| | | |
| | | @Schema(description = "灌溉面积") |
| | | private Integer area; |
| | | |
| | | @Schema(description = "备注") |
| | | private String remarks; |
| | | |
| | | @Schema(description = "所属项目Id") |
| | | public String projectId; |
| | | |
| | | /** |
| | | * 操作人名字 |
| | | */ |
| | | @Schema(description = "操作人名字") |
| | | private String operatorName; |
| | | |
| | | @Schema(description = "操作人Id") |
| | | private String operator; |
| | | |
| | | /** |
| | | * 操作时间 |
| | | */ |
| | | @Schema(description = "操作时间") |
| | | private Date operateDt; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voIr; |
| | | |
| | | import com.dy.common.po.BaseEntity; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/5/21 9:05 |
| | | * @LastEditTime :2024/5/21 9:05 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @Schema(name = "灌溉单元视图(查一个)") |
| | | public class VoUnitOne implements BaseEntity { |
| | | @Schema(description = "所属项目名称") |
| | | public String projectName; |
| | | |
| | | @Schema(description = "轮灌组编码") |
| | | private int groupCode; |
| | | |
| | | @Schema(description = "灌溉单元ID") |
| | | private String id; |
| | | |
| | | @Schema(description = "灌溉面积") |
| | | private Integer area; |
| | | |
| | | @Schema(description = "备注") |
| | | private String remarks; |
| | | |
| | | @Schema(description = "所属项目Id") |
| | | public String projectId; |
| | | |
| | | /** |
| | | * 操作人名字 |
| | | */ |
| | | @Schema(description = "操作人名字") |
| | | private String operatorName; |
| | | |
| | | @Schema(description = "操作人Id") |
| | | private String operator; |
| | | |
| | | /** |
| | | * 操作时间 |
| | | */ |
| | | @Schema(description = "操作时间") |
| | | private Date operateDt; |
| | | } |
New file |
| | |
| | | <?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.dy.pipIrrGlobal.daoIr.IrGroupUnitMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoIr.IrGroupUnit"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table ir_group_unit--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="group_id" jdbcType="BIGINT" property="groupId" /> |
| | | <result column="unit_id" jdbcType="BIGINT" property="unitId" /> |
| | | <result column="operator" jdbcType="BIGINT" property="operator" /> |
| | | <result column="operate_time" jdbcType="TIMESTAMP" property="operateDt" /> |
| | | <result column="deleted" jdbcType="TINYINT" property="deleted" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, group_id, unit_id, `operator`, |
| | | operate_time, deleted |
| | | </sql> |
| | | |
| | | <!--添加--> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoIr.IrGroupUnit"> |
| | | <!--@mbg.generated--> |
| | | insert into ir_group_unit |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="groupId != null"> |
| | | group_id, |
| | | </if> |
| | | <if test="unitId != null"> |
| | | unit_id, |
| | | </if> |
| | | <if test="operator != null"> |
| | | `operator`, |
| | | </if> |
| | | <if test="operateDt != null"> |
| | | operate_time, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | deleted, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="groupId != null"> |
| | | #{groupId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="unitId != null"> |
| | | #{unitId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="operator != null"> |
| | | #{operator,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="operateDt != null"> |
| | | #{operateDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | #{deleted,jdbcType=TINYINT}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <!--逻辑删除--> |
| | | <delete id="deleteLogicById" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | update ir_group_unit |
| | | set deleted = 1 |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | <delete id="deleteByUnitIdGroupId" parameterType="com.dy.pipIrrGlobal.pojoIr.IrGroupUnit"> |
| | | update ir_group_unit |
| | | set deleted = 1,operator = #{operator,jdbcType=BIGINT},operate_time = #{operateDt,jdbcType=TIMESTAMP} |
| | | where group_id = #{groupId,jdbcType=BIGINT} and unit_id = #{unitId,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | <delete id="deleteByUnitId"> |
| | | update ir_group_unit |
| | | set deleted = 1 |
| | | where unit_id = #{unitId,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | <delete id="deleteByGroupId"> |
| | | update ir_group_unit |
| | | set deleted = 1 |
| | | where group_id = #{groupId,jdbcType=BIGINT} |
| | | </delete> |
| | | </mapper> |
New file |
| | |
| | | <?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.dy.pipIrrGlobal.daoIr.IrIrrigateGroupMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoIr.IrIrrigateGroup"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table ir_irrigate_group--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="project_id" jdbcType="BIGINT" property="projectId" /> |
| | | <result column="group_code" jdbcType="VARCHAR" property="groupCode" /> |
| | | <result column="remarks" jdbcType="VARCHAR" property="remarks" /> |
| | | <result column="operator" jdbcType="BIGINT" property="operator" /> |
| | | <result column="operate_time" jdbcType="TIMESTAMP" property="operateDt" /> |
| | | <result column="deleted" jdbcType="TINYINT" property="deleted" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, project_id, group_code, remarks, `operator`, |
| | | operate_time, deleted |
| | | </sql> |
| | | <!--添加--> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoIr.IrIrrigateGroup"> |
| | | <!--@mbg.generated--> |
| | | insert into ir_irrigate_group |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="projectId != null"> |
| | | project_id, |
| | | </if> |
| | | <if test="groupCode != null"> |
| | | group_code, |
| | | </if> |
| | | <if test="remarks != null"> |
| | | remarks, |
| | | </if> |
| | | <if test="operator != null"> |
| | | `operator`, |
| | | </if> |
| | | <if test="operateDt != null"> |
| | | operate_time, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | deleted, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="projectId != null"> |
| | | #{projectId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="groupCode != null"> |
| | | #{groupCode,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="remarks != null"> |
| | | #{remarks,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="operator != null"> |
| | | #{operator,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="operateDt != null"> |
| | | #{operateDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | #{deleted,jdbcType=TINYINT}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <!--逻辑删除--> |
| | | <delete id="deleteLogicById" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | update ir_irrigate_group |
| | | set deleted = 1 |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | <!--修改一个轮罐组--> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoIr.IrIrrigateGroup"> |
| | | update ir_irrigate_group |
| | | <set> |
| | | <if test="projectId != null"> |
| | | project_id = #{projectId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="groupCode != null"> |
| | | group_code = #{groupCode,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="remarks != null"> |
| | | remarks = #{remarks,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="operator != null"> |
| | | operator = #{operator,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="operateDt != null"> |
| | | operate_time = #{operateDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | deleted = #{deleted,jdbcType=TINYINT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <!--查一个轮罐组--> |
| | | <select id="selectById" resultType="com.dy.pipIrrGlobal.voIr.VoGroupOne"> |
| | | select |
| | | CAST(pro.id AS char)AS projectId, |
| | | pro.project_name AS projectName, |
| | | CAST(gro.id AS char)AS id, |
| | | CAST(gro.operator AS char)AS operator, |
| | | cli.name AS operatorName, |
| | | gro.group_code AS groupCode, |
| | | COUNT(gu.group_id) AS itemCount, |
| | | gro.remarks, |
| | | gro.operate_time AS operateDt |
| | | from ir_irrigate_group gro |
| | | left join ir_project pro on pro.id = gro.project_id |
| | | left join se_client cli on cli.id = gro.operator |
| | | left join ir_group_unit gu on gu.group_id = gro.id |
| | | where gro.id = #{id,jdbcType=BIGINT} and gro.deleted = 0 and gu.deleted = 0 and pro.deleted = 0 |
| | | </select> |
| | | |
| | | <!--分页查轮灌组--> |
| | | <select id="getIrrigateGroups" resultType="com.dy.pipIrrGlobal.voIr.VoGroup"> |
| | | SELECT |
| | | CAST(pro.id AS char)AS projectId, |
| | | pro.project_name AS projectName, |
| | | CAST(gro.id AS char)AS id, |
| | | CAST(gro.operator AS char)AS operator, |
| | | cli.name AS operatorName, |
| | | gro.group_code AS groupCode, |
| | | COUNT(gu.group_id) AS itemCount, |
| | | gro.remarks, |
| | | gro.operate_time AS operateDt |
| | | from ir_irrigate_group gro |
| | | left join ir_project pro on pro.id = gro.project_id |
| | | left join se_client cli on cli.id = gro.operator |
| | | left join ir_group_unit gu on gu.group_id = gro.id |
| | | <where> |
| | | gro.deleted = 0 and gu.deleted = 0 and pro.deleted = 0 |
| | | <if test="projectName != null and projectName != ''"> |
| | | AND pro.project_name LIKE CONCAT('%', #{projectName}, '%') |
| | | </if> |
| | | <if test="groupCode != null and groupCode != ''"> |
| | | AND gro.group_code = #{groupCode} |
| | | </if> |
| | | </where> |
| | | ORDER BY gro.operate_time DESC |
| | | <if test="pageCurr != null and pageSize != null"> |
| | | LIMIT ${(pageCurr-1)*pageSize}, ${pageSize} |
| | | </if> |
| | | </select> |
| | | <!--分页查轮灌组记录数--> |
| | | <select id="getRecordCount" resultType="java.lang.Long"> |
| | | SELECT COUNT(*) AS recordCount |
| | | from ir_irrigate_group gro |
| | | left join ir_project pro on pro.id = gro.project_id |
| | | left join se_client cli on cli.id = gro.operator |
| | | left join ir_group_unit gu on gu.group_id = gro.id |
| | | <where> |
| | | gro.deleted = 0 and gu.deleted = 0 and pro.deleted = 0 |
| | | <if test="projectName != null and projectName != ''"> |
| | | AND pro.project_name LIKE CONCAT('%', #{projectName}, '%') |
| | | </if> |
| | | <if test="groupCode != null and groupCode != ''"> |
| | | AND gro.group_code = #{groupCode} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |
| | |
| | | <?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.dy.pipIrrGlobal.daoIr.IrIrrigateUnitMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoIr.IrProject"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoIr.IrIrrigateUnit"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table ir_project--> |
| | | <!--@Table ir_irrigate_unit--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="project_name" jdbcType="VARCHAR" property="projectName" /> |
| | | <result column="province_id" jdbcType="BIGINT" property="provinceId" /> |
| | | <result column="city_id" jdbcType="BIGINT" property="cityId" /> |
| | | <result column="county_id" jdbcType="BIGINT" property="countyId" /> |
| | | <result column="town_id" jdbcType="BIGINT" property="townId" /> |
| | | <result column="village_id" jdbcType="BIGINT" property="villageId" /> |
| | | <result column="project_state" jdbcType="TINYINT" property="projectState" /> |
| | | <result column="project_id" jdbcType="BIGINT" property="projectId" /> |
| | | <result column="area" jdbcType="FLOAT" property="area" /> |
| | | <result column="remarks" jdbcType="VARCHAR" property="remarks" /> |
| | | <result column="operator" jdbcType="BIGINT" property="operator" /> |
| | | <result column="operate_time" jdbcType="TIMESTAMP" property="operateDt" /> |
| | |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, project_name, province_id, city_id, county_id, town_id, `village_id`, project_state, remarks, `operator`, |
| | | id, project_id, area, remarks, `operator`, |
| | | operate_time, deleted |
| | | </sql> |
| | | |
| | | <!--添加--> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoIr.IrIrrigateUnit"> |
| | | <!--@mbg.generated--> |
| | | insert into ir_irrigate_unit |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="projectId != null"> |
| | | project_id, |
| | | </if> |
| | | <if test="area != null"> |
| | | area, |
| | | </if> |
| | | <if test="remarks != null"> |
| | | remarks, |
| | | </if> |
| | | <if test="operator != null"> |
| | | `operator`, |
| | | </if> |
| | | <if test="operateDt != null"> |
| | | operate_time, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | deleted, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="projectId != null"> |
| | | #{projectId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="area != null"> |
| | | #{area,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="remarks != null"> |
| | | #{remarks,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="operator != null"> |
| | | #{operator,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="operateDt != null"> |
| | | #{operateDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | #{deleted,jdbcType=TINYINT}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <!--逻辑删除--> |
| | | <delete id="deleteLogicById" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | update ir_irrigate_unit |
| | | set deleted = 1 |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <!--修改一个灌溉单元--> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoIr.IrIrrigateUnit"> |
| | | update ir_irrigate_unit |
| | | <set> |
| | | <if test="projectId != null"> |
| | | project_id = #{projectId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="area != null"> |
| | | area = #{area,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="remarks != null"> |
| | | remarks = #{remarks,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="operator != null"> |
| | | operator = #{operator,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="operateDt != null"> |
| | | operate_time = #{operateDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | deleted = #{deleted,jdbcType=TINYINT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <!--查一个灌溉单元--> |
| | | <select id="selectById" resultType="com.dy.pipIrrGlobal.voIr.VoUnitOne"> |
| | | select |
| | | CAST(pro.id AS char)AS projectId, |
| | | pro.project_name AS projectName, |
| | | CAST(uni.id AS char)AS id, |
| | | CAST(uni.operator AS char)AS operator, |
| | | cli.name AS operatorName, |
| | | uni.area, |
| | | uni.remarks, |
| | | uni.operate_time AS operateDt |
| | | from ir_irrigate_unit uni |
| | | left join ir_project pro on pro.id = uni.project_id |
| | | left join se_client cli on cli.id = uni.operator |
| | | where uni.id = #{id,jdbcType=BIGINT} and uni.deleted = 0 |
| | | </select> |
| | | <!--分页查灌溉单元--> |
| | | <select id="getUnits" resultType="com.dy.pipIrrGlobal.voIr.VoUnit"> |
| | | SELECT |
| | | CAST(pro.id AS char)AS projectId, |
| | | pro.project_name AS projectName, |
| | | CAST(uni.id AS char)AS unitId, |
| | | CAST(uni.operator AS char)AS operator, |
| | | cli.name AS operatorName, |
| | | uni.area, |
| | | uni.remarks, |
| | | uni.operate_time AS operateDt |
| | | FROM ir_irrigate_unit uni |
| | | left join ir_project pro on pro.id = uni.project_id |
| | | left join se_client cli on cli.id = uni.operator |
| | | <where> |
| | | uni.deleted = 0 |
| | | <if test="projectName != null and projectName != ''"> |
| | | AND pro.project_name LIKE CONCAT('%', #{projectName}, '%') |
| | | </if> |
| | | <!-- <if test = "groupCode != null and groupCode != ''">--> |
| | | <!-- AND pro.project_state = #{groupCode}--> |
| | | <!-- </if>--> |
| | | </where> |
| | | ORDER BY uni.operate_time DESC |
| | | <if test="pageCurr != null and pageSize != null"> |
| | | LIMIT ${(pageCurr-1)*pageSize}, ${pageSize} |
| | | </if> |
| | | </select> |
| | | <!--分页查灌溉单元记录数--> |
| | | <select id="getRecordCount" resultType="java.lang.Long"> |
| | | SELECT COUNT(*) AS recordCount |
| | | FROM ir_irrigate_unit uni |
| | | left join ir_project pro on pro.id = uni.project_id |
| | | left join se_client cli on cli.id = uni.operator |
| | | <where> |
| | | uni.deleted = 0 |
| | | <if test="projectName != null and projectName != ''"> |
| | | AND pro.project_name LIKE CONCAT('%', #{projectName}, '%') |
| | | </if> |
| | | <!-- <if test = "groupCode != null and groupCode != ''">--> |
| | | <!-- AND pro.project_state = #{groupCode}--> |
| | | <!-- </if>--> |
| | | </where> |
| | | </select> |
| | | </mapper> |
| | |
| | | <!--查询一个信息--> |
| | | <select id="selectById" resultType="com.dy.pipIrrGlobal.voIr.VoProjectOne"> |
| | | select |
| | | CAST(pro.id AS char)AS projectId, |
| | | CAST(pro.id AS char)AS id, |
| | | CAST(pro.province_id AS char)AS provinceId, |
| | | CAST(pro.city_id AS char)AS cityId, |
| | | CAST(pro.county_id AS char)AS countyId, |
| | |
| | | <!--@mbg.generated--> |
| | | <!--@Table rm_alarm_state_history--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="controllerId" jdbcType="BIGINT" property="controllerid" /> |
| | | <result column="intakeId" jdbcType="BIGINT" property="intakeid" /> |
| | | <result column="rtuAddr" jdbcType="VARCHAR" property="rtuaddr" /> |
| | | <result column="controller_id" jdbcType="BIGINT" property="controllerId" /> |
| | | <result column="intake_id" jdbcType="BIGINT" property="intakeId" /> |
| | | <result column="rtu_addr" jdbcType="VARCHAR" property="rtuAddr" /> |
| | | <result column="dt" jdbcType="TIMESTAMP" property="dt" /> |
| | | <result column="rtuDt" jdbcType="TIMESTAMP" property="rtudt" /> |
| | | <result column="bateryVolt" jdbcType="TINYINT" property="bateryvolt" /> |
| | | <result column="loss" jdbcType="TINYINT" property="loss" /> |
| | | <result column="meter" jdbcType="TINYINT" property="meter" /> |
| | | <result column="valve" jdbcType="TINYINT" property="valve" /> |
| | | <result column="icCard" jdbcType="TINYINT" property="iccard" /> |
| | | <result column="working" jdbcType="TINYINT" property="working" /> |
| | | <result column="valveState" jdbcType="TINYINT" property="valvestate" /> |
| | | <result column="rtu_dt" jdbcType="TIMESTAMP" property="rtuDt" /> |
| | | <result column="valve_state" jdbcType="TINYINT" property="valveState" /> |
| | | <result column="alarm_remain_water" jdbcType="TINYINT" property="alarmRemainWater" /> |
| | | <result column="alarm0_water_remain" jdbcType="TINYINT" property="alarm0WaterRemain" /> |
| | | <result column="alarm_exceed_year" jdbcType="TINYINT" property="alarmExceedYear" /> |
| | | <result column="alarm_water_meter_fault" jdbcType="TINYINT" property="alarmWaterMeterFault" /> |
| | | <result column="alarm_loss" jdbcType="TINYINT" property="alarmLoss" /> |
| | | <result column="alarm_water_meter_break" jdbcType="TINYINT" property="alarmWaterMeterBreak" /> |
| | | <result column="alarm_ele_meter_fault" jdbcType="TINYINT" property="alarmEleMeterFault" /> |
| | | <result column="alarm0_money_remain" jdbcType="TINYINT" property="alarm0MoneyRemain" /> |
| | | <result column="alarm_inner_door" jdbcType="TINYINT" property="alarmInnerDoor" /> |
| | | <result column="alarm_outer_door" jdbcType="TINYINT" property="alarmOuterDoor" /> |
| | | <result column="alarm_ele_miss" jdbcType="TINYINT" property="alarmEleMiss" /> |
| | | <result column="alarm_ele_exceed" jdbcType="TINYINT" property="alarmEleExceed" /> |
| | | <result column="alarm_ele_low_volt" jdbcType="TINYINT" property="alarmEleLowVolt" /> |
| | | <result column="state_ic_enable" jdbcType="TINYINT" property="stateIcEnable" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, controllerId, intakeId, rtuAddr, dt, rtuDt, bateryVolt, loss, meter, valve, icCard, |
| | | working, valveState |
| | | id, controller_id, intake_id, rtu_addr, dt, rtu_dt, valve_state, alarm_remain_water, |
| | | alarm0_water_remain, alarm_exceed_year, alarm_water_meter_fault, alarm_loss, alarm_water_meter_break, |
| | | alarm_ele_meter_fault, alarm0_money_remain, alarm_inner_door, alarm_outer_door, alarm_ele_miss, |
| | | alarm_ele_exceed, alarm_ele_low_volt, state_ic_enable |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAlarmStateHistory"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_alarm_state_history (id, controllerId, intakeId, |
| | | rtuAddr, dt, rtuDt, bateryVolt, |
| | | loss, meter, valve, |
| | | icCard, working, valveState |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, #{controllerid,jdbcType=BIGINT}, #{intakeid,jdbcType=BIGINT}, |
| | | #{rtuaddr,jdbcType=VARCHAR}, #{dt,jdbcType=TIMESTAMP}, #{rtudt,jdbcType=TIMESTAMP}, #{bateryvolt,jdbcType=TINYINT}, |
| | | #{loss,jdbcType=TINYINT}, #{meter,jdbcType=TINYINT}, #{valve,jdbcType=TINYINT}, |
| | | #{iccard,jdbcType=TINYINT}, #{working,jdbcType=TINYINT}, #{valvestate,jdbcType=TINYINT} |
| | | ) |
| | | insert into rm_alarm_state_history (id, controller_id, intake_id, |
| | | rtu_addr, dt, rtu_dt, |
| | | valve_state, alarm_remain_water, alarm0_water_remain, |
| | | alarm_exceed_year, alarm_water_meter_fault, |
| | | alarm_loss, alarm_water_meter_break, alarm_ele_meter_fault, |
| | | alarm0_money_remain, alarm_inner_door, alarm_outer_door, |
| | | alarm_ele_miss, alarm_ele_exceed, alarm_ele_low_volt, |
| | | state_ic_enable) |
| | | values (#{id,jdbcType=BIGINT}, #{controllerId,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, |
| | | #{rtuAddr,jdbcType=VARCHAR}, #{dt,jdbcType=TIMESTAMP}, #{rtuDt,jdbcType=TIMESTAMP}, |
| | | #{valveState,jdbcType=TINYINT}, #{alarmRemainWater,jdbcType=TINYINT}, #{alarm0WaterRemain,jdbcType=TINYINT}, |
| | | #{alarmExceedYear,jdbcType=TINYINT}, #{alarmWaterMeterFault,jdbcType=TINYINT}, |
| | | #{alarmLoss,jdbcType=TINYINT}, #{alarmWaterMeterBreak,jdbcType=TINYINT}, #{alarmEleMeterFault,jdbcType=TINYINT}, |
| | | #{alarm0MoneyRemain,jdbcType=TINYINT}, #{alarmInnerDoor,jdbcType=TINYINT}, #{alarmOuterDoor,jdbcType=TINYINT}, |
| | | #{alarmEleMiss,jdbcType=TINYINT}, #{alarmEleExceed,jdbcType=TINYINT}, #{alarmEleLowVolt,jdbcType=TINYINT}, |
| | | #{stateIcEnable,jdbcType=TINYINT}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAlarmStateHistory"> |
| | | <!--@mbg.generated--> |
| | |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="controllerid != null"> |
| | | controllerId, |
| | | <if test="controllerId != null"> |
| | | controller_id, |
| | | </if> |
| | | <if test="intakeid != null"> |
| | | intakeId, |
| | | <if test="intakeId != null"> |
| | | intake_id, |
| | | </if> |
| | | <if test="rtuaddr != null"> |
| | | rtuAddr, |
| | | <if test="rtuAddr != null"> |
| | | rtu_addr, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt, |
| | | </if> |
| | | <if test="rtudt != null"> |
| | | rtuDt, |
| | | <if test="rtuDt != null"> |
| | | rtu_dt, |
| | | </if> |
| | | <if test="bateryvolt != null"> |
| | | bateryVolt, |
| | | <if test="valveState != null"> |
| | | valve_state, |
| | | </if> |
| | | <if test="loss != null"> |
| | | loss, |
| | | <if test="alarmRemainWater != null"> |
| | | alarm_remain_water, |
| | | </if> |
| | | <if test="meter != null"> |
| | | meter, |
| | | <if test="alarm0WaterRemain != null"> |
| | | alarm0_water_remain, |
| | | </if> |
| | | <if test="valve != null"> |
| | | valve, |
| | | <if test="alarmExceedYear != null"> |
| | | alarm_exceed_year, |
| | | </if> |
| | | <if test="iccard != null"> |
| | | icCard, |
| | | <if test="alarmWaterMeterFault != null"> |
| | | alarm_water_meter_fault, |
| | | </if> |
| | | <if test="working != null"> |
| | | working, |
| | | <if test="alarmLoss != null"> |
| | | alarm_loss, |
| | | </if> |
| | | <if test="valvestate != null"> |
| | | valveState, |
| | | <if test="alarmWaterMeterBreak != null"> |
| | | alarm_water_meter_break, |
| | | </if> |
| | | <if test="alarmEleMeterFault != null"> |
| | | alarm_ele_meter_fault, |
| | | </if> |
| | | <if test="alarm0MoneyRemain != null"> |
| | | alarm0_money_remain, |
| | | </if> |
| | | <if test="alarmInnerDoor != null"> |
| | | alarm_inner_door, |
| | | </if> |
| | | <if test="alarmOuterDoor != null"> |
| | | alarm_outer_door, |
| | | </if> |
| | | <if test="alarmEleMiss != null"> |
| | | alarm_ele_miss, |
| | | </if> |
| | | <if test="alarmEleExceed != null"> |
| | | alarm_ele_exceed, |
| | | </if> |
| | | <if test="alarmEleLowVolt != null"> |
| | | alarm_ele_low_volt, |
| | | </if> |
| | | <if test="stateIcEnable != null"> |
| | | state_ic_enable, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="controllerid != null"> |
| | | #{controllerid,jdbcType=BIGINT}, |
| | | <if test="controllerId != null"> |
| | | #{controllerId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="intakeid != null"> |
| | | #{intakeid,jdbcType=BIGINT}, |
| | | <if test="intakeId != null"> |
| | | #{intakeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="rtuaddr != null"> |
| | | #{rtuaddr,jdbcType=VARCHAR}, |
| | | <if test="rtuAddr != null"> |
| | | #{rtuAddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="rtudt != null"> |
| | | #{rtudt,jdbcType=TIMESTAMP}, |
| | | <if test="rtuDt != null"> |
| | | #{rtuDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="bateryvolt != null"> |
| | | #{bateryvolt,jdbcType=TINYINT}, |
| | | <if test="valveState != null"> |
| | | #{valveState,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="loss != null"> |
| | | #{loss,jdbcType=TINYINT}, |
| | | <if test="alarmRemainWater != null"> |
| | | #{alarmRemainWater,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="meter != null"> |
| | | #{meter,jdbcType=TINYINT}, |
| | | <if test="alarm0WaterRemain != null"> |
| | | #{alarm0WaterRemain,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="valve != null"> |
| | | #{valve,jdbcType=TINYINT}, |
| | | <if test="alarmExceedYear != null"> |
| | | #{alarmExceedYear,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="iccard != null"> |
| | | #{iccard,jdbcType=TINYINT}, |
| | | <if test="alarmWaterMeterFault != null"> |
| | | #{alarmWaterMeterFault,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="working != null"> |
| | | #{working,jdbcType=TINYINT}, |
| | | <if test="alarmLoss != null"> |
| | | #{alarmLoss,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="valvestate != null"> |
| | | #{valvestate,jdbcType=TINYINT}, |
| | | <if test="alarmWaterMeterBreak != null"> |
| | | #{alarmWaterMeterBreak,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmEleMeterFault != null"> |
| | | #{alarmEleMeterFault,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarm0MoneyRemain != null"> |
| | | #{alarm0MoneyRemain,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmInnerDoor != null"> |
| | | #{alarmInnerDoor,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmOuterDoor != null"> |
| | | #{alarmOuterDoor,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmEleMiss != null"> |
| | | #{alarmEleMiss,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmEleExceed != null"> |
| | | #{alarmEleExceed,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmEleLowVolt != null"> |
| | | #{alarmEleLowVolt,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="stateIcEnable != null"> |
| | | #{stateIcEnable,jdbcType=TINYINT}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | |
| | | <!--@mbg.generated--> |
| | | update rm_alarm_state_history |
| | | <set> |
| | | <if test="controllerid != null"> |
| | | controllerId = #{controllerid,jdbcType=BIGINT}, |
| | | <if test="controllerId != null"> |
| | | controller_id = #{controllerId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="intakeid != null"> |
| | | intakeId = #{intakeid,jdbcType=BIGINT}, |
| | | <if test="intakeId != null"> |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="rtuaddr != null"> |
| | | rtuAddr = #{rtuaddr,jdbcType=VARCHAR}, |
| | | <if test="rtuAddr != null"> |
| | | rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="rtudt != null"> |
| | | rtuDt = #{rtudt,jdbcType=TIMESTAMP}, |
| | | <if test="rtuDt != null"> |
| | | rtu_dt = #{rtuDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="bateryvolt != null"> |
| | | bateryVolt = #{bateryvolt,jdbcType=TINYINT}, |
| | | <if test="valveState != null"> |
| | | valve_state = #{valveState,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="loss != null"> |
| | | loss = #{loss,jdbcType=TINYINT}, |
| | | <if test="alarmRemainWater != null"> |
| | | alarm_remain_water = #{alarmRemainWater,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="meter != null"> |
| | | meter = #{meter,jdbcType=TINYINT}, |
| | | <if test="alarm0WaterRemain != null"> |
| | | alarm0_water_remain = #{alarm0WaterRemain,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="valve != null"> |
| | | valve = #{valve,jdbcType=TINYINT}, |
| | | <if test="alarmExceedYear != null"> |
| | | alarm_exceed_year = #{alarmExceedYear,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="iccard != null"> |
| | | icCard = #{iccard,jdbcType=TINYINT}, |
| | | <if test="alarmWaterMeterFault != null"> |
| | | alarm_water_meter_fault = #{alarmWaterMeterFault,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="working != null"> |
| | | working = #{working,jdbcType=TINYINT}, |
| | | <if test="alarmLoss != null"> |
| | | alarm_loss = #{alarmLoss,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="valvestate != null"> |
| | | valveState = #{valvestate,jdbcType=TINYINT}, |
| | | <if test="alarmWaterMeterBreak != null"> |
| | | alarm_water_meter_break = #{alarmWaterMeterBreak,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmEleMeterFault != null"> |
| | | alarm_ele_meter_fault = #{alarmEleMeterFault,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarm0MoneyRemain != null"> |
| | | alarm0_money_remain = #{alarm0MoneyRemain,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmInnerDoor != null"> |
| | | alarm_inner_door = #{alarmInnerDoor,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmOuterDoor != null"> |
| | | alarm_outer_door = #{alarmOuterDoor,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmEleMiss != null"> |
| | | alarm_ele_miss = #{alarmEleMiss,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmEleExceed != null"> |
| | | alarm_ele_exceed = #{alarmEleExceed,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmEleLowVolt != null"> |
| | | alarm_ele_low_volt = #{alarmEleLowVolt,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="stateIcEnable != null"> |
| | | state_ic_enable = #{stateIcEnable,jdbcType=TINYINT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAlarmStateHistory"> |
| | | <!--@mbg.generated--> |
| | | update rm_alarm_state_history |
| | | set controllerId = #{controllerid,jdbcType=BIGINT}, |
| | | intakeId = #{intakeid,jdbcType=BIGINT}, |
| | | rtuAddr = #{rtuaddr,jdbcType=VARCHAR}, |
| | | set controller_id = #{controllerId,jdbcType=BIGINT}, |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | rtuDt = #{rtudt,jdbcType=TIMESTAMP}, |
| | | bateryVolt = #{bateryvolt,jdbcType=TINYINT}, |
| | | loss = #{loss,jdbcType=TINYINT}, |
| | | meter = #{meter,jdbcType=TINYINT}, |
| | | valve = #{valve,jdbcType=TINYINT}, |
| | | icCard = #{iccard,jdbcType=TINYINT}, |
| | | working = #{working,jdbcType=TINYINT}, |
| | | valveState = #{valvestate,jdbcType=TINYINT} |
| | | rtu_dt = #{rtuDt,jdbcType=TIMESTAMP}, |
| | | valve_state = #{valveState,jdbcType=TINYINT}, |
| | | alarm_remain_water = #{alarmRemainWater,jdbcType=TINYINT}, |
| | | alarm0_water_remain = #{alarm0WaterRemain,jdbcType=TINYINT}, |
| | | alarm_exceed_year = #{alarmExceedYear,jdbcType=TINYINT}, |
| | | alarm_water_meter_fault = #{alarmWaterMeterFault,jdbcType=TINYINT}, |
| | | alarm_loss = #{alarmLoss,jdbcType=TINYINT}, |
| | | alarm_water_meter_break = #{alarmWaterMeterBreak,jdbcType=TINYINT}, |
| | | alarm_ele_meter_fault = #{alarmEleMeterFault,jdbcType=TINYINT}, |
| | | alarm0_money_remain = #{alarm0MoneyRemain,jdbcType=TINYINT}, |
| | | alarm_inner_door = #{alarmInnerDoor,jdbcType=TINYINT}, |
| | | alarm_outer_door = #{alarmOuterDoor,jdbcType=TINYINT}, |
| | | alarm_ele_miss = #{alarmEleMiss,jdbcType=TINYINT}, |
| | | alarm_ele_exceed = #{alarmEleExceed,jdbcType=TINYINT}, |
| | | alarm_ele_low_volt = #{alarmEleLowVolt,jdbcType=TINYINT}, |
| | | state_ic_enable = #{stateIcEnable,jdbcType=TINYINT} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | <!--@mbg.generated--> |
| | | <!--@Table rm_alarm_state_last--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="controllerId" jdbcType="BIGINT" property="controllerid" /> |
| | | <result column="intakeId" jdbcType="BIGINT" property="intakeid" /> |
| | | <result column="rtuAddr" jdbcType="VARCHAR" property="rtuaddr" /> |
| | | <result column="controller_id" jdbcType="BIGINT" property="controllerId" /> |
| | | <result column="intake_id" jdbcType="BIGINT" property="intakeId" /> |
| | | <result column="rtu_addr" jdbcType="VARCHAR" property="rtuAddr" /> |
| | | <result column="dt" jdbcType="TIMESTAMP" property="dt" /> |
| | | <result column="rtuDt" jdbcType="TIMESTAMP" property="rtudt" /> |
| | | <result column="bateryVolt" jdbcType="TINYINT" property="bateryvolt" /> |
| | | <result column="loss" jdbcType="TINYINT" property="loss" /> |
| | | <result column="meter" jdbcType="TINYINT" property="meter" /> |
| | | <result column="valve" jdbcType="TINYINT" property="valve" /> |
| | | <result column="icCard" jdbcType="TINYINT" property="iccard" /> |
| | | <result column="working" jdbcType="TINYINT" property="working" /> |
| | | <result column="valveState" jdbcType="TINYINT" property="valvestate" /> |
| | | <result column="rtu_dt" jdbcType="TIMESTAMP" property="rtuDt" /> |
| | | <result column="valve_state" jdbcType="TINYINT" property="valveState" /> |
| | | <result column="alarm_remain_water" jdbcType="TINYINT" property="alarmRemainWater" /> |
| | | <result column="alarm0_water_remain" jdbcType="TINYINT" property="alarm0WaterRemain" /> |
| | | <result column="alarm_exceed_year" jdbcType="TINYINT" property="alarmExceedYear" /> |
| | | <result column="alarm_water_meter_fault" jdbcType="TINYINT" property="alarmWaterMeterFault" /> |
| | | <result column="alarm_loss" jdbcType="TINYINT" property="alarmLoss" /> |
| | | <result column="alarm_water_meter_break" jdbcType="TINYINT" property="alarmWaterMeterBreak" /> |
| | | <result column="alarm_ele_meter_fault" jdbcType="TINYINT" property="alarmEleMeterFault" /> |
| | | <result column="alarm0_money_remain" jdbcType="TINYINT" property="alarm0MoneyRemain" /> |
| | | <result column="alarm_inner_door" jdbcType="TINYINT" property="alarmInnerDoor" /> |
| | | <result column="alarm_outer_door" jdbcType="TINYINT" property="alarmOuterDoor" /> |
| | | <result column="alarm_ele_miss" jdbcType="TINYINT" property="alarmEleMiss" /> |
| | | <result column="alarm_ele_exceed" jdbcType="TINYINT" property="alarmEleExceed" /> |
| | | <result column="alarm_ele_low_volt" jdbcType="TINYINT" property="alarmEleLowVolt" /> |
| | | <result column="state_ic_enable" jdbcType="TINYINT" property="stateIcEnable" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, controllerId, intakeId, rtuAddr, dt, rtuDt, bateryVolt, loss, meter, valve, icCard, |
| | | working, valveState |
| | | id, controller_id, intake_id, rtu_addr, dt, rtu_dt, valve_state, alarm_remain_water, |
| | | alarm0_water_remain, alarm_exceed_year, alarm_water_meter_fault, alarm_loss, alarm_water_meter_break, |
| | | alarm_ele_meter_fault, alarm0_money_remain, alarm_inner_door, alarm_outer_door, alarm_ele_miss, |
| | | alarm_ele_exceed, alarm_ele_low_volt, state_ic_enable |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | |
| | | from rm_alarm_state_last |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <select id="selectByRtuAddr" parameterType="java.lang.String" resultMap="BaseResultMap"> |
| | | <select id="selectByRtuAddr" parameterType="java.lang.String" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_alarm_state_last |
| | | where rtuAddr = #{rtuAddr,jdbcType=VARCHAR} |
| | | where rtu_addr = #{rtuAddr,jdbcType=VARCHAR} |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from rm_alarm_state_last |
| | |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAlarmStateLast"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_alarm_state_last (id, controllerId, intakeId, |
| | | rtuAddr, dt, rtuDt, bateryVolt, |
| | | loss, meter, valve, |
| | | icCard, working, valveState |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, #{controllerid,jdbcType=BIGINT}, #{intakeid,jdbcType=BIGINT}, |
| | | #{rtuaddr,jdbcType=VARCHAR}, #{dt,jdbcType=TIMESTAMP}, #{rtudt,jdbcType=TIMESTAMP}, #{bateryvolt,jdbcType=TINYINT}, |
| | | #{loss,jdbcType=TINYINT}, #{meter,jdbcType=TINYINT}, #{valve,jdbcType=TINYINT}, |
| | | #{iccard,jdbcType=TINYINT}, #{working,jdbcType=TINYINT}, #{valvestate,jdbcType=TINYINT} |
| | | ) |
| | | insert into rm_alarm_state_last (id, controller_id, intake_id, |
| | | rtu_addr, dt, rtu_dt, |
| | | valve_state, alarm_remain_water, alarm0_water_remain, |
| | | alarm_exceed_year, alarm_water_meter_fault, |
| | | alarm_loss, alarm_water_meter_break, alarm_ele_meter_fault, |
| | | alarm0_money_remain, alarm_inner_door, alarm_outer_door, |
| | | alarm_ele_miss, alarm_ele_exceed, alarm_ele_low_volt, |
| | | state_ic_enable) |
| | | values (#{id,jdbcType=BIGINT}, #{controllerId,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, |
| | | #{rtuAddr,jdbcType=VARCHAR}, #{dt,jdbcType=TIMESTAMP}, #{rtuDt,jdbcType=TIMESTAMP}, |
| | | #{valveState,jdbcType=TINYINT}, #{alarmRemainWater,jdbcType=TINYINT}, #{alarm0WaterRemain,jdbcType=TINYINT}, |
| | | #{alarmExceedYear,jdbcType=TINYINT}, #{alarmWaterMeterFault,jdbcType=TINYINT}, |
| | | #{alarmLoss,jdbcType=TINYINT}, #{alarmWaterMeterBreak,jdbcType=TINYINT}, #{alarmEleMeterFault,jdbcType=TINYINT}, |
| | | #{alarm0MoneyRemain,jdbcType=TINYINT}, #{alarmInnerDoor,jdbcType=TINYINT}, #{alarmOuterDoor,jdbcType=TINYINT}, |
| | | #{alarmEleMiss,jdbcType=TINYINT}, #{alarmEleExceed,jdbcType=TINYINT}, #{alarmEleLowVolt,jdbcType=TINYINT}, |
| | | #{stateIcEnable,jdbcType=TINYINT}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAlarmStateLast"> |
| | | <!--@mbg.generated--> |
| | |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="controllerid != null"> |
| | | controllerId, |
| | | <if test="controllerId != null"> |
| | | controller_id, |
| | | </if> |
| | | <if test="intakeid != null"> |
| | | intakeId, |
| | | <if test="intakeId != null"> |
| | | intake_id, |
| | | </if> |
| | | <if test="rtuaddr != null"> |
| | | rtuAddr, |
| | | <if test="rtuAddr != null"> |
| | | rtu_addr, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt, |
| | | </if> |
| | | <if test="rtudt != null"> |
| | | rtuDt, |
| | | <if test="rtuDt != null"> |
| | | rtu_dt, |
| | | </if> |
| | | <if test="bateryvolt != null"> |
| | | bateryVolt, |
| | | <if test="valveState != null"> |
| | | valve_state, |
| | | </if> |
| | | <if test="loss != null"> |
| | | loss, |
| | | <if test="alarmRemainWater != null"> |
| | | alarm_remain_water, |
| | | </if> |
| | | <if test="meter != null"> |
| | | meter, |
| | | <if test="alarm0WaterRemain != null"> |
| | | alarm0_water_remain, |
| | | </if> |
| | | <if test="valve != null"> |
| | | valve, |
| | | <if test="alarmExceedYear != null"> |
| | | alarm_exceed_year, |
| | | </if> |
| | | <if test="iccard != null"> |
| | | icCard, |
| | | <if test="alarmWaterMeterFault != null"> |
| | | alarm_water_meter_fault, |
| | | </if> |
| | | <if test="working != null"> |
| | | working, |
| | | <if test="alarmLoss != null"> |
| | | alarm_loss, |
| | | </if> |
| | | <if test="valvestate != null"> |
| | | valveState, |
| | | <if test="alarmWaterMeterBreak != null"> |
| | | alarm_water_meter_break, |
| | | </if> |
| | | <if test="alarmEleMeterFault != null"> |
| | | alarm_ele_meter_fault, |
| | | </if> |
| | | <if test="alarm0MoneyRemain != null"> |
| | | alarm0_money_remain, |
| | | </if> |
| | | <if test="alarmInnerDoor != null"> |
| | | alarm_inner_door, |
| | | </if> |
| | | <if test="alarmOuterDoor != null"> |
| | | alarm_outer_door, |
| | | </if> |
| | | <if test="alarmEleMiss != null"> |
| | | alarm_ele_miss, |
| | | </if> |
| | | <if test="alarmEleExceed != null"> |
| | | alarm_ele_exceed, |
| | | </if> |
| | | <if test="alarmEleLowVolt != null"> |
| | | alarm_ele_low_volt, |
| | | </if> |
| | | <if test="stateIcEnable != null"> |
| | | state_ic_enable, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="controllerid != null"> |
| | | #{controllerid,jdbcType=BIGINT}, |
| | | <if test="controllerId != null"> |
| | | #{controllerId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="intakeid != null"> |
| | | #{intakeid,jdbcType=BIGINT}, |
| | | <if test="intakeId != null"> |
| | | #{intakeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="rtuaddr != null"> |
| | | #{rtuaddr,jdbcType=VARCHAR}, |
| | | <if test="rtuAddr != null"> |
| | | #{rtuAddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="rtudt != null"> |
| | | #{rtudt,jdbcType=TIMESTAMP}, |
| | | <if test="rtuDt != null"> |
| | | #{rtuDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="bateryvolt != null"> |
| | | #{bateryvolt,jdbcType=TINYINT}, |
| | | <if test="valveState != null"> |
| | | #{valveState,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="loss != null"> |
| | | #{loss,jdbcType=TINYINT}, |
| | | <if test="alarmRemainWater != null"> |
| | | #{alarmRemainWater,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="meter != null"> |
| | | #{meter,jdbcType=TINYINT}, |
| | | <if test="alarm0WaterRemain != null"> |
| | | #{alarm0WaterRemain,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="valve != null"> |
| | | #{valve,jdbcType=TINYINT}, |
| | | <if test="alarmExceedYear != null"> |
| | | #{alarmExceedYear,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="iccard != null"> |
| | | #{iccard,jdbcType=TINYINT}, |
| | | <if test="alarmWaterMeterFault != null"> |
| | | #{alarmWaterMeterFault,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="working != null"> |
| | | #{working,jdbcType=TINYINT}, |
| | | <if test="alarmLoss != null"> |
| | | #{alarmLoss,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="valvestate != null"> |
| | | #{valvestate,jdbcType=TINYINT}, |
| | | <if test="alarmWaterMeterBreak != null"> |
| | | #{alarmWaterMeterBreak,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmEleMeterFault != null"> |
| | | #{alarmEleMeterFault,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarm0MoneyRemain != null"> |
| | | #{alarm0MoneyRemain,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmInnerDoor != null"> |
| | | #{alarmInnerDoor,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmOuterDoor != null"> |
| | | #{alarmOuterDoor,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmEleMiss != null"> |
| | | #{alarmEleMiss,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmEleExceed != null"> |
| | | #{alarmEleExceed,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmEleLowVolt != null"> |
| | | #{alarmEleLowVolt,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="stateIcEnable != null"> |
| | | #{stateIcEnable,jdbcType=TINYINT}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | |
| | | <!--@mbg.generated--> |
| | | update rm_alarm_state_last |
| | | <set> |
| | | <if test="controllerid != null"> |
| | | controllerId = #{controllerid,jdbcType=BIGINT}, |
| | | <if test="controllerId != null"> |
| | | controller_id = #{controllerId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="intakeid != null"> |
| | | intakeId = #{intakeid,jdbcType=BIGINT}, |
| | | <if test="intakeId != null"> |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="rtuaddr != null"> |
| | | rtuAddr = #{rtuaddr,jdbcType=VARCHAR}, |
| | | <if test="rtuAddr != null"> |
| | | rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="rtudt != null"> |
| | | rtuDt = #{rtudt,jdbcType=TIMESTAMP}, |
| | | <if test="rtuDt != null"> |
| | | rtu_dt = #{rtuDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="bateryvolt != null"> |
| | | bateryVolt = #{bateryvolt,jdbcType=TINYINT}, |
| | | <if test="valveState != null"> |
| | | valve_state = #{valveState,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="loss != null"> |
| | | loss = #{loss,jdbcType=TINYINT}, |
| | | <if test="alarmRemainWater != null"> |
| | | alarm_remain_water = #{alarmRemainWater,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="meter != null"> |
| | | meter = #{meter,jdbcType=TINYINT}, |
| | | <if test="alarm0WaterRemain != null"> |
| | | alarm0_water_remain = #{alarm0WaterRemain,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="valve != null"> |
| | | valve = #{valve,jdbcType=TINYINT}, |
| | | <if test="alarmExceedYear != null"> |
| | | alarm_exceed_year = #{alarmExceedYear,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="iccard != null"> |
| | | icCard = #{iccard,jdbcType=TINYINT}, |
| | | <if test="alarmWaterMeterFault != null"> |
| | | alarm_water_meter_fault = #{alarmWaterMeterFault,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="working != null"> |
| | | working = #{working,jdbcType=TINYINT}, |
| | | <if test="alarmLoss != null"> |
| | | alarm_loss = #{alarmLoss,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="valvestate != null"> |
| | | valveState = #{valvestate,jdbcType=TINYINT}, |
| | | <if test="alarmWaterMeterBreak != null"> |
| | | alarm_water_meter_break = #{alarmWaterMeterBreak,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmEleMeterFault != null"> |
| | | alarm_ele_meter_fault = #{alarmEleMeterFault,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarm0MoneyRemain != null"> |
| | | alarm0_money_remain = #{alarm0MoneyRemain,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmInnerDoor != null"> |
| | | alarm_inner_door = #{alarmInnerDoor,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmOuterDoor != null"> |
| | | alarm_outer_door = #{alarmOuterDoor,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmEleMiss != null"> |
| | | alarm_ele_miss = #{alarmEleMiss,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmEleExceed != null"> |
| | | alarm_ele_exceed = #{alarmEleExceed,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="alarmEleLowVolt != null"> |
| | | alarm_ele_low_volt = #{alarmEleLowVolt,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="stateIcEnable != null"> |
| | | state_ic_enable = #{stateIcEnable,jdbcType=TINYINT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAlarmStateLast"> |
| | | <!--@mbg.generated--> |
| | | update rm_alarm_state_last |
| | | set controllerId = #{controllerid,jdbcType=BIGINT}, |
| | | intakeId = #{intakeid,jdbcType=BIGINT}, |
| | | rtuAddr = #{rtuaddr,jdbcType=VARCHAR}, |
| | | set controller_id = #{controllerId,jdbcType=BIGINT}, |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | rtuDt = #{rtudt,jdbcType=TIMESTAMP}, |
| | | bateryVolt = #{bateryvolt,jdbcType=TINYINT}, |
| | | loss = #{loss,jdbcType=TINYINT}, |
| | | meter = #{meter,jdbcType=TINYINT}, |
| | | valve = #{valve,jdbcType=TINYINT}, |
| | | icCard = #{iccard,jdbcType=TINYINT}, |
| | | working = #{working,jdbcType=TINYINT}, |
| | | valveState = #{valvestate,jdbcType=TINYINT} |
| | | rtu_dt = #{rtuDt,jdbcType=TIMESTAMP}, |
| | | valve_state = #{valveState,jdbcType=TINYINT}, |
| | | alarm_remain_water = #{alarmRemainWater,jdbcType=TINYINT}, |
| | | alarm0_water_remain = #{alarm0WaterRemain,jdbcType=TINYINT}, |
| | | alarm_exceed_year = #{alarmExceedYear,jdbcType=TINYINT}, |
| | | alarm_water_meter_fault = #{alarmWaterMeterFault,jdbcType=TINYINT}, |
| | | alarm_loss = #{alarmLoss,jdbcType=TINYINT}, |
| | | alarm_water_meter_break = #{alarmWaterMeterBreak,jdbcType=TINYINT}, |
| | | alarm_ele_meter_fault = #{alarmEleMeterFault,jdbcType=TINYINT}, |
| | | alarm0_money_remain = #{alarm0MoneyRemain,jdbcType=TINYINT}, |
| | | alarm_inner_door = #{alarmInnerDoor,jdbcType=TINYINT}, |
| | | alarm_outer_door = #{alarmOuterDoor,jdbcType=TINYINT}, |
| | | alarm_ele_miss = #{alarmEleMiss,jdbcType=TINYINT}, |
| | | alarm_ele_exceed = #{alarmEleExceed,jdbcType=TINYINT}, |
| | | alarm_ele_low_volt = #{alarmEleLowVolt,jdbcType=TINYINT}, |
| | | state_ic_enable = #{stateIcEnable,jdbcType=TINYINT} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | MidResultToRtu resToRtu = TcpDownCommandCache.matchFromHead(resFromRtu) ; |
| | | if(resToRtu != null){ |
| | | //匹配到下发的命令 |
| | | resFromRtu.matchedCommand(resToRtu.rtuResultSendWebUrl, resToRtu.commandId) ; |
| | | resFromRtu.matchedCommand(resToRtu.commandId, resToRtu.rtuResultSendWebUrl) ; |
| | | this.nextDealRtuData(false, resFromRtu); |
| | | this.nextDealRtuComResult(resFromRtu); |
| | | }else{ |
| | |
| | | |
| | | log.info("网络连接关闭," |
| | | + (rtuAddr==null?"":("终端地址是:" + rtuAddr))) ; |
| | | //+ (session==null?"":(session.getRemoteAddress() == null?"":(session.getRemoteAddress().toString()==null?"":("终端网址是:" + session.getRemoteAddress().toString()))))) ; |
| | | //+ (session==null?"":(session.getRemoteAddress() == null?"":(session.getRemoteAddress().toString()==null?"":(",终端网址是:" + session.getRemoteAddress().toString()))))) ; |
| | | } |
| | | } |
| | | /** |
| | |
| | | String rtuAddr = (String)session.getAttribute(TcpIoSessionAttrIdIsRtuAddr.sessionArrIdKey) ; |
| | | log.error("网络会话发生异常," |
| | | + (rtuAddr==null?"":("终端地址是:" + rtuAddr)) |
| | | + (session==null?"":(session.getRemoteAddress() != null?("终端网址是:" + session.getRemoteAddress().toString()):"")) |
| | | + (session==null?"":(session.getRemoteAddress() != null?(",终端网址是:" + session.getRemoteAddress().toString()):"")) |
| | | + "\n异常消息:" + cause.getMessage(), cause); |
| | | } |
| | | } |
| | |
| | | String rtuAddr = (String)session.getAttribute(TcpIoSessionAttrIdIsRtuAddr.sessionArrIdKey) ; |
| | | log.info("网络发送了数据," |
| | | + (rtuAddr==null?"":("终端地址是:" + rtuAddr)) |
| | | + (session==null?"":(session.getRemoteAddress() != null?("终端网址是:" + session.getRemoteAddress().toString()):"")) ); |
| | | + (session==null?"":(session.getRemoteAddress() != null?(",终端网址是:" + session.getRemoteAddress().toString()):"")) ); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param stateVo 状态对象 |
| | | */ |
| | | private void saveOrUpdateLast(DbSv sv, PrController controller, String rtuAddr, String rtuDt, DataV1_0_1 dV1_0_1, DataAlarmVo alarmVo, DataStateVo stateVo) throws Exception { |
| | | RmAlarmStateLast po = sv.getRmAlarmStateLast(rtuAddr) ; |
| | | if(po == null){ |
| | | po = new RmAlarmStateLast(null, controller==null?null:controller.getId(), controller==null?null:controller.getIntakeId(), |
| | | rtuAddr, |
| | | DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt), |
| | | DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(rtuDt), |
| | | alarmVo==null?null:alarmVo.batteryVolt, alarmVo==null?null:alarmVo.loss, alarmVo==null?null:alarmVo.meter, alarmVo==null?null:alarmVo.valve, |
| | | stateVo==null?null:stateVo.icCard, stateVo==null?null:stateVo.working, stateVo==null?null:stateVo.valve) ; |
| | | sv.saveRmAlarmStateLast(po) ; |
| | | }else{ |
| | | po = this.update(controller, po, rtuDt, dV1_0_1, alarmVo, stateVo) ; |
| | | sv.updateRmAlarmStateLast(po); |
| | | } |
| | | // RmAlarmStateLast po = sv.getRmAlarmStateLast(rtuAddr) ; |
| | | // if(po == null){ |
| | | // po = new RmAlarmStateLast(null, controller==null?null:controller.getId(), controller==null?null:controller.getIntakeId(), |
| | | // rtuAddr, |
| | | // DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt), |
| | | // DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(rtuDt), |
| | | // alarmVo==null?null:alarmVo.batteryVolt, alarmVo==null?null:alarmVo.loss, alarmVo==null?null:alarmVo.meter, alarmVo==null?null:alarmVo.valve, |
| | | // stateVo==null?null:stateVo.icCard, stateVo==null?null:stateVo.working, stateVo==null?null:stateVo.valve) ; |
| | | // sv.saveRmAlarmStateLast(po) ; |
| | | // }else{ |
| | | // po = this.update(controller, po, rtuDt, dV1_0_1, alarmVo, stateVo) ; |
| | | // sv.updateRmAlarmStateLast(po); |
| | | // } |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param stateVo 状态对象 |
| | | */ |
| | | private void saveHistory(DbSv sv, PrController controller, String rtuAddr, String rtuDt, DataV1_0_1 dV1_0_1, DataAlarmVo alarmVo, DataStateVo stateVo) throws Exception { |
| | | RmAlarmStateHistory po = new RmAlarmStateHistory(null, controller==null?null:controller.getId(), controller==null?null:controller.getIntakeId(), |
| | | rtuAddr, |
| | | DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt), |
| | | DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(rtuDt), |
| | | alarmVo==null?null:alarmVo.batteryVolt, alarmVo==null?null:alarmVo.loss, alarmVo==null?null:alarmVo.meter, alarmVo==null?null:alarmVo.valve, |
| | | stateVo==null?null:stateVo.icCard, stateVo==null?null:stateVo.working, stateVo==null?null:stateVo.valve) ; |
| | | sv.saveRmAlarmStateHistory(po) ; |
| | | // RmAlarmStateHistory po = new RmAlarmStateHistory(null, controller==null?null:controller.getId(), controller==null?null:controller.getIntakeId(), |
| | | // rtuAddr, |
| | | // DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt), |
| | | // DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(rtuDt), |
| | | // alarmVo==null?null:alarmVo.batteryVolt, alarmVo==null?null:alarmVo.loss, alarmVo==null?null:alarmVo.meter, alarmVo==null?null:alarmVo.valve, |
| | | // stateVo==null?null:stateVo.icCard, stateVo==null?null:stateVo.working, stateVo==null?null:stateVo.valve) ; |
| | | // sv.saveRmAlarmStateHistory(po) ; |
| | | } |
| | | |
| | | |
| | | private RmAlarmStateLast update(PrController controller, RmAlarmStateLast po, String rtuDt, DataV1_0_1 dV1_0_1, DataAlarmVo alarmVo, DataStateVo stateVo) throws Exception { |
| | | po.controllerid = controller==null?null:controller.getId() ; |
| | | po.intakeid = controller==null?null:controller.getIntakeId() ; |
| | | |
| | | po.dt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt) ; |
| | | po.rtudt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(rtuDt) ; |
| | | if(alarmVo != null){ |
| | | po.bateryvolt = alarmVo.batteryVolt ; |
| | | po.loss = alarmVo.loss ; |
| | | po.meter = alarmVo.meter ; |
| | | po.valve = alarmVo.valve ; |
| | | }else{ |
| | | po.bateryvolt = null ; |
| | | po.loss = null ; |
| | | po.meter = null ; |
| | | po.valve = null ; |
| | | } |
| | | if(stateVo != null){ |
| | | po.iccard = stateVo.icCard ; |
| | | po.working = stateVo.working ; |
| | | po.valvestate = stateVo.valve ; |
| | | }else{ |
| | | po.iccard = null ; |
| | | po.working = null ; |
| | | po.valvestate = null ; |
| | | } |
| | | // po.controllerid = controller==null?null:controller.getId() ; |
| | | // po.intakeid = controller==null?null:controller.getIntakeId() ; |
| | | // |
| | | // po.dt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt) ; |
| | | // po.rtudt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(rtuDt) ; |
| | | // if(alarmVo != null){ |
| | | // po.bateryvolt = alarmVo.batteryVolt ; |
| | | // po.loss = alarmVo.loss ; |
| | | // po.meter = alarmVo.meter ; |
| | | // po.valve = alarmVo.valve ; |
| | | // }else{ |
| | | // po.bateryvolt = null ; |
| | | // po.loss = null ; |
| | | // po.meter = null ; |
| | | // po.valve = null ; |
| | | // } |
| | | // if(stateVo != null){ |
| | | // po.iccard = stateVo.icCard ; |
| | | // po.working = stateVo.working ; |
| | | // po.valvestate = stateVo.valve ; |
| | | // }else{ |
| | | // po.iccard = null ; |
| | | // po.working = null ; |
| | | // po.valvestate = null ; |
| | | // } |
| | | return po ; |
| | | |
| | | } |
| | | } |
| | |
| | | import com.dy.common.mw.protocol.Data; |
| | | import com.dy.common.mw.protocol.p206V202404.DataV202404 ; |
| | | import com.dy.common.mw.protocol.p206V202404.upVos.*; |
| | | import com.dy.common.util.DateTime; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrController; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmAlarmStateHistory; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmAlarmStateLast; |
| | | import com.dy.rtuMw.server.rtuData.TaskSurpport; |
| | | import com.dy.rtuMw.server.rtuData.dbSv.DbSv; |
| | |
| | | @Override |
| | | public void execute(Object data) { |
| | | Data d = (Data)data ; |
| | | Object protocolData = d.getSubData() ; |
| | | if(protocolData != null){ |
| | | DataV202404 dV202404 = (DataV202404)protocolData ; |
| | | if(dV202404 != null){ |
| | | Object cdObj = dV202404.subData ; |
| | | if(cdObj != null){ |
| | | try{ |
| | | Object[] objs = this.getTaskResults(TkPreGenObjsV202404.taskId) ; |
| | | DbSv sv = (DbSv)objs[0] ; |
| | | PrController controller = (PrController)objs[1] ; |
| | | if(cdObj instanceof DataCd81Vo){ |
| | | //设备终端随机自报 |
| | | DataCd81Vo cdData = (DataCd81Vo)(cdObj) ; |
| | | this.saveOrUpdateLast(sv, controller, d.getRtuAddr(), null, null, null, cdData, null, null) ; |
| | | this.saveHistory(sv, controller, d.getRtuAddr(), null, null, null, cdData, null, null) ; |
| | | }else if(cdObj instanceof DataCd80_5BVo){ |
| | | //设备终端工作上报 + 查询设备终端实时值 |
| | | DataCd80_5BVo cdData = (DataCd80_5BVo)(cdObj) ; |
| | | this.saveOrUpdateLast(sv, controller, d.getRtuAddr(), cdData.rtuDt, cdData, null, null, null, null) ; |
| | | this.saveHistory(sv, controller, d.getRtuAddr(), cdData.rtuDt, cdData, null, null, null, null) ; |
| | | }else if(cdObj instanceof DataCd93_A3Vo){ |
| | | //平台/APP远程关闭水泵/阀门 + 刷卡关泵/阀上报 |
| | | DataCd93_A3Vo cdData = (DataCd93_A3Vo)(cdObj) ; |
| | | this.saveOrUpdateLast(sv, controller, d.getRtuAddr(), cdData.endDt, null, cdData, null, null, null) ; |
| | | this.saveHistory(sv, controller, d.getRtuAddr(), cdData.endDt, null, cdData, null, null, null) ; |
| | | }else if(cdObj instanceof DataCd84Vo){ |
| | | //设备终端随机自报 |
| | | DataCd84Vo cdData = (DataCd84Vo)(cdObj) ; |
| | | this.saveOrUpdateLast(sv, controller, d.getRtuAddr(), null, null, null, null, cdData, null) ; |
| | | this.saveHistory(sv, controller, d.getRtuAddr(), null, null, null, null, cdData, null) ; |
| | | }else if(cdObj instanceof DataCdC2Vo){ |
| | | //设备终端随机自报 |
| | | DataCdC2Vo cdData = (DataCdC2Vo)(cdObj) ; |
| | | this.saveOrUpdateLast(sv, controller, d.getRtuAddr(), null, null, null, null, null, cdData) ; |
| | | this.saveHistory(sv, controller, d.getRtuAddr(), null, null, null, null, null, cdData) ; |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("保存控制器报警和状态数据时发生异常", e); |
| | | } |
| | | DataV202404 dV202404 = (DataV202404)d.getSubData() ;//前面任务已经判断不为null |
| | | Object cdObj = dV202404.subData ; |
| | | if(cdObj != null){ |
| | | try{ |
| | | Object[] objs = this.getTaskResults(TkPreGenObjsV202404.taskId) ; |
| | | DbSv sv = (DbSv)objs[0] ; |
| | | PrController controller = (PrController)objs[1] ; |
| | | if(cdObj instanceof DataCd81Vo){ |
| | | //设备终端随机自报 |
| | | DataCd81Vo cdData = (DataCd81Vo)(cdObj) ; |
| | | this.saveOrUpdateLast(sv, controller, d.getRtuAddr(), cdData.rtuDt, cdData, dV202404.dt) ; |
| | | this.saveHistory(sv, controller, d.getRtuAddr(), cdData.rtuDt, cdData, dV202404.dt) ; |
| | | }else if(cdObj instanceof DataCd80_5BVo){ |
| | | //设备终端工作上报 + 查询设备终端实时值 |
| | | DataCd80_5BVo cdData = (DataCd80_5BVo)(cdObj) ; |
| | | this.saveOrUpdateLast(sv, controller, d.getRtuAddr(), cdData.rtuDt, cdData, dV202404.dt) ; |
| | | this.saveHistory(sv, controller, d.getRtuAddr(), cdData.rtuDt, cdData, dV202404.dt) ; |
| | | }else if(cdObj instanceof DataCd93_A3Vo){ |
| | | //平台/APP远程关闭水泵/阀门 + 刷卡关泵/阀上报 |
| | | DataCd93_A3Vo cdData = (DataCd93_A3Vo)(cdObj) ; |
| | | this.saveOrUpdateLast(sv, controller, d.getRtuAddr(), cdData.endDt, cdData, dV202404.dt) ; |
| | | this.saveHistory(sv, controller, d.getRtuAddr(), cdData.endDt, cdData, dV202404.dt) ; |
| | | }else if(cdObj instanceof DataCd84Vo){ |
| | | //设备终端随机自报 |
| | | DataCd84Vo cdData = (DataCd84Vo)(cdObj) ; |
| | | this.saveOrUpdateLast(sv, controller, d.getRtuAddr(), cdData.opDt, cdData, dV202404.dt) ; |
| | | this.saveHistory(sv, controller, d.getRtuAddr(), cdData.opDt, cdData, dV202404.dt) ; |
| | | }else if(cdObj instanceof DataCdC2Vo){ |
| | | //设备终端随机自报 |
| | | DataCdC2Vo cdData = (DataCdC2Vo)(cdObj) ; |
| | | this.saveOrUpdateLast(sv, controller, d.getRtuAddr(), cdData.rtuDt, cdData, dV202404.dt) ; |
| | | this.saveHistory(sv, controller, d.getRtuAddr(), cdData.rtuDt, cdData, dV202404.dt) ; |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("保存控制器报警和状态数据时发生异常", e); |
| | | } |
| | | } |
| | | } |
| | |
| | | * @param controller 控制器对象 |
| | | * @param rtuAddr 控制器地址 |
| | | * @param rtuDt 控制器时钟 |
| | | * @param vo80_5B |
| | | * @param vo93_A3_85 |
| | | * @param vo81 |
| | | * @param alarmVo 报警及状态数据 |
| | | * @param receiveDt 接收数据时本地时钟 |
| | | */ |
| | | private void saveOrUpdateLast(DbSv sv, |
| | | PrController controller, |
| | | String rtuAddr, |
| | | String rtuDt, |
| | | DataCd80_5BVo vo80_5B, |
| | | DataCd93_A3Vo vo93_A3_85, |
| | | DataCd81Vo vo81, |
| | | DataCd84Vo vo84, |
| | | DataCdC2Vo voC2) throws Exception { |
| | | // RmAlarmStateLast po = sv.getRmAlarmStateLast(rtuAddr) ; |
| | | // if(po == null){ |
| | | // po = new RmAlarmStateLast(null, controller==null?null:controller.getId(), controller==null?null:controller.getIntakeId(), |
| | | // rtuAddr, |
| | | // DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt), |
| | | // DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(rtuDt), |
| | | // alarmVo==null?null:alarmVo.batteryVolt, alarmVo==null?null:alarmVo.loss, alarmVo==null?null:alarmVo.meter, alarmVo==null?null:alarmVo.valve, |
| | | // stateVo==null?null:stateVo.icCard, stateVo==null?null:stateVo.working, stateVo==null?null:stateVo.valve) ; |
| | | // sv.saveRmAlarmStateLast(po) ; |
| | | // }else{ |
| | | // po = this.update(controller, po, rtuDt, dV1_0_1, alarmVo, stateVo) ; |
| | | // sv.updateRmAlarmStateLast(po); |
| | | // } |
| | | AlarmVo alarmVo, |
| | | String receiveDt) throws Exception { |
| | | RmAlarmStateLast po = sv.getRmAlarmStateLast(rtuAddr) ; |
| | | if(po == null){ |
| | | po = new RmAlarmStateLast(null, |
| | | controller==null?null:controller.getId(), |
| | | controller==null?null:controller.getIntakeId(), |
| | | rtuAddr, |
| | | DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(receiveDt), |
| | | DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(rtuDt), |
| | | alarmVo==null?null:alarmVo.statePump, |
| | | alarmVo==null?null:alarmVo.alarmWaterRemain, |
| | | alarmVo==null?null:alarmVo.alarm0WaterRemain, |
| | | alarmVo==null?null:alarmVo.alarmExceedYear, |
| | | alarmVo==null?null:alarmVo.alarmWaterMeterFault, |
| | | alarmVo==null?null:alarmVo.alarmSteal, |
| | | alarmVo==null?null:alarmVo.alarmWaterMeterBreak, |
| | | alarmVo==null?null:alarmVo.alarmEleMeterFault, |
| | | alarmVo==null?null:alarmVo.alarm0MoneyRemain, |
| | | alarmVo==null?null:alarmVo.alarmInnerDoor, |
| | | alarmVo==null?null:alarmVo.alarmOuterDoor, |
| | | alarmVo==null?null:alarmVo.alarmEleMiss, |
| | | alarmVo==null?null:alarmVo.alarmEleExceed, |
| | | alarmVo==null?null:alarmVo.alarmEleLowVolt, |
| | | alarmVo==null?null:alarmVo.stateIcEnable |
| | | ) ; |
| | | sv.saveRmAlarmStateLast(po) ; |
| | | }else{ |
| | | po = this.update(po, controller, rtuDt, alarmVo, receiveDt) ; |
| | | sv.updateRmAlarmStateLast(po); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param controller 控制器对象 |
| | | * @param rtuAddr 控制器地址 |
| | | * @param rtuDt 控制器时钟 |
| | | * @param vo80_5B |
| | | * @param vo93_A3_85 |
| | | * @param vo81 |
| | | * @param alarmVo 报警及状态数据 |
| | | * @param receiveDt 接收数据时本地时钟 |
| | | */ |
| | | private void saveHistory(DbSv sv, |
| | | PrController controller, |
| | | String rtuAddr, |
| | | String rtuDt, |
| | | DataCd80_5BVo vo80_5B, |
| | | DataCd93_A3Vo vo93_A3_85, |
| | | DataCd81Vo vo81, |
| | | DataCd84Vo vo84, |
| | | DataCdC2Vo voC2) throws Exception { |
| | | // RmAlarmStateHistory po = new RmAlarmStateHistory(null, controller==null?null:controller.getId(), controller==null?null:controller.getIntakeId(), |
| | | // rtuAddr, |
| | | // DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt), |
| | | // DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(rtuDt), |
| | | // alarmVo==null?null:alarmVo.batteryVolt, alarmVo==null?null:alarmVo.loss, alarmVo==null?null:alarmVo.meter, alarmVo==null?null:alarmVo.valve, |
| | | // stateVo==null?null:stateVo.icCard, stateVo==null?null:stateVo.working, stateVo==null?null:stateVo.valve) ; |
| | | // sv.saveRmAlarmStateHistory(po) ; |
| | | AlarmVo alarmVo, |
| | | String receiveDt) throws Exception { |
| | | RmAlarmStateHistory po = new RmAlarmStateHistory(null, |
| | | controller==null?null:controller.getId(), |
| | | controller==null?null:controller.getIntakeId(), |
| | | rtuAddr, |
| | | DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(receiveDt), |
| | | DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(rtuDt), |
| | | alarmVo==null?null:alarmVo.statePump, |
| | | alarmVo==null?null:alarmVo.alarmWaterRemain, |
| | | alarmVo==null?null:alarmVo.alarm0WaterRemain, |
| | | alarmVo==null?null:alarmVo.alarmExceedYear, |
| | | alarmVo==null?null:alarmVo.alarmWaterMeterFault, |
| | | alarmVo==null?null:alarmVo.alarmSteal, |
| | | alarmVo==null?null:alarmVo.alarmWaterMeterBreak, |
| | | alarmVo==null?null:alarmVo.alarmEleMeterFault, |
| | | alarmVo==null?null:alarmVo.alarm0MoneyRemain, |
| | | alarmVo==null?null:alarmVo.alarmInnerDoor, |
| | | alarmVo==null?null:alarmVo.alarmOuterDoor, |
| | | alarmVo==null?null:alarmVo.alarmEleMiss, |
| | | alarmVo==null?null:alarmVo.alarmEleExceed, |
| | | alarmVo==null?null:alarmVo.alarmEleLowVolt, |
| | | alarmVo==null?null:alarmVo.stateIcEnable |
| | | ) ; |
| | | sv.saveRmAlarmStateHistory(po) ; |
| | | } |
| | | |
| | | |
| | | private RmAlarmStateLast update(PrController controller, |
| | | RmAlarmStateLast po, |
| | | /** |
| | | * 保存报警状态最新数据 |
| | | * @param po 实体对象 |
| | | * @param controller 控制器对象 |
| | | * @param rtuDt 控制器时钟 |
| | | * @param alarmVo 报警及状态数据 |
| | | * @param receiveDt 接收数据时本地时钟 |
| | | */ |
| | | private RmAlarmStateLast update(RmAlarmStateLast po, |
| | | PrController controller, |
| | | String rtuDt, |
| | | DataCd80_5BVo vo80_5B, |
| | | DataCd93_A3Vo vo93_A3_85, |
| | | DataCd81Vo vo81, |
| | | DataCd84Vo vo84, |
| | | DataCdC2Vo voC2) throws Exception { |
| | | // po.controllerid = controller==null?null:controller.getId() ; |
| | | // po.intakeid = controller==null?null:controller.getIntakeId() ; |
| | | // |
| | | // po.dt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt) ; |
| | | // po.rtudt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(rtuDt) ; |
| | | // if(alarmVo != null){ |
| | | // po.bateryvolt = alarmVo.batteryVolt ; |
| | | // po.loss = alarmVo.loss ; |
| | | // po.meter = alarmVo.meter ; |
| | | // po.valve = alarmVo.valve ; |
| | | // }else{ |
| | | // po.bateryvolt = null ; |
| | | // po.loss = null ; |
| | | // po.meter = null ; |
| | | // po.valve = null ; |
| | | // } |
| | | // if(stateVo != null){ |
| | | // po.iccard = stateVo.icCard ; |
| | | // po.working = stateVo.working ; |
| | | // po.valvestate = stateVo.valve ; |
| | | // }else{ |
| | | // po.iccard = null ; |
| | | // po.working = null ; |
| | | // po.valvestate = null ; |
| | | // } |
| | | // return po ; |
| | | return null ; |
| | | AlarmVo alarmVo, |
| | | String receiveDt) throws Exception { |
| | | po.controllerId = controller==null?null:controller.getId() ; |
| | | po.intakeId = controller==null?null:controller.getIntakeId() ; |
| | | |
| | | po.dt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(receiveDt) ; |
| | | po.rtuDt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(rtuDt) ; |
| | | if(alarmVo != null){ |
| | | po.valveState = alarmVo.statePump ; |
| | | po.alarmRemainWater = alarmVo.alarmWaterRemain ; |
| | | po.alarm0WaterRemain = alarmVo.alarm0WaterRemain ; |
| | | po.alarmExceedYear = alarmVo.alarmExceedYear ; |
| | | po.alarmWaterMeterFault = alarmVo.alarmWaterMeterFault ; |
| | | po.alarmLoss = alarmVo.alarmSteal ; |
| | | po.alarmWaterMeterBreak = alarmVo.alarmWaterMeterBreak ; |
| | | po.alarmEleMeterFault = alarmVo.alarmEleMeterFault ; |
| | | po.alarm0MoneyRemain = alarmVo.alarm0MoneyRemain ; |
| | | po.alarmInnerDoor = alarmVo.alarmInnerDoor ; |
| | | po.alarmOuterDoor = alarmVo.alarmOuterDoor ; |
| | | po.alarmEleMiss = alarmVo.alarmEleMiss ; |
| | | po.alarmEleExceed = alarmVo.alarmEleExceed ; |
| | | po.alarmEleLowVolt = alarmVo.alarmEleLowVolt ; |
| | | po.stateIcEnable = alarmVo.stateIcEnable ; |
| | | } |
| | | return po ; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.rtuMw.server.rtuData.p206V202404; |
| | | |
| | | import com.dy.common.mw.protocol.Data; |
| | | import com.dy.common.mw.protocol.p206V202404.DataV202404; |
| | | import com.dy.common.mw.protocol.p206V202404.upVos.*; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrController; |
| | | import com.dy.rtuMw.server.rtuData.TaskSurpport; |
| | | import com.dy.rtuMw.server.rtuData.dbSv.DbSv; |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/5/20 20:29 |
| | | * @Description |
| | | */ |
| | | public class TkDealTimingReportV202404 extends TaskSurpport { |
| | | |
| | | private static final Logger log = LogManager.getLogger(TkDealTimingReportV202404.class.getName()); |
| | | |
| | | //类ID,一定与Tree.xml配置文件中配置一致 |
| | | public static final String taskId = "TkDealTimingReportV202404"; |
| | | |
| | | /** |
| | | * 执行节点任务:报警及状态 |
| | | * |
| | | * @param data 需要处理的数据 |
| | | */ |
| | | @Override |
| | | public void execute(Object data) { |
| | | Data d = (Data) data; |
| | | DataV202404 dV202404 = (DataV202404) d.getSubData();//前面任务已经判断不为null |
| | | Object cdObj = dV202404.subData; |
| | | if (cdObj != null) { |
| | | try { |
| | | Object[] objs = this.getTaskResults(TkPreGenObjsV202404.taskId); |
| | | DbSv sv = (DbSv) objs[0]; |
| | | PrController controller = (PrController) objs[1]; |
| | | if (cdObj instanceof DataCd83Vo) { |
| | | //设备终端定点上报, 每天12点上报数据 |
| | | DataCd83Vo cdData = (DataCd83Vo) (cdObj); |
| | | //this.saveOrUpdateLast(sv, controller, d.getRtuAddr(), cdData.rtuDt, cdData, dV202404.dt); |
| | | //this.saveHistory(sv, controller, d.getRtuAddr(), cdData.rtuDt, cdData, dV202404.dt); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("保存控制器报警和状态数据时发生异常", e); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.dy.rtuMw.server.rtuData.p206V202404; |
| | | |
| | | import com.dy.common.mw.protocol.Data; |
| | | import com.dy.common.mw.protocol.p206V202404.DataV202404; |
| | | import com.dy.rtuMw.server.rtuData.TaskSurpport; |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | |
| | | Data d = (Data)data ; |
| | | if(d.getCommandId() == null || d.getCommandId().trim().equals("")){ |
| | | //无命令ID |
| | | this.toNextTasks(data); |
| | | Object protocolData = d.getSubData() ; |
| | | if(protocolData != null) { |
| | | this.toNextTasks(data); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.dy.common.mw.protocol.Data; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpEntity; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.http.*; |
| | | import org.springframework.http.converter.StringHttpMessageConverter; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.client.RestTemplate; |
| | | import org.springframework.web.util.UriComponentsBuilder; |
| | | |
| | | import java.nio.charset.StandardCharsets; |
| | | |
| | | /** |
| | | * @Author liurunyu |
| | |
| | | String url = UriComponentsBuilder.fromUriString(data.rtuResultSendWebUrl) |
| | | .build() |
| | | .toUriString(); |
| | | restTemplate.getMessageConverters().set(1,new StringHttpMessageConverter(StandardCharsets.UTF_8)); |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.setContentType(MediaType.parseMediaType("application/json;charset=UTF-8")); |
| | | HttpEntity<?> httpEntity = new HttpEntity<>(data, headers); |
| | | ResponseEntity<WebResponseVo> response = null; |
| | | try { |
| | |
| | | <!-- 识别非命令应答上行数据 --> |
| | | <task id="TkFindReportV202404" name="识别非命令应答上行数据" enable="true" class="com.dy.rtuMw.server.rtuData.p206V202404.TkFindReportV202404"> |
| | | <task id="TkDealAlarmStatusV202404" name="控制器报警与状态数据" enable="true" class="com.dy.rtuMw.server.rtuData.p206V202404.TkDealAlarmStatusV202404" /> |
| | | <task id="TkDealTimingReportV202404" name="控制器定点上报数据" enable="true" class="com.dy.rtuMw.server.rtuData.p206V202404.TkDealTimingReportV202404" /> |
| | | </task> |
| | | <!-- 识别命令响应数据 --> |
| | | <task id="TkFindComResponseV202404" name="识别响应命令数据" enable="true" class="com.dy.rtuMw.server.rtuData.p206V202404.TkFindComResponseV202404"> |
| | |
| | | import com.dy.common.mw.protocol.p206V202404.CodeV202404; |
| | | import com.dy.common.mw.protocol.p206V202404.downVos.*; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | |
| | | //return this.cd16() ; |
| | | //return this.cd22() ; |
| | | //return this.cd31() ; |
| | | return this.cd10(); |
| | | return this.cd92() ; |
| | | } |
| | | |
| | | /** |
New file |
| | |
| | | package com.dy.pipIrrIrrigate.irrigateGroup; |
| | | |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.common.webUtil.ResultCodeMsg; |
| | | import com.dy.pipIrrGlobal.pojoIr.IrGroupUnit; |
| | | import com.dy.pipIrrGlobal.pojoIr.IrIrrigateGroup; |
| | | import com.dy.pipIrrGlobal.pojoIr.IrIrrigateUnit; |
| | | import com.dy.pipIrrGlobal.voIr.VoGroup; |
| | | import com.dy.pipIrrGlobal.voIr.VoGroupOne; |
| | | import com.dy.pipIrrGlobal.voIr.VoUnit; |
| | | import com.dy.pipIrrGlobal.voIr.VoUnitOne; |
| | | import com.dy.pipIrrGlobal.voSe.VoActiveCard; |
| | | import com.dy.pipIrrIrrigate.irrigateUnit.IrrigateUnitSv; |
| | | import com.dy.pipIrrIrrigate.irrigateGroup.QueryVo; |
| | | import com.dy.pipIrrIrrigate.result.IrrigateResultCode; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.media.Content; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import io.swagger.v3.oas.annotations.responses.ApiResponse; |
| | | import io.swagger.v3.oas.annotations.responses.ApiResponses; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.validation.Valid; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.Optional; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/5/21 16:19 |
| | | * @LastEditTime :2024/5/21 16:19 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Tag(name = "轮灌组", description = "轮灌组") |
| | | @RestController |
| | | @RequestMapping(path = "group") |
| | | @RequiredArgsConstructor |
| | | public class IrrigateGroupCtrl { |
| | | @Autowired |
| | | private IrrigateGroupSv irrigateGroupSv; |
| | | |
| | | /** |
| | | * 创建轮灌组 |
| | | * |
| | | * @param po 轮灌组实体对象 |
| | | * @param bindingResult |
| | | * @return 添加是否成功 |
| | | */ |
| | | @Operation(summary = "创建轮灌组记录", description = "创建轮灌组记录") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "操作结果:true:成功,false:失败(BaseResponse.content)", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = Boolean.class))} |
| | | ) |
| | | }) |
| | | @PostMapping(path = "add", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> add(@RequestBody @Valid IrIrrigateGroup po, BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | try { |
| | | Integer rec = Optional.ofNullable(irrigateGroupSv.addIrrigateGroup(po)).orElse(0); |
| | | if (rec == 0) { |
| | | return BaseResponseUtils.buildFail(IrrigateResultCode.ADD_PROJECT_FAIL.getMessage()); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("创建轮灌组异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | |
| | | /** |
| | | * 逻辑删除灌溉单元 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @Operation(summary = "逻辑删除轮灌组", description = "逻辑删除轮灌组") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "操作结果:true:成功,false:失败(BaseResponse.content)", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = Boolean.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "delete") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> delete( Long id) { |
| | | if (id == null ) { |
| | | BaseResponseUtils.buildFail(IrrigateResultCode.PLEASE_INPUT_PROJECT_ID.getMessage()); |
| | | } |
| | | // Long groupId = Long.parseLong(map.get("id").toString()); |
| | | try { |
| | | Integer rows = irrigateGroupSv.deleteIrrigateGroup(id); |
| | | if (rows == 0) { |
| | | return BaseResponseUtils.buildFail(IrrigateResultCode.DELETE_PROJECT_FAIL.getMessage()); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("删除轮灌组异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * @param groupIds |
| | | * @return |
| | | */ |
| | | @PostMapping(path = "delete_batch", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> delete_batch(@RequestBody Map<String, List> groupIds) { |
| | | if (groupIds == null || groupIds.size() <= 0) { |
| | | BaseResponseUtils.buildFail(IrrigateResultCode.PLEASE_INPUT_PROJECT_ID.getMessage()); |
| | | } |
| | | List ids = groupIds.get("groupIds"); |
| | | for (int i = 0; i < ids.size(); i++) { |
| | | long groupId = Long.parseLong(ids.get(i).toString()); |
| | | try { |
| | | Integer rows = irrigateGroupSv.deleteIrrigateGroup(groupId); |
| | | if (rows == 0) { |
| | | return BaseResponseUtils.buildFail(IrrigateResultCode.DELETE_PROJECT_FAIL.getMessage()); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("删除轮灌组异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | |
| | | /** |
| | | * 修改灌溉单元 |
| | | * @param po |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @Operation(summary = "修改轮灌组", description = "修改轮灌组") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "操作结果:true:成功,false:失败(BaseResponse.content)", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = Boolean.class))} |
| | | ) |
| | | }) |
| | | @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> update(@RequestBody @Valid IrIrrigateGroup po, BindingResult bindingResult){ |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | try { |
| | | Integer rec = Optional.ofNullable(irrigateGroupSv.updateIrrigateGroup(po)).orElse(0); |
| | | if (rec == 0) { |
| | | return BaseResponseUtils.buildFail(IrrigateResultCode.UPDATE_PROJECT_FAIL.getMessage()); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("修改轮灌组异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | |
| | | /** |
| | | * 获取一个轮灌组 |
| | | * |
| | | * @return 获取一个轮灌组 |
| | | */ |
| | | @Operation(summary = "获取一个轮灌组", description = "获取一个轮灌组") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "获取一个轮灌组(BaseResponse.content:{})", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = IrIrrigateGroup.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "one") |
| | | @SsoAop() |
| | | public BaseResponse<VoGroupOne> one(@RequestParam Long id) { |
| | | VoGroupOne irIrrigateGroup = this.irrigateGroupSv.selectById(id); |
| | | |
| | | return BaseResponseUtils.buildSuccess(irIrrigateGroup); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | @Operation(summary = "获得一页轮灌组记录", description = "获得一页轮灌组记录") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "获得一页灌溉单元记录(BaseResponse.content:QueryResultVo[{}])", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = VoActiveCard.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "some") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoGroup>>> getIrrigateGroups(QueryVo vo) { |
| | | try { |
| | | QueryResultVo<List<VoGroup>> res = irrigateGroupSv.getIrrigateGroups(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取轮灌组记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 轮灌组添加灌溉单元 |
| | | * |
| | | * @param po 轮灌组灌溉单元中间表 |
| | | * @param bindingResult |
| | | * @return 添加是否成功 |
| | | */ |
| | | @Operation(summary = "轮灌组添加灌溉单元", description = "轮灌组添加灌溉单元") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "操作结果:true:成功,false:失败(BaseResponse.content)", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = Boolean.class))} |
| | | ) |
| | | }) |
| | | @PostMapping(path = "add_unit", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> addGroupUnit(@RequestBody @Valid IrGroupUnit po, BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | try { |
| | | Integer rec = Optional.ofNullable(irrigateGroupSv.addGroupUnit(po)).orElse(0); |
| | | if (rec == 0) { |
| | | return BaseResponseUtils.buildFail(IrrigateResultCode.ADD_PROJECT_FAIL.getMessage()); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("轮灌组添加灌溉单元异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | |
| | | /** |
| | | * 逻辑删除 轮灌组移除灌溉单元 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @Operation(summary = "轮灌组移除灌溉单元", description = "轮灌组移除灌溉单元") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "操作结果:true:成功,false:失败(BaseResponse.content)", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = Boolean.class))} |
| | | ) |
| | | }) |
| | | @PostMapping(path = "remove_unit") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> deleteGroupUnit(@RequestBody @Valid IrGroupUnit po, BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | try { |
| | | Integer rec = Optional.ofNullable(irrigateGroupSv.deleteGroupUnit(po)).orElse(0); |
| | | if (rec == 0) { |
| | | return BaseResponseUtils.buildFail(IrrigateResultCode.DELETE_PROJECT_FAIL.getMessage()); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("轮灌组移除灌溉单元异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrIrrigate.irrigateGroup; |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoIr.IrGroupUnitMapper; |
| | | import com.dy.pipIrrGlobal.daoIr.IrIrrigateGroupMapper; |
| | | import com.dy.pipIrrGlobal.pojoIr.IrGroupUnit; |
| | | import com.dy.pipIrrGlobal.pojoIr.IrIrrigateGroup; |
| | | import com.dy.pipIrrGlobal.voIr.VoGroup; |
| | | import com.dy.pipIrrGlobal.voIr.VoGroupOne; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/5/21 15:57 |
| | | * @LastEditTime :2024/5/21 15:57 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class IrrigateGroupSv { |
| | | |
| | | @Autowired |
| | | private IrIrrigateGroupMapper irIrrigateGroupMapper; |
| | | @Autowired |
| | | private IrGroupUnitMapper irGroupUnitMapper; |
| | | |
| | | /** |
| | | * 创建轮灌组 |
| | | * |
| | | * @param po |
| | | * @return |
| | | */ |
| | | public Integer addIrrigateGroup(IrIrrigateGroup po) { |
| | | po.setOperateDt(new Date()); |
| | | po.setDeleted((byte) 0); |
| | | int rows = irIrrigateGroupMapper.insertSelective(po); |
| | | if (rows == 0) { |
| | | return 0; |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | /** |
| | | * 删除轮灌组 |
| | | * |
| | | * @param id |
| | | */ |
| | | public Integer deleteIrrigateGroup(Long id) { |
| | | int rows = irIrrigateGroupMapper.deleteLogicById(id); |
| | | int rows1 = irGroupUnitMapper.deleteByGroupId(id); |
| | | if (rows == 0) { |
| | | return 0; |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | /** |
| | | * 修改轮灌组 |
| | | * @param po |
| | | * @return |
| | | */ |
| | | public Integer updateIrrigateGroup(IrIrrigateGroup po){ |
| | | po.setOperateDt(new Date()); |
| | | int rows = irIrrigateGroupMapper.updateByPrimaryKeySelective(po); |
| | | if (rows == 0){ |
| | | return 0; |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | /** |
| | | * 获取一个轮灌组 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public VoGroupOne selectById(Long id){ |
| | | VoGroupOne unit = irIrrigateGroupMapper.selectById(id); |
| | | return unit; |
| | | } |
| | | |
| | | /** |
| | | * 分页查询轮灌组 |
| | | * @param queryVo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoGroup>> getIrrigateGroups(QueryVo queryVo){ |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | Long itemTotal = irIrrigateGroupMapper.getRecordCount(params); |
| | | |
| | | QueryResultVo<List<VoGroup>> rsVo = new QueryResultVo<>(); |
| | | rsVo.pageSize = queryVo.pageSize; |
| | | rsVo.pageCurr = queryVo.pageCurr; |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = irIrrigateGroupMapper.getIrrigateGroups(params); |
| | | return rsVo; |
| | | } |
| | | |
| | | /** |
| | | * 轮灌组添加灌溉单元 |
| | | * |
| | | * @param po |
| | | * @return |
| | | */ |
| | | public Integer addGroupUnit(IrGroupUnit po) { |
| | | po.setOperateDt(new Date()); |
| | | po.setDeleted((byte) 0); |
| | | int rows = irGroupUnitMapper.insertSelective(po); |
| | | if (rows == 0) { |
| | | return 0; |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | /** |
| | | * 轮灌组移除灌溉单元 |
| | | * |
| | | * @param po |
| | | * @return |
| | | */ |
| | | public Integer deleteGroupUnit(IrGroupUnit po) { |
| | | po.setOperateDt(new Date()); |
| | | int rows = irGroupUnitMapper.deleteByUnitIdGroupId(po); |
| | | if (rows == 0) { |
| | | return 0; |
| | | } |
| | | return 1; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrIrrigate.irrigateGroup; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/5/15 21:11 |
| | | * @LastEditTime :2024/5/15 21:11 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ToString(callSuper = true) |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Builder |
| | | @Schema(name = "项目查询条件") |
| | | public class QueryVo extends QueryConditionVo { |
| | | @Schema(description = "项目名称") |
| | | public String projectName; |
| | | |
| | | @Schema(description = "轮罐组名称") |
| | | public String groupCode; |
| | | } |
| | |
| | | package com.dy.pipIrrIrrigate.irrigateUnit; |
| | | |
| | | |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.common.webUtil.ResultCodeMsg; |
| | | import com.dy.pipIrrGlobal.pojoIr.IrIrrigateUnit; |
| | | import com.dy.pipIrrGlobal.pojoIr.IrProject; |
| | | import com.dy.pipIrrGlobal.voIr.VoProject; |
| | | import com.dy.pipIrrGlobal.voIr.VoProjectOne; |
| | | import com.dy.pipIrrGlobal.voIr.VoUnit; |
| | | import com.dy.pipIrrGlobal.voIr.VoUnitOne; |
| | | import com.dy.pipIrrGlobal.voSe.VoActiveCard; |
| | | import com.dy.pipIrrIrrigate.irrigateUnit.QueryVo; |
| | | import com.dy.pipIrrIrrigate.result.IrrigateResultCode; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.media.Content; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import io.swagger.v3.oas.annotations.responses.ApiResponse; |
| | | import io.swagger.v3.oas.annotations.responses.ApiResponses; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.validation.Valid; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.Optional; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | |
| | | @Slf4j |
| | | @Tag(name = "灌溉单元", description = "灌溉单元") |
| | | @RestController |
| | | @RequestMapping(path = "irrigate/unit") |
| | | @RequestMapping(path = "unit") |
| | | @RequiredArgsConstructor |
| | | public class IrrigateUnitCtrl { |
| | | @Autowired |
| | | private IrrigateUnitSv irrigateUnitSv; |
| | | |
| | | /** |
| | | * 创建灌溉单元 |
| | | * |
| | | * @param po 灌溉单元实体对象 |
| | | * @param bindingResult |
| | | * @return 添加是否成功 |
| | | */ |
| | | @Operation(summary = "创建灌溉单元记录", description = "创建灌溉单元记录") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "操作结果:true:成功,false:失败(BaseResponse.content)", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = Boolean.class))} |
| | | ) |
| | | }) |
| | | @PostMapping(path = "add", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> add(@RequestBody @Valid IrIrrigateUnit po, BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | try { |
| | | Integer rec = Optional.ofNullable(irrigateUnitSv.addIrrigateUnit(po)).orElse(0); |
| | | if (rec == 0) { |
| | | return BaseResponseUtils.buildFail(IrrigateResultCode.ADD_PROJECT_FAIL.getMessage()); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("创建灌溉单元异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | |
| | | /** |
| | | * 逻辑删除灌溉单元 |
| | | * @param map |
| | | * @return |
| | | */ |
| | | @Operation(summary = "逻辑删除灌溉单元", description = "逻辑删除灌溉单元") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "操作结果:true:成功,false:失败(BaseResponse.content)", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = Boolean.class))} |
| | | ) |
| | | }) |
| | | @PostMapping(path = "delete", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> delete(@RequestBody Map map) { |
| | | if (map == null || map.size() <= 0) { |
| | | BaseResponseUtils.buildFail(IrrigateResultCode.PLEASE_INPUT_PROJECT_ID.getMessage()); |
| | | } |
| | | Long unitId = Long.parseLong(map.get("id").toString()); |
| | | try { |
| | | Integer rows = irrigateUnitSv.deleteUnit(unitId); |
| | | if (rows == 0) { |
| | | return BaseResponseUtils.buildFail(IrrigateResultCode.DELETE_PROJECT_FAIL.getMessage()); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("删除灌溉单元异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * @param unitIds |
| | | * @return |
| | | */ |
| | | @PostMapping(path = "delete_batch", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> delete_batch(@RequestBody Map<String, List> unitIds) { |
| | | if (unitIds == null || unitIds.size() <= 0) { |
| | | BaseResponseUtils.buildFail(IrrigateResultCode.PLEASE_INPUT_PROJECT_ID.getMessage()); |
| | | } |
| | | List ids = unitIds.get("unitIds"); |
| | | for (int i = 0; i < ids.size(); i++) { |
| | | long unitId = Long.parseLong(ids.get(i).toString()); |
| | | try { |
| | | Integer rows = irrigateUnitSv.deleteUnit(unitId); |
| | | if (rows == 0) { |
| | | return BaseResponseUtils.buildFail(IrrigateResultCode.DELETE_PROJECT_FAIL.getMessage()); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("删除灌溉单元异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | |
| | | /** |
| | | * 修改灌溉单元 |
| | | * @param po |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @Operation(summary = "修改灌溉单元", description = "修改灌溉单元") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "操作结果:true:成功,false:失败(BaseResponse.content)", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = Boolean.class))} |
| | | ) |
| | | }) |
| | | @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> update(@RequestBody @Valid IrIrrigateUnit po, BindingResult bindingResult){ |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | try { |
| | | Integer rec = Optional.ofNullable(irrigateUnitSv.updateUnit(po)).orElse(0); |
| | | if (rec == 0) { |
| | | return BaseResponseUtils.buildFail(IrrigateResultCode.UPDATE_PROJECT_FAIL.getMessage()); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("修改灌溉单元异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | |
| | | /** |
| | | * 获取一个灌溉单元 |
| | | * |
| | | * @return 获取一个灌溉单元 |
| | | */ |
| | | @Operation(summary = "获取一个灌溉单元", description = "获取一个灌溉单元") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "获取一个灌溉单元(BaseResponse.content:{})", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = IrIrrigateUnit.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "one") |
| | | @SsoAop() |
| | | public BaseResponse<VoUnitOne> one(@RequestParam Long id) { |
| | | VoUnitOne irIrrigateUnit = this.irrigateUnitSv.selectById(id); |
| | | |
| | | return BaseResponseUtils.buildSuccess(irIrrigateUnit); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | @Operation(summary = "获得一页灌溉单元记录", description = "获得一页灌溉单元记录") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "获得一页灌溉单元记录(BaseResponse.content:QueryResultVo[{}])", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = VoActiveCard.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "some") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoUnit>>> getUnits(QueryVo vo) { |
| | | try { |
| | | QueryResultVo<List<VoUnit>> res = irrigateUnitSv.getUnits(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取灌溉单元记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.dy.pipIrrIrrigate.irrigateUnit; |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoIr.IrIrrigateUnitMapper; |
| | | import com.dy.pipIrrGlobal.daoIr.IrProjectMapper; |
| | | import com.dy.pipIrrGlobal.pojoIr.IrIrrigateUnit; |
| | | import com.dy.pipIrrGlobal.pojoIr.IrProject; |
| | | import com.dy.pipIrrGlobal.voIr.VoProject; |
| | | import com.dy.pipIrrGlobal.voIr.VoProjectOne; |
| | | import com.dy.pipIrrGlobal.voIr.VoUnit; |
| | | import com.dy.pipIrrGlobal.voIr.VoUnitOne; |
| | | import com.dy.pipIrrIrrigate.irrigateUnit.QueryVo; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | |
| | | @Slf4j |
| | | @Service |
| | | public class IrrigateUnitSv { |
| | | |
| | | @Autowired |
| | | private IrIrrigateUnitMapper irIrrigateUnitMapper; |
| | | |
| | | /** |
| | | * 创建灌溉单元 |
| | | * |
| | | * @param po |
| | | * @return |
| | | */ |
| | | public Integer addIrrigateUnit(IrIrrigateUnit po) { |
| | | po.setOperateDt(new Date()); |
| | | po.setDeleted((byte) 0); |
| | | int rows = irIrrigateUnitMapper.insertSelective(po); |
| | | if (rows == 0) { |
| | | return 0; |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | /** |
| | | * 删除灌溉单元 |
| | | * |
| | | * @param id |
| | | */ |
| | | public Integer deleteUnit(Long id) { |
| | | int rows = irIrrigateUnitMapper.deleteLogicById(id); |
| | | if (rows == 0) { |
| | | return 0; |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | /** |
| | | * 修改灌溉单元 |
| | | * @param po |
| | | * @return |
| | | */ |
| | | public Integer updateUnit(IrIrrigateUnit po){ |
| | | po.setOperateDt(new Date()); |
| | | int rows = irIrrigateUnitMapper.updateByPrimaryKeySelective(po); |
| | | if (rows == 0){ |
| | | return 0; |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | /** |
| | | * 获取一个灌溉单元 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public VoUnitOne selectById(Long id){ |
| | | VoUnitOne unit = irIrrigateUnitMapper.selectById(id); |
| | | return unit; |
| | | } |
| | | |
| | | /** |
| | | * 分页查询项目 |
| | | * @param queryVo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoUnit>> getUnits(QueryVo queryVo){ |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | Long itemTotal = irIrrigateUnitMapper.getRecordCount(params); |
| | | |
| | | QueryResultVo<List<VoUnit>> rsVo = new QueryResultVo<>(); |
| | | rsVo.pageSize = queryVo.pageSize; |
| | | rsVo.pageCurr = queryVo.pageCurr; |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = irIrrigateUnitMapper.getUnits(params); |
| | | return rsVo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrIrrigate.irrigateUnit; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/5/15 21:11 |
| | | * @LastEditTime :2024/5/15 21:11 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ToString(callSuper = true) |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Builder |
| | | @Schema(name = "项目查询条件") |
| | | public class QueryVo extends QueryConditionVo { |
| | | @Schema(description = "项目名称") |
| | | public String projectName; |
| | | |
| | | @Schema(description = "轮罐组名称") |
| | | public String groupCode; |
| | | } |
| | |
| | | @SsoAop() |
| | | public BaseResponse<VoProjectOne> one(@RequestParam Long id) { |
| | | VoProjectOne irProject = this.projectSv.selectById(id); |
| | | if (irProject == null) { |
| | | return BaseResponseUtils.buildFail(IrrigateResultCode.NO_PROJECT.getMessage()); |
| | | } else { |
| | | |
| | | return BaseResponseUtils.buildSuccess(irProject); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | }) |
| | | @GetMapping(path = "some") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoProject>>> getIntakes(QueryVo vo) { |
| | | public BaseResponse<QueryResultVo<List<VoProject>>> getProjects(QueryVo vo) { |
| | | try { |
| | | QueryResultVo<List<VoProject>> res = projectSv.getProjects(vo); |
| | | if (res == null) { |
| | | return BaseResponseUtils.buildFail(IrrigateResultCode.NO_PROJECT.getMessage()); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取项目记录异常", e); |
| | |
| | | NO_PROJECT(10005, "无符合条件的项目记录"); |
| | | |
| | | |
| | | // /** |
| | | // * 灌溉单元 |
| | | // */ |
| | | // ADD_IRRIGATE_UNIT_FAIL(20001, "创建灌溉单元失败"), |
| | | |
| | | private final Integer code; |
| | | private final String message; |
| | | } |