Merge remote-tracking branch 'origin/master'

This commit is contained in:
小魔仙~ 2024-12-19 19:19:01 +08:00
commit 925abcde4d
26 changed files with 1093 additions and 78 deletions

View File

@ -58,14 +58,14 @@ public class DeviceOtherMsgConsumer {
reportMsg.put("code",0);
reportMsg.put("msg","ok");
issueInstructionsProducer.receiveDataReportResponse(productId.toString(),serialNumber,JSONUtil.toJsonStr(reportMsg));
} else if ( topic.endsWith("hzlink/info/reply")) {
} else if ( topic.endsWith("/info/reply")) {
platformDataReportAckHandler(new String(data));
} else if (topic.endsWith("hzlink/cmd/down")) {
platformCmdHandler(new String(data));
//回应
} else if (topic.endsWith("hzlink/cmd/reply")) {
} else if (topic.endsWith("/cmd/reply")) {
deviceCmdAckHandler(new String(data));
}
otherMsgHandler.messageHandler(bo);
@ -81,45 +81,45 @@ public class DeviceOtherMsgConsumer {
private void deviceDataReportHandler(String data){
System.err.println("mqtt接收到设备上报数据"+ data);
//回应
//解析
// String jsonString = "{\"type\": \"waterEleData\", \"pakSn\": 123, \"data\": {\"workState\": 1, \"action\": \"startPump\", \"mcuSn\": \"MCU123456\", \"sumEle\": 5000, \"sumFlow\": 3000, \"insFlow\": 2.5, \"userSumFlow\": 1500, \"areaCode\": \"010\", \"cardId\": \"CARD12345678\", \"userBalance\": 100.0, \"userSumEle\": 3000, \"curEle\": 50, \"curFlow\": 200, \"insPower\": 2300}}";
JSONObject entries = JSONUtil.parseObj(data);
// System.err.println("解析后:"+entries);
//获取帧标识
String type = entries.getStr("type");
//获取帧号
Long pakSn = entries.getLong("pakSn");
//获取数据
JSONObject dataObj = entries.getJSONObject("data");
//获取水泵状态0=关泵,1=开泵
Integer workState = dataObj.getInt("workState");
//获取动作
String action = dataObj.getStr("action");
//获取单片机编码
String mcuSn = dataObj.getStr("mcuSn");
//获取累计用电量
Integer sumEle = dataObj.getInt("sumEle");
//获取累计用水量
Integer sumFlow = dataObj.getInt("sumFlow");
//获取瞬时流量
Double insFlow = dataObj.getDouble("insFlow");
//当前用户累计用水量
Integer userSumFlow = dataObj.getInt("userSumFlow");
//获取区域号
String areaCode = dataObj.getStr("areaCode");
//获取卡号
String cardId = dataObj.getStr("cardId");
//获取用户余额
Double userBalance = dataObj.getDouble("userBalance");
//获取用户累计用电量
Integer userSumEle = dataObj.getInt("userSumEle");
//获取本次用电量
Integer curEle = dataObj.getInt("curEle");
//获取本次用水量
Integer curFlow = dataObj.getInt("curFlow");
//获取瞬时功率
Integer insPower = dataObj.getInt("insPower");
//
// //解析
//// String jsonString = "{\"type\": \"waterEleData\", \"pakSn\": 123, \"data\": {\"workState\": 1, \"action\": \"startPump\", \"mcuSn\": \"MCU123456\", \"sumEle\": 5000, \"sumFlow\": 3000, \"insFlow\": 2.5, \"userSumFlow\": 1500, \"areaCode\": \"010\", \"cardId\": \"CARD12345678\", \"userBalance\": 100.0, \"userSumEle\": 3000, \"curEle\": 50, \"curFlow\": 200, \"insPower\": 2300}}";
// JSONObject entries = JSONUtil.parseObj(data);
//// System.err.println("解析后:"+entries);
// //获取帧标识
// String type = entries.getStr("type");
// //获取帧号
// Long pakSn = entries.getLong("pakSn");
// //获取数据
// JSONObject dataObj = entries.getJSONObject("data");
// //获取水泵状态0=关泵,1=开泵
// Integer workState = dataObj.getInt("workState");
// //获取动作
// String action = dataObj.getStr("action");
// //获取单片机编码
// String mcuSn = dataObj.getStr("mcuSn");
// //获取累计用电量
// Integer sumEle = dataObj.getInt("sumEle");
// //获取累计用水量
// Integer sumFlow = dataObj.getInt("sumFlow");
// //获取瞬时流量
// Double insFlow = dataObj.getDouble("insFlow");
// //当前用户累计用水量
// Integer userSumFlow = dataObj.getInt("userSumFlow");
// //获取区域号
// String areaCode = dataObj.getStr("areaCode");
// //获取卡号
// String cardId = dataObj.getStr("cardId");
// //获取用户余额
// Double userBalance = dataObj.getDouble("userBalance");
// //获取用户累计用电量
// Integer userSumEle = dataObj.getInt("userSumEle");
// //获取本次用电量
// Integer curEle = dataObj.getInt("curEle");
// //获取本次用水量
// Integer curFlow = dataObj.getInt("curFlow");
// //获取瞬时功率
// Integer insPower = dataObj.getInt("insPower");
}
/**

View File

@ -1,9 +1,12 @@
package com.fastbee.data.controller;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
import com.fastbee.common.annotation.Log;
import com.fastbee.common.constant.HttpStatus;
import com.fastbee.common.core.controller.BaseController;
import com.fastbee.common.core.domain.AjaxResult;
import com.fastbee.common.core.domain.AjaxResultPro;
import com.fastbee.common.core.domain.entity.SysRole;
import com.fastbee.common.core.domain.model.LoginUser;
import com.fastbee.common.core.page.TableDataInfo;
@ -16,6 +19,7 @@ import com.fastbee.common.utils.poi.ExcelUtil;
import com.fastbee.data.service.devicedetail.IDeviceDetailService;
import com.fastbee.iot.domain.Device;
import com.fastbee.iot.domain.JiankongDeviceParam;
import com.fastbee.iot.mapper.DeviceMapper;
import com.fastbee.iot.model.DeviceAssignmentVO;
import com.fastbee.iot.model.DeviceImportVO;
import com.fastbee.iot.model.DeviceRelateUserInput;
@ -54,6 +58,8 @@ public class DeviceController extends BaseController {
@Autowired
private IDeviceService deviceService;
@Autowired
private DeviceMapper deviceMapper;
@Autowired
private IDeviceDetailService deviceDetailService;
// @Lazy
@Autowired
@ -508,11 +514,19 @@ public class DeviceController extends BaseController {
*/
@GetMapping("/getDeviceIsActivation")
@ApiOperation("根据设备编号判断设备是否激活")
public AjaxResult getDeviceActivation(String serialNumber) {
Device device = deviceService.selectDeviceBySerialNumber(serialNumber);
if(device.getStatus().toString().equals("1")){
return AjaxResult.success(false);
public AjaxResultPro getDeviceActivation(String serialNumber) {
List<Device> list = new LambdaQueryChainWrapper<>(deviceMapper)
.select(Device::getDeviceId, Device::getStatus)
.eq(Device::getSerialNumber, serialNumber)
.list();
if(list.isEmpty()){
return AjaxResultPro.success(204,"设备不存在!",null);
}
return AjaxResult.success(true);
Device device = list.get(0);
if(device.getStatus().toString().equals("1")){
return AjaxResultPro.success(false);
}
return AjaxResultPro.success(true);
}
}

View File

@ -50,6 +50,7 @@ public class DeviceOperationController {
} else if (deviceOperationDTO.getOperationType().equals("100")) {
param.put("cmd",100);
Map<String,Object> data = new HashMap<>();
//status0关1开2停止
data.put("status",deviceOperationDTO.getOperationCode());
param.put("data",data);
}

View File

@ -0,0 +1,110 @@
package com.fastbee.data.controller.userRecharge;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.fastbee.common.annotation.Log;
import com.fastbee.common.core.controller.BaseController;
import com.fastbee.common.core.domain.AjaxResult;
import com.fastbee.common.enums.BusinessType;
import com.fastbee.rechargecard.domain.NgIrrigationControllers;
import com.fastbee.rechargecard.service.INgIrrigationControllersService;
import com.fastbee.common.utils.poi.ExcelUtil;
import com.fastbee.common.core.page.TableDataInfo;
/**
* 灌溉控制器信息Controller
*
* @author kerwincui
* @date 2024-12-19
*/
@RestController
@RequestMapping("/rechargecard/controllers")
@Api(tags = "灌溉控制器信息")
public class NgIrrigationControllersController extends BaseController
{
@Autowired
private INgIrrigationControllersService ngIrrigationControllersService;
/**
* 查询灌溉控制器信息列表
*/
@PreAuthorize("@ss.hasPermi('rechargecard:controllers:list')")
@GetMapping("/list")
@ApiOperation("查询灌溉控制器信息列表")
public TableDataInfo list(NgIrrigationControllers ngIrrigationControllers)
{
startPage();
List<NgIrrigationControllers> list = ngIrrigationControllersService.selectNgIrrigationControllersList(ngIrrigationControllers);
return getDataTable(list);
}
/**
* 导出灌溉控制器信息列表
*/
@ApiOperation("导出灌溉控制器信息列表")
@PreAuthorize("@ss.hasPermi('rechargecard:controllers:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, NgIrrigationControllers ngIrrigationControllers)
{
List<NgIrrigationControllers> list = ngIrrigationControllersService.selectNgIrrigationControllersList(ngIrrigationControllers);
ExcelUtil<NgIrrigationControllers> util = new ExcelUtil<NgIrrigationControllers>(NgIrrigationControllers.class);
util.exportExcel(response, list, "灌溉控制器信息数据");
}
/**
* 获取灌溉控制器信息详细信息
*/
@PreAuthorize("@ss.hasPermi('rechargecard:controllers:query')")
@GetMapping(value = "/{id}")
@ApiOperation("获取灌溉控制器信息详细信息")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(ngIrrigationControllersService.selectNgIrrigationControllersById(id));
}
/**
* 新增灌溉控制器信息
*/
@PreAuthorize("@ss.hasPermi('rechargecard:controllers:add')")
@PostMapping
@ApiOperation("新增灌溉控制器信息")
public AjaxResult add(@RequestBody NgIrrigationControllers ngIrrigationControllers)
{
return toAjax(ngIrrigationControllersService.insertNgIrrigationControllers(ngIrrigationControllers));
}
/**
* 修改灌溉控制器信息
*/
@PreAuthorize("@ss.hasPermi('rechargecard:controllers:edit')")
@PutMapping
@ApiOperation("修改灌溉控制器信息")
public AjaxResult edit(@RequestBody NgIrrigationControllers ngIrrigationControllers)
{
return toAjax(ngIrrigationControllersService.updateNgIrrigationControllers(ngIrrigationControllers));
}
/**
* 删除灌溉控制器信息
*/
@PreAuthorize("@ss.hasPermi('rechargecard:controllers:remove')")
@DeleteMapping("/{ids}")
@ApiOperation("删除灌溉控制器信息")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(ngIrrigationControllersService.deleteNgIrrigationControllersByIds(ids));
}
}

View File

@ -0,0 +1,110 @@
package com.fastbee.data.controller.userRecharge;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.fastbee.common.annotation.Log;
import com.fastbee.common.core.controller.BaseController;
import com.fastbee.common.core.domain.AjaxResult;
import com.fastbee.common.enums.BusinessType;
import com.fastbee.rechargecard.domain.NgWaterPumpUsageRecords;
import com.fastbee.rechargecard.service.INgWaterPumpUsageRecordsService;
import com.fastbee.common.utils.poi.ExcelUtil;
import com.fastbee.common.core.page.TableDataInfo;
/**
* 水泵设备使用记录Controller
*
* @author kerwincui
* @date 2024-12-19
*/
@RestController
@RequestMapping("/waterpump/records")
@Api(tags = "水泵设备使用记录")
public class NgWaterPumpUsageRecordsController extends BaseController
{
@Autowired
private INgWaterPumpUsageRecordsService ngWaterPumpUsageRecordsService;
/**
* 查询水泵设备使用记录列表
*/
// @PreAuthorize("@ss.hasPermi('rechargecard:records:list')")
@GetMapping("/list")
@ApiOperation("查询水泵设备使用记录列表")
public TableDataInfo list(NgWaterPumpUsageRecords ngWaterPumpUsageRecords)
{
startPage();
List<NgWaterPumpUsageRecords> list = ngWaterPumpUsageRecordsService.selectNgWaterPumpUsageRecordsList(ngWaterPumpUsageRecords);
return getDataTable(list);
}
/**
* 导出水泵设备使用记录列表
*/
@ApiOperation("导出水泵设备使用记录列表")
@PreAuthorize("@ss.hasPermi('rechargecard:records:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, NgWaterPumpUsageRecords ngWaterPumpUsageRecords)
{
List<NgWaterPumpUsageRecords> list = ngWaterPumpUsageRecordsService.selectNgWaterPumpUsageRecordsList(ngWaterPumpUsageRecords);
ExcelUtil<NgWaterPumpUsageRecords> util = new ExcelUtil<NgWaterPumpUsageRecords>(NgWaterPumpUsageRecords.class);
util.exportExcel(response, list, "水泵设备使用记录数据");
}
/**
* 获取水泵设备使用记录详细信息
*/
@PreAuthorize("@ss.hasPermi('rechargecard:records:query')")
@GetMapping(value = "/{id}")
@ApiOperation("获取水泵设备使用记录详细信息")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(ngWaterPumpUsageRecordsService.selectNgWaterPumpUsageRecordsById(id));
}
/**
* 新增水泵设备使用记录
*/
@PreAuthorize("@ss.hasPermi('rechargecard:records:add')")
@PostMapping
@ApiOperation("新增水泵设备使用记录")
public AjaxResult add(@RequestBody NgWaterPumpUsageRecords ngWaterPumpUsageRecords)
{
return toAjax(ngWaterPumpUsageRecordsService.insertNgWaterPumpUsageRecords(ngWaterPumpUsageRecords));
}
/**
* 修改水泵设备使用记录
*/
@PreAuthorize("@ss.hasPermi('rechargecard:records:edit')")
@PutMapping
@ApiOperation("修改水泵设备使用记录")
public AjaxResult edit(@RequestBody NgWaterPumpUsageRecords ngWaterPumpUsageRecords)
{
return toAjax(ngWaterPumpUsageRecordsService.updateNgWaterPumpUsageRecords(ngWaterPumpUsageRecords));
}
/**
* 删除水泵设备使用记录
*/
@PreAuthorize("@ss.hasPermi('rechargecard:records:remove')")
@DeleteMapping("/{ids}")
@ApiOperation("删除水泵设备使用记录")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(ngWaterPumpUsageRecordsService.deleteNgWaterPumpUsageRecordsByIds(ids));
}
}

View File

@ -3,6 +3,7 @@ package com.fastbee.data.controller.userRecharge;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.fastbee.rechargecard.domain.dto.UserIrrigationRecordDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
@ -65,12 +66,28 @@ public class UserIrrigationRecordController extends BaseController
/**
* 获取用户灌溉记录展示详细信息列表
*/
/*@PreAuthorize("@ss.hasPermi('rechargecard:record:query')")
@GetMapping(value = "/list/show/{cardNumber}")
@ApiOperation("获取灌溉记录详细信息")
public AjaxResult getShowInfo(@PathVariable("cardNumber") String cardNumber)
@PreAuthorize("@ss.hasPermi('rechargecard:record:list')")
@GetMapping("/list/show")
@ApiOperation("查询灌溉记录列表")
public TableDataInfo Showlist(UserIrrigationRecord userIrrigationRecord)
{
return success(userIrrigationRecordService.selectUserIrrigationRecordListShowBycardNumber(cardNumber));
startPage();
List<UserIrrigationRecordDto> list = userIrrigationRecordService.selectUserIrrigationRecordShowList(userIrrigationRecord);
return getDataTable(list);
}
/**
* 获取用户灌溉记录展示详细信息列表
*/
/*@PreAuthorize("@ss.hasPermi('rechargecard:record:list')")
@GetMapping("/list/show/{cardNumber}")
@ApiOperation("查询灌溉记录列表")
public TableDataInfo ShowlistByCardNumber(@PathVariable("cardNumber") String cardNumber)
{
startPage();
UserIrrigationRecord userIrrigationRecord=new UserIrrigationRecord();
userIrrigationRecord.setCardNumber(cardNumber);
List<UserIrrigationRecordDto> list = userIrrigationRecordService.selectUserIrrigationRecordShowList(userIrrigationRecord);
return getDataTable(list);
}*/
/**

View File

@ -41,7 +41,7 @@ public class MaGuangaiRecordController extends BaseController
/**
* 查询灌溉记录列表
*/
@PreAuthorize("@ss.hasPermi('waterele:guangaiRecord:list')")
//@PreAuthorize("@ss.hasPermi('waterele:guangaiRecord:list')")
@GetMapping("/list")
@ApiOperation("查询灌溉记录列表")
public TableDataInfo list(MaGuangaiRecord maGuangaiRecord)

View File

@ -0,0 +1,67 @@
package com.fastbee.rechargecard.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.fastbee.common.annotation.Excel;
import com.fastbee.common.core.domain.BaseEntity;
/**
* 灌溉控制器信息对象 ng_irrigation_controllers
*
* @author kerwincui
* @date 2024-12-19
*/
@ApiModel(value = "NgIrrigationControllers",description = "灌溉控制器信息 ng_irrigation_controllers")
@Data
@EqualsAndHashCode(callSuper = true)
public class NgIrrigationControllers extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** 控制器编码 */
@Excel(name = "控制器编码")
@ApiModelProperty("控制器编码")
private String serialNumber;
/** 控制器名称 */
@Excel(name = "控制器名称")
@ApiModelProperty("控制器名称")
private String controllerName;
/** 控制器型号 */
@Excel(name = "控制器型号")
@ApiModelProperty("控制器型号")
private String controllerModel;
/** 安装日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "安装日期", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty("安装日期")
private Date installationDate;
/** 控制器状态,0=开启1=关闭2=维护中 */
@Excel(name = "控制器状态,0=开启1=关闭2=维护中")
@ApiModelProperty("控制器状态,0=开启1=关闭2=维护中")
private Integer status;
/** 上次维护日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "上次维护日期", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty("上次维护日期")
private Date lastMaintenance;
/** 区域码 */
@Excel(name = "区域码")
@ApiModelProperty("区域码")
private String areaCode;
}

View File

@ -68,9 +68,9 @@ public class NgRechargeMachines extends BaseEntity
@ApiModelProperty("联系电话")
private String contactPhone;
/** 备注 */
@Excel(name = "备注")
@ApiModelProperty("备注")
private String remark;
/** 充值机名称 */
@Excel(name = "充值机名称")
@ApiModelProperty("充值机名称")
private String deviceName;
}

View File

@ -79,14 +79,9 @@ public class NgUserRechargeRecords extends BaseEntity
@ApiModelProperty("充值状态,0=成功1=失败")
private Integer status;
/** 充值机id */
@Excel(name = "充值机id")
@ApiModelProperty("充值机id")
private Long deviceId;
/** 备注 */
@Excel(name = "备注")
@ApiModelProperty("备注")
private String remark;
/** 充值机编码 */
@Excel(name = "充值机编码")
@ApiModelProperty("充值机编码")
private String serialNumber;
}

View File

@ -0,0 +1,50 @@
package com.fastbee.rechargecard.domain;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.fastbee.common.annotation.Excel;
import com.fastbee.common.core.domain.BaseEntity;
/**
* 水泵设备使用记录对象 ng_water_pump_usage_records
*
* @author kerwincui
* @date 2024-12-19
*/
@ApiModel(value = "NgWaterPumpUsageRecords",description = "水泵设备使用记录 ng_water_pump_usage_records")
@Data
public class NgWaterPumpUsageRecords implements Serializable {
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 开泵时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "开泵时间", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty("开泵时间")
private Date pumpStartTime;
/** 关泵时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "关泵时间", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty("关泵时间")
private Date pumpStopTime;
/** 设备编号 */
@Excel(name = "设备编号")
@ApiModelProperty("设备编号")
private String deviceNumber;
/** 报文内容 */
@Excel(name = "报文内容")
@ApiModelProperty("报文内容")
private String messageContent;
}

View File

@ -101,19 +101,19 @@ public class UserConsumptionDetails extends BaseEntity
private BigDecimal billingPeriodDuration;
/** 账单生成的日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:MM:SS")
@Excel(name = "账单生成的日期", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty("账单生成的日期")
private Date billingDate;
/** 开泵时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:MM:SS")
@Excel(name = "开泵时间", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty("开泵时间")
private Date startTime;
/** 关泵时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:MM:SS")
@Excel(name = "关泵时间", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty("关泵时间")
private Date endTime;
@ -129,7 +129,7 @@ public class UserConsumptionDetails extends BaseEntity
private Integer paymentMethod;
/** 账单支付的时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:MM:SS")
@Excel(name = " 账单支付的时间", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty(" 账单支付的时间")
private Date paymentTime;

View File

@ -74,13 +74,13 @@ public class UserIrrigationRecord extends BaseEntity
private BigDecimal balance;
/** 开泵时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:MM:SS")
@Excel(name = "开泵时间", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty("开泵时间")
private Date startTime;
/** 关泵时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:MM:SS")
@Excel(name = "关泵时间", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty("关泵时间")
private Date endTime;

View File

@ -2,6 +2,7 @@ package com.fastbee.rechargecard.domain.dto;
import cn.hutool.core.date.DateTime;
import com.fastbee.rechargecard.domain.UserIrrigationRecord;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.math.BigDecimal;
import java.util.Date;
@ -13,6 +14,8 @@ public class UserIrrigationRecordDto
public String deviceName;
public String cardNumber;
public BigDecimal flow;
@JsonFormat(pattern = "yyyy-MM-dd HH:MM:SS")
public Date startTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:MM:SS")
public Date endTime;
}

View File

@ -0,0 +1,63 @@
package com.fastbee.rechargecard.mapper;
import java.util.List;
import com.fastbee.rechargecard.domain.NgIrrigationControllers;
import org.apache.ibatis.annotations.Mapper;
/**
* 灌溉控制器信息Mapper接口
*
* @author kerwincui
* @date 2024-12-19
*/
@Mapper
public interface NgIrrigationControllersMapper
{
/**
* 查询灌溉控制器信息
*
* @param id 灌溉控制器信息主键
* @return 灌溉控制器信息
*/
public NgIrrigationControllers selectNgIrrigationControllersById(Long id);
/**
* 查询灌溉控制器信息列表
*
* @param ngIrrigationControllers 灌溉控制器信息
* @return 灌溉控制器信息集合
*/
public List<NgIrrigationControllers> selectNgIrrigationControllersList(NgIrrigationControllers ngIrrigationControllers);
/**
* 新增灌溉控制器信息
*
* @param ngIrrigationControllers 灌溉控制器信息
* @return 结果
*/
public int insertNgIrrigationControllers(NgIrrigationControllers ngIrrigationControllers);
/**
* 修改灌溉控制器信息
*
* @param ngIrrigationControllers 灌溉控制器信息
* @return 结果
*/
public int updateNgIrrigationControllers(NgIrrigationControllers ngIrrigationControllers);
/**
* 删除灌溉控制器信息
*
* @param id 灌溉控制器信息主键
* @return 结果
*/
public int deleteNgIrrigationControllersById(Long id);
/**
* 批量删除灌溉控制器信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteNgIrrigationControllersByIds(Long[] ids);
}

View File

@ -0,0 +1,63 @@
package com.fastbee.rechargecard.mapper;
import java.util.List;
import com.fastbee.rechargecard.domain.NgWaterPumpUsageRecords;
import org.apache.ibatis.annotations.Mapper;
/**
* 水泵设备使用记录Mapper接口
*
* @author kerwincui
* @date 2024-12-19
*/
@Mapper
public interface NgWaterPumpUsageRecordsMapper
{
/**
* 查询水泵设备使用记录
*
* @param id 水泵设备使用记录主键
* @return 水泵设备使用记录
*/
public NgWaterPumpUsageRecords selectNgWaterPumpUsageRecordsById(Long id);
/**
* 查询水泵设备使用记录列表
*
* @param ngWaterPumpUsageRecords 水泵设备使用记录
* @return 水泵设备使用记录集合
*/
public List<NgWaterPumpUsageRecords> selectNgWaterPumpUsageRecordsList(NgWaterPumpUsageRecords ngWaterPumpUsageRecords);
/**
* 新增水泵设备使用记录
*
* @param ngWaterPumpUsageRecords 水泵设备使用记录
* @return 结果
*/
public int insertNgWaterPumpUsageRecords(NgWaterPumpUsageRecords ngWaterPumpUsageRecords);
/**
* 修改水泵设备使用记录
*
* @param ngWaterPumpUsageRecords 水泵设备使用记录
* @return 结果
*/
public int updateNgWaterPumpUsageRecords(NgWaterPumpUsageRecords ngWaterPumpUsageRecords);
/**
* 删除水泵设备使用记录
*
* @param id 水泵设备使用记录主键
* @return 结果
*/
public int deleteNgWaterPumpUsageRecordsById(Long id);
/**
* 批量删除水泵设备使用记录
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteNgWaterPumpUsageRecordsByIds(Long[] ids);
}

View File

@ -0,0 +1,61 @@
package com.fastbee.rechargecard.service;
import java.util.List;
import com.fastbee.rechargecard.domain.NgIrrigationControllers;
/**
* 灌溉控制器信息Service接口
*
* @author kerwincui
* @date 2024-12-19
*/
public interface INgIrrigationControllersService
{
/**
* 查询灌溉控制器信息
*
* @param id 灌溉控制器信息主键
* @return 灌溉控制器信息
*/
public NgIrrigationControllers selectNgIrrigationControllersById(Long id);
/**
* 查询灌溉控制器信息列表
*
* @param ngIrrigationControllers 灌溉控制器信息
* @return 灌溉控制器信息集合
*/
public List<NgIrrigationControllers> selectNgIrrigationControllersList(NgIrrigationControllers ngIrrigationControllers);
/**
* 新增灌溉控制器信息
*
* @param ngIrrigationControllers 灌溉控制器信息
* @return 结果
*/
public int insertNgIrrigationControllers(NgIrrigationControllers ngIrrigationControllers);
/**
* 修改灌溉控制器信息
*
* @param ngIrrigationControllers 灌溉控制器信息
* @return 结果
*/
public int updateNgIrrigationControllers(NgIrrigationControllers ngIrrigationControllers);
/**
* 批量删除灌溉控制器信息
*
* @param ids 需要删除的灌溉控制器信息主键集合
* @return 结果
*/
public int deleteNgIrrigationControllersByIds(Long[] ids);
/**
* 删除灌溉控制器信息信息
*
* @param id 灌溉控制器信息主键
* @return 结果
*/
public int deleteNgIrrigationControllersById(Long id);
}

View File

@ -0,0 +1,61 @@
package com.fastbee.rechargecard.service;
import java.util.List;
import com.fastbee.rechargecard.domain.NgWaterPumpUsageRecords;
/**
* 水泵设备使用记录Service接口
*
* @author kerwincui
* @date 2024-12-19
*/
public interface INgWaterPumpUsageRecordsService
{
/**
* 查询水泵设备使用记录
*
* @param id 水泵设备使用记录主键
* @return 水泵设备使用记录
*/
public NgWaterPumpUsageRecords selectNgWaterPumpUsageRecordsById(Long id);
/**
* 查询水泵设备使用记录列表
*
* @param ngWaterPumpUsageRecords 水泵设备使用记录
* @return 水泵设备使用记录集合
*/
public List<NgWaterPumpUsageRecords> selectNgWaterPumpUsageRecordsList(NgWaterPumpUsageRecords ngWaterPumpUsageRecords);
/**
* 新增水泵设备使用记录
*
* @param ngWaterPumpUsageRecords 水泵设备使用记录
* @return 结果
*/
public int insertNgWaterPumpUsageRecords(NgWaterPumpUsageRecords ngWaterPumpUsageRecords);
/**
* 修改水泵设备使用记录
*
* @param ngWaterPumpUsageRecords 水泵设备使用记录
* @return 结果
*/
public int updateNgWaterPumpUsageRecords(NgWaterPumpUsageRecords ngWaterPumpUsageRecords);
/**
* 批量删除水泵设备使用记录
*
* @param ids 需要删除的水泵设备使用记录主键集合
* @return 结果
*/
public int deleteNgWaterPumpUsageRecordsByIds(Long[] ids);
/**
* 删除水泵设备使用记录信息
*
* @param id 水泵设备使用记录主键
* @return 结果
*/
public int deleteNgWaterPumpUsageRecordsById(Long id);
}

View File

@ -20,6 +20,14 @@ public interface IUserIrrigationRecordService
*/
//public List<UserIrrigationRecordDto> selectUserIrrigationRecordListShowBycardNumber(String cardNumber);
/**
* 查询展示灌溉记录列表
*
* @param userIrrigationRecord 灌溉记录
* @return 灌溉记录集合
*/
public List<UserIrrigationRecordDto> selectUserIrrigationRecordShowList(UserIrrigationRecord userIrrigationRecord);
/**
* 查询用户灌溉记录列表
*

View File

@ -0,0 +1,96 @@
package com.fastbee.rechargecard.service.impl;
import java.util.List;
import com.fastbee.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fastbee.rechargecard.mapper.NgIrrigationControllersMapper;
import com.fastbee.rechargecard.domain.NgIrrigationControllers;
import com.fastbee.rechargecard.service.INgIrrigationControllersService;
/**
* 灌溉控制器信息Service业务层处理
*
* @author kerwincui
* @date 2024-12-19
*/
@Service
public class NgIrrigationControllersServiceImpl implements INgIrrigationControllersService
{
@Autowired
private NgIrrigationControllersMapper ngIrrigationControllersMapper;
/**
* 查询灌溉控制器信息
*
* @param id 灌溉控制器信息主键
* @return 灌溉控制器信息
*/
@Override
public NgIrrigationControllers selectNgIrrigationControllersById(Long id)
{
return ngIrrigationControllersMapper.selectNgIrrigationControllersById(id);
}
/**
* 查询灌溉控制器信息列表
*
* @param ngIrrigationControllers 灌溉控制器信息
* @return 灌溉控制器信息
*/
@Override
public List<NgIrrigationControllers> selectNgIrrigationControllersList(NgIrrigationControllers ngIrrigationControllers)
{
return ngIrrigationControllersMapper.selectNgIrrigationControllersList(ngIrrigationControllers);
}
/**
* 新增灌溉控制器信息
*
* @param ngIrrigationControllers 灌溉控制器信息
* @return 结果
*/
@Override
public int insertNgIrrigationControllers(NgIrrigationControllers ngIrrigationControllers)
{
ngIrrigationControllers.setCreateTime(DateUtils.getNowDate());
return ngIrrigationControllersMapper.insertNgIrrigationControllers(ngIrrigationControllers);
}
/**
* 修改灌溉控制器信息
*
* @param ngIrrigationControllers 灌溉控制器信息
* @return 结果
*/
@Override
public int updateNgIrrigationControllers(NgIrrigationControllers ngIrrigationControllers)
{
ngIrrigationControllers.setUpdateTime(DateUtils.getNowDate());
return ngIrrigationControllersMapper.updateNgIrrigationControllers(ngIrrigationControllers);
}
/**
* 批量删除灌溉控制器信息
*
* @param ids 需要删除的灌溉控制器信息主键
* @return 结果
*/
@Override
public int deleteNgIrrigationControllersByIds(Long[] ids)
{
return ngIrrigationControllersMapper.deleteNgIrrigationControllersByIds(ids);
}
/**
* 删除灌溉控制器信息信息
*
* @param id 灌溉控制器信息主键
* @return 结果
*/
@Override
public int deleteNgIrrigationControllersById(Long id)
{
return ngIrrigationControllersMapper.deleteNgIrrigationControllersById(id);
}
}

View File

@ -0,0 +1,93 @@
package com.fastbee.rechargecard.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fastbee.rechargecard.mapper.NgWaterPumpUsageRecordsMapper;
import com.fastbee.rechargecard.domain.NgWaterPumpUsageRecords;
import com.fastbee.rechargecard.service.INgWaterPumpUsageRecordsService;
/**
* 水泵设备使用记录Service业务层处理
*
* @author kerwincui
* @date 2024-12-19
*/
@Service
public class NgWaterPumpUsageRecordsServiceImpl implements INgWaterPumpUsageRecordsService
{
@Autowired
private NgWaterPumpUsageRecordsMapper ngWaterPumpUsageRecordsMapper;
/**
* 查询水泵设备使用记录
*
* @param id 水泵设备使用记录主键
* @return 水泵设备使用记录
*/
@Override
public NgWaterPumpUsageRecords selectNgWaterPumpUsageRecordsById(Long id)
{
return ngWaterPumpUsageRecordsMapper.selectNgWaterPumpUsageRecordsById(id);
}
/**
* 查询水泵设备使用记录列表
*
* @param ngWaterPumpUsageRecords 水泵设备使用记录
* @return 水泵设备使用记录
*/
@Override
public List<NgWaterPumpUsageRecords> selectNgWaterPumpUsageRecordsList(NgWaterPumpUsageRecords ngWaterPumpUsageRecords)
{
return ngWaterPumpUsageRecordsMapper.selectNgWaterPumpUsageRecordsList(ngWaterPumpUsageRecords);
}
/**
* 新增水泵设备使用记录
*
* @param ngWaterPumpUsageRecords 水泵设备使用记录
* @return 结果
*/
@Override
public int insertNgWaterPumpUsageRecords(NgWaterPumpUsageRecords ngWaterPumpUsageRecords)
{
return ngWaterPumpUsageRecordsMapper.insertNgWaterPumpUsageRecords(ngWaterPumpUsageRecords);
}
/**
* 修改水泵设备使用记录
*
* @param ngWaterPumpUsageRecords 水泵设备使用记录
* @return 结果
*/
@Override
public int updateNgWaterPumpUsageRecords(NgWaterPumpUsageRecords ngWaterPumpUsageRecords)
{
return ngWaterPumpUsageRecordsMapper.updateNgWaterPumpUsageRecords(ngWaterPumpUsageRecords);
}
/**
* 批量删除水泵设备使用记录
*
* @param ids 需要删除的水泵设备使用记录主键
* @return 结果
*/
@Override
public int deleteNgWaterPumpUsageRecordsByIds(Long[] ids)
{
return ngWaterPumpUsageRecordsMapper.deleteNgWaterPumpUsageRecordsByIds(ids);
}
/**
* 删除水泵设备使用记录信息
*
* @param id 水泵设备使用记录主键
* @return 结果
*/
@Override
public int deleteNgWaterPumpUsageRecordsById(Long id)
{
return ngWaterPumpUsageRecordsMapper.deleteNgWaterPumpUsageRecordsById(id);
}
}

View File

@ -1,5 +1,6 @@
package com.fastbee.rechargecard.service.impl;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import com.fastbee.common.utils.DateUtils;
@ -28,6 +29,26 @@ public class UserIrrigationRecordServiceImpl implements IUserIrrigationRecordSer
@Autowired
private DeviceMapper deviceMapper;
@Override
public List<UserIrrigationRecordDto> selectUserIrrigationRecordShowList(UserIrrigationRecord userIrrigationRecord) {
List<UserIrrigationRecordDto> result=new ArrayList<>();
List<UserIrrigationRecord> list=userIrrigationRecordMapper.selectUserIrrigationRecordList(userIrrigationRecord);
for(int i=0;i<list.size();i++)
{
UserIrrigationRecordDto temp=new UserIrrigationRecordDto();
temp.id=list.get(i).getId();
temp.userName= sysUserMapper.selectUserById(list.get(i).getUserId()).getUserName()==null ? "" :sysUserMapper.selectUserById(list.get(i).getUserId()).getUserName();
temp.deviceName=deviceMapper.selectDeviceBySerialNumber(list.get(i).getDeviceNumber()).getDeviceName() == null ? "":deviceMapper.selectDeviceBySerialNumber(list.get(i).getDeviceNumber()).getDeviceName();
temp.cardNumber=list.get(i).getCardNumber() == null ? "" : list.get(i).getCardNumber();
temp.flow=list.get(i).getCurFlow()==null ? BigDecimal.valueOf(0) :list.get(i).getCurFlow();
temp.startTime=list.get(i).getStartTime()==null ? null : list.get(i).getStartTime();
temp.endTime=list.get(i).getEndTime()==null ? null :list.get(0).getEndTime();
result.add(temp);
}
return result;
}
/**
* 获取用户灌溉记录列表
* @param cardNumber 卡号

View File

@ -0,0 +1,106 @@
<?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.fastbee.rechargecard.mapper.NgIrrigationControllersMapper">
<resultMap type="NgIrrigationControllers" id="NgIrrigationControllersResult">
<result property="id" column="id" />
<result property="serialNumber" column="serial_number" />
<result property="controllerName" column="controller_name" />
<result property="controllerModel" column="controller_model" />
<result property="installationDate" column="installation_date" />
<result property="status" column="status" />
<result property="lastMaintenance" column="last_maintenance" />
<result property="areaCode" column="area_code" />
<result property="remark" column="remark" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
</resultMap>
<sql id="selectNgIrrigationControllersVo">
select id, serial_number, controller_name, controller_model, installation_date, status, last_maintenance, area_code, remark, create_time, update_time, create_by, update_by from ng_irrigation_controllers
</sql>
<select id="selectNgIrrigationControllersList" parameterType="NgIrrigationControllers" resultMap="NgIrrigationControllersResult">
<include refid="selectNgIrrigationControllersVo"/>
<where>
<if test="serialNumber != null and serialNumber != ''"> and serial_number = #{serialNumber}</if>
<if test="controllerName != null and controllerName != ''"> and controller_name like concat('%', #{controllerName}, '%')</if>
<if test="controllerModel != null and controllerModel != ''"> and controller_model = #{controllerModel}</if>
<if test="installationDate != null "> and installation_date = #{installationDate}</if>
<if test="status != null "> and status = #{status}</if>
<if test="lastMaintenance != null "> and last_maintenance = #{lastMaintenance}</if>
<if test="areaCode != null and areaCode != ''"> and area_code = #{areaCode}</if>
</where>
</select>
<select id="selectNgIrrigationControllersById" parameterType="Long" resultMap="NgIrrigationControllersResult">
<include refid="selectNgIrrigationControllersVo"/>
where id = #{id}
</select>
<insert id="insertNgIrrigationControllers" parameterType="NgIrrigationControllers" useGeneratedKeys="true" keyProperty="id">
insert into ng_irrigation_controllers
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="serialNumber != null and serialNumber != ''">serial_number,</if>
<if test="controllerName != null">controller_name,</if>
<if test="controllerModel != null and controllerModel != ''">controller_model,</if>
<if test="installationDate != null">installation_date,</if>
<if test="status != null">status,</if>
<if test="lastMaintenance != null">last_maintenance,</if>
<if test="areaCode != null">area_code,</if>
<if test="remark != null">remark,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="serialNumber != null and serialNumber != ''">#{serialNumber},</if>
<if test="controllerName != null">#{controllerName},</if>
<if test="controllerModel != null and controllerModel != ''">#{controllerModel},</if>
<if test="installationDate != null">#{installationDate},</if>
<if test="status != null">#{status},</if>
<if test="lastMaintenance != null">#{lastMaintenance},</if>
<if test="areaCode != null">#{areaCode},</if>
<if test="remark != null">#{remark},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
</trim>
</insert>
<update id="updateNgIrrigationControllers" parameterType="NgIrrigationControllers">
update ng_irrigation_controllers
<trim prefix="SET" suffixOverrides=",">
<if test="serialNumber != null and serialNumber != ''">serial_number = #{serialNumber},</if>
<if test="controllerName != null">controller_name = #{controllerName},</if>
<if test="controllerModel != null and controllerModel != ''">controller_model = #{controllerModel},</if>
<if test="installationDate != null">installation_date = #{installationDate},</if>
<if test="status != null">status = #{status},</if>
<if test="lastMaintenance != null">last_maintenance = #{lastMaintenance},</if>
<if test="areaCode != null">area_code = #{areaCode},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteNgIrrigationControllersById" parameterType="Long">
delete from ng_irrigation_controllers where id = #{id}
</delete>
<delete id="deleteNgIrrigationControllersByIds" parameterType="String">
delete from ng_irrigation_controllers where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -19,10 +19,11 @@
<result property="updateTime" column="update_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
<result property="deviceName" column="device_name" />
</resultMap>
<sql id="selectNgRechargeMachinesVo">
select id, location, device_model, serial_number, area_code, installation_date, status, contact_person, contact_phone, remark, create_time, update_time, create_by, update_by from ng_recharge_machines
select id, location, device_model, serial_number, area_code, installation_date, status, contact_person, contact_phone, remark, create_time, update_time, create_by, update_by, device_name from ng_recharge_machines
</sql>
<select id="selectNgRechargeMachinesList" parameterType="NgRechargeMachines" resultMap="NgRechargeMachinesResult">
@ -36,6 +37,7 @@
<if test="status != null "> and status = #{status}</if>
<if test="contactPerson != null and contactPerson != ''"> and contact_person = #{contactPerson}</if>
<if test="contactPhone != null and contactPhone != ''"> and contact_phone = #{contactPhone}</if>
<if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
</where>
</select>
@ -60,6 +62,7 @@
<if test="updateTime != null">update_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
<if test="deviceName != null">device_name,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="location != null">#{location},</if>
@ -75,6 +78,7 @@
<if test="updateTime != null">#{updateTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="deviceName != null">#{deviceName},</if>
</trim>
</insert>
@ -94,6 +98,7 @@
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="deviceName != null">device_name = #{deviceName},</if>
</trim>
where id = #{id}
</update>

View File

@ -16,7 +16,7 @@
<result property="rechargeTime" column="recharge_time" />
<result property="rechargeCode" column="recharge_code" />
<result property="status" column="status" />
<result property="deviceId" column="device_id" />
<result property="serialNumber" column="serial_number" />
<result property="remark" column="remark" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
@ -25,7 +25,7 @@
</resultMap>
<sql id="selectNgUserRechargeRecordsVo">
select id, user_id, user_name, card_number, area_code, type, amount, balance, recharge_time, recharge_code, status, device_id, remark, create_time, update_time, create_by, update_by from ng_user_recharge_records
select id, user_id, user_name, card_number, area_code, type, amount, balance, recharge_time, recharge_code, status, serial_number, remark, create_time, update_time, create_by, update_by from ng_user_recharge_records
</sql>
<select id="selectNgUserRechargeRecordsList" parameterType="NgUserRechargeRecords" resultMap="NgUserRechargeRecordsResult">
@ -41,7 +41,7 @@
<if test="rechargeTime != null "> and recharge_time = #{rechargeTime}</if>
<if test="rechargeCode != null and rechargeCode != ''"> and recharge_code = #{rechargeCode}</if>
<if test="status != null "> and status = #{status}</if>
<if test="deviceId != null "> and device_id = #{deviceId}</if>
<if test="serialNumber != null and serialNumber != ''"> and serial_number = #{serialNumber}</if>
</where>
</select>
@ -63,7 +63,7 @@
<if test="rechargeTime != null">recharge_time,</if>
<if test="rechargeCode != null">recharge_code,</if>
<if test="status != null">status,</if>
<if test="deviceId != null">device_id,</if>
<if test="serialNumber != null and serialNumber != ''">serial_number,</if>
<if test="remark != null">remark,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
@ -81,7 +81,7 @@
<if test="rechargeTime != null">#{rechargeTime},</if>
<if test="rechargeCode != null">#{rechargeCode},</if>
<if test="status != null">#{status},</if>
<if test="deviceId != null">#{deviceId},</if>
<if test="serialNumber != null and serialNumber != ''">#{serialNumber},</if>
<if test="remark != null">#{remark},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
@ -103,7 +103,7 @@
<if test="rechargeTime != null">recharge_time = #{rechargeTime},</if>
<if test="rechargeCode != null">recharge_code = #{rechargeCode},</if>
<if test="status != null">status = #{status},</if>
<if test="deviceId != null">device_id = #{deviceId},</if>
<if test="serialNumber != null and serialNumber != ''">serial_number = #{serialNumber},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>

View File

@ -0,0 +1,71 @@
<?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.fastbee.rechargecard.mapper.NgWaterPumpUsageRecordsMapper">
<resultMap type="NgWaterPumpUsageRecords" id="NgWaterPumpUsageRecordsResult">
<result property="id" column="id" />
<result property="pumpStartTime" column="pump_start_time" />
<result property="pumpStopTime" column="pump_stop_time" />
<result property="deviceNumber" column="device_number" />
<result property="messageContent" column="message_content" />
</resultMap>
<sql id="selectNgWaterPumpUsageRecordsVo">
select id, pump_start_time, pump_stop_time, device_number, message_content from ng_water_pump_usage_records
</sql>
<select id="selectNgWaterPumpUsageRecordsList" parameterType="NgWaterPumpUsageRecords" resultMap="NgWaterPumpUsageRecordsResult">
<include refid="selectNgWaterPumpUsageRecordsVo"/>
<where>
<if test="pumpStartTime != null "> and pump_start_time = #{pumpStartTime}</if>
<if test="pumpStopTime != null "> and pump_stop_time = #{pumpStopTime}</if>
<if test="deviceNumber != null and deviceNumber != ''"> and device_number = #{deviceNumber}</if>
<if test="messageContent != null and messageContent != ''"> and message_content = #{messageContent}</if>
</where>
</select>
<select id="selectNgWaterPumpUsageRecordsById" parameterType="Long" resultMap="NgWaterPumpUsageRecordsResult">
<include refid="selectNgWaterPumpUsageRecordsVo"/>
where id = #{id}
</select>
<insert id="insertNgWaterPumpUsageRecords" parameterType="NgWaterPumpUsageRecords" useGeneratedKeys="true" keyProperty="id">
insert into ng_water_pump_usage_records
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="pumpStartTime != null">pump_start_time,</if>
<if test="pumpStopTime != null">pump_stop_time,</if>
<if test="deviceNumber != null and deviceNumber != ''">device_number,</if>
<if test="messageContent != null">message_content,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="pumpStartTime != null">#{pumpStartTime},</if>
<if test="pumpStopTime != null">#{pumpStopTime},</if>
<if test="deviceNumber != null and deviceNumber != ''">#{deviceNumber},</if>
<if test="messageContent != null">#{messageContent},</if>
</trim>
</insert>
<update id="updateNgWaterPumpUsageRecords" parameterType="NgWaterPumpUsageRecords">
update ng_water_pump_usage_records
<trim prefix="SET" suffixOverrides=",">
<if test="pumpStartTime != null">pump_start_time = #{pumpStartTime},</if>
<if test="pumpStopTime != null">pump_stop_time = #{pumpStopTime},</if>
<if test="deviceNumber != null and deviceNumber != ''">device_number = #{deviceNumber},</if>
<if test="messageContent != null">message_content = #{messageContent},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteNgWaterPumpUsageRecordsById" parameterType="Long">
delete from ng_water_pump_usage_records where id = #{id}
</delete>
<delete id="deleteNgWaterPumpUsageRecordsByIds" parameterType="String">
delete from ng_water_pump_usage_records where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>