Commit da293421 by 吕明尚

Merge branch 'dev' into test

parents 6bddadb9 c82abfbd
...@@ -215,4 +215,7 @@ dianping: ...@@ -215,4 +215,7 @@ dianping:
appKey: a59ea57cd1eb4737 appKey: a59ea57cd1eb4737
appSecret: 0caaabb7fda1c1be46636171548dcf510d1fb706 appSecret: 0caaabb7fda1c1be46636171548dcf510d1fb706
order: order:
allow-refund-time: 3600 allow-refund-time: 3600
\ No newline at end of file mqtt:
device-op-last-time: -5
device-gateway-last-report-time: -10
\ No newline at end of file
...@@ -213,4 +213,6 @@ dianping: ...@@ -213,4 +213,6 @@ dianping:
#订单 #订单
order: order:
allow-refund-time: 3600 allow-refund-time: 3600
mqtt:
device-op-last-time: -5
device-gateway-last-report-time: -10
...@@ -80,11 +80,11 @@ public class SRoom extends BaseEntity ...@@ -80,11 +80,11 @@ public class SRoom extends BaseEntity
@Excel(name = "其他可能硬件接入参数(备用2)") @Excel(name = "其他可能硬件接入参数(备用2)")
private String params2; private String params2;
// /** /**
// * 是否脏房 * 是否脏房
// */ */
// @Excel(name = "是否脏房(0:否,1:是)") @Excel(name = "是否脏房(0:否,1:是)")
// private Integer isDirtyRoom; private Integer isDirtyRoom;
/** /**
* 套餐ID * 套餐ID
......
...@@ -115,6 +115,12 @@ public class SRoomVo extends BaseEntity ...@@ -115,6 +115,12 @@ public class SRoomVo extends BaseEntity
private Long recordsId; private Long recordsId;
/** /**
* 是否脏房
*/
private Integer isDirtyRoom;
/**
* 订单时间 * 订单时间
*/ */
/** /**
......
...@@ -6,6 +6,7 @@ import java.util.List; ...@@ -6,6 +6,7 @@ import java.util.List;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Value;
import share.common.enums.DeviceStatusEnum; import share.common.enums.DeviceStatusEnum;
import share.common.utils.DateUtils; import share.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -26,6 +27,9 @@ public class DeviceGatewayServiceImpl extends ServiceImpl<DeviceGatewayMapper, D ...@@ -26,6 +27,9 @@ public class DeviceGatewayServiceImpl extends ServiceImpl<DeviceGatewayMapper, D
@Autowired @Autowired
private DeviceGatewayMapper deviceGatewayMapper; private DeviceGatewayMapper deviceGatewayMapper;
@Value("${mqtt.device-gateway-last-report-time}")
private Integer deviceGatewayLastReportTime;
/** /**
* 查询设备网关信息 * 查询设备网关信息
* *
...@@ -110,7 +114,7 @@ public class DeviceGatewayServiceImpl extends ServiceImpl<DeviceGatewayMapper, D ...@@ -110,7 +114,7 @@ public class DeviceGatewayServiceImpl extends ServiceImpl<DeviceGatewayMapper, D
list.stream().forEach(gateway -> { list.stream().forEach(gateway -> {
Date lastReportDate = gateway.getLastReportDate(); Date lastReportDate = gateway.getLastReportDate();
// 网关上报(最近10分钟内没有上报数据,网关设备离线) // 网关上报(最近10分钟内没有上报数据,网关设备离线)
Date startDate = DateUtil.offsetMinute(DateUtil.date(), -10); Date startDate = DateUtil.offsetMinute(DateUtil.date(), deviceGatewayLastReportTime);
if (lastReportDate != null && lastReportDate.compareTo(startDate) > 0) { if (lastReportDate != null && lastReportDate.compareTo(startDate) > 0) {
gateway.setStatus(DeviceStatusEnum.DEVICE_ONLINE.getCode()); gateway.setStatus(DeviceStatusEnum.DEVICE_ONLINE.getCode());
} else { } else {
......
...@@ -8,6 +8,7 @@ import cn.hutool.json.JSONObject; ...@@ -8,6 +8,7 @@ import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import share.common.constant.MqttConstants; import share.common.constant.MqttConstants;
import share.common.enums.*; import share.common.enums.*;
...@@ -48,6 +49,8 @@ public class MqttxServiceImpl implements MqttxService { ...@@ -48,6 +49,8 @@ public class MqttxServiceImpl implements MqttxService {
private DeviceLogMapper deviceLogMapper; private DeviceLogMapper deviceLogMapper;
@Autowired @Autowired
private DeviceStatusLogService deviceStatusLogService; private DeviceStatusLogService deviceStatusLogService;
@Value("${mqtt.device-op-last-time}")
private Integer deviceOpLastTime;
/** /**
* 清除网关锁id列表 * 清除网关锁id列表
...@@ -557,7 +560,7 @@ public class MqttxServiceImpl implements MqttxService { ...@@ -557,7 +560,7 @@ public class MqttxServiceImpl implements MqttxService {
Map<String, Device> map = deviceList.stream() Map<String, Device> map = deviceList.stream()
.collect(Collectors.toMap(Device::getDevId, Function.identity())); .collect(Collectors.toMap(Device::getDevId, Function.identity()));
// 设备操作日志(最近3分钟内的最新操作日志) // 设备操作日志(最近3分钟内的最新操作日志)
Date startDate = DateUtil.offsetMinute(DateUtil.date(), -5); Date startDate = DateUtil.offsetMinute(DateUtil.date(), deviceOpLastTime);
List<DeviceLog> deviceLogList = deviceLogMapper.selectListByMaxId(devIds, startDate); List<DeviceLog> deviceLogList = deviceLogMapper.selectListByMaxId(devIds, startDate);
// 将List转换为Map // 将List转换为Map
Map<String, DeviceLog> deviceLogMap = deviceLogList.stream() Map<String, DeviceLog> deviceLogMap = deviceLogList.stream()
......
...@@ -6,6 +6,7 @@ import java.util.stream.Collectors; ...@@ -6,6 +6,7 @@ import java.util.stream.Collectors;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import share.common.constant.Constants; import share.common.constant.Constants;
...@@ -46,6 +47,8 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC ...@@ -46,6 +47,8 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC
private ISOrderService orderService; private ISOrderService orderService;
@Autowired @Autowired
private SStoreConsumerMapper storeConsumerMapper; private SStoreConsumerMapper storeConsumerMapper;
@Autowired
private SConsumerMapper consumerMapper;
//管理员手机号 //管理员手机号
private static final String phone = "13888888888"; private static final String phone = "13888888888";
...@@ -312,8 +315,8 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC ...@@ -312,8 +315,8 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC
if (list.size() == 0) { if (list.size() == 0) {
return Boolean.FALSE; return Boolean.FALSE;
} }
//获取List的房间集合
List<Long> roomIds = list.stream().map(SCleanRecords::getRoomId).collect(Collectors.toList()); List<Long> roomIds = list.stream().map(SCleanRecords::getRoomId).collect(Collectors.toList());
//获取List的房间集合
LambdaQueryWrapper<SOrder> sOrderLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SOrder> sOrderLambdaQueryWrapper = new LambdaQueryWrapper<>();
sOrderLambdaQueryWrapper.eq(SOrder::getPayStatus, YesNoEnum.yes.getIndex()); sOrderLambdaQueryWrapper.eq(SOrder::getPayStatus, YesNoEnum.yes.getIndex());
sOrderLambdaQueryWrapper.in(SOrder::getRoomId, roomIds); sOrderLambdaQueryWrapper.in(SOrder::getRoomId, roomIds);
...@@ -321,25 +324,64 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC ...@@ -321,25 +324,64 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC
sOrderLambdaQueryWrapper.notIn(SOrder::getRefundStatus, RefundStatusEnum.getRefundedStatus()); sOrderLambdaQueryWrapper.notIn(SOrder::getRefundStatus, RefundStatusEnum.getRefundedStatus());
sOrderLambdaQueryWrapper.between(SOrder::getPreStartDate, now, DateUtil.offsetMinute(now, CLEANING)); sOrderLambdaQueryWrapper.between(SOrder::getPreStartDate, now, DateUtil.offsetMinute(now, CLEANING));
List<SOrder> orderList = orderService.list(sOrderLambdaQueryWrapper); List<SOrder> orderList = orderService.list(sOrderLambdaQueryWrapper);
//30分钟未完成保洁并且5分钟内有预约订单
if (CollectionUtils.isNotEmpty(orderList)) { if (CollectionUtils.isNotEmpty(orderList)) {
List<Long> orderRoomIds = orderList.stream().map(SOrder::getRoomId).collect(Collectors.toList()); List<Long> orderRoomIds = orderList.stream().map(SOrder::getRoomId).collect(Collectors.toList());
list = list.stream().filter(item -> orderRoomIds.contains(item.getRoomId())).collect(Collectors.toList()); list = list.stream().filter(item -> orderRoomIds.contains(item.getRoomId())).collect(Collectors.toList());
} //查询当前房间当前时间加5分钟有没有预约订单
//查询当前房间当前时间加5分钟有没有预约订单 for (SCleanRecords sCleanRecords : list) {
for (SCleanRecords sCleanRecords : list) { sCleanRecords.setStatus(2);
sCleanRecords.setStatus(2); sCleanRecords.setStartDate(now);
sCleanRecords.setStartDate(now); sCleanRecords.setEndDate(now);
sCleanRecords.setEndDate(now); sCleanRecords.setUpdateTime(now);
sCleanRecords.setUpdateTime(now);
// List<Long> unusedOrderRoomIds = Optional.ofNullable(orderList). // List<Long> unusedOrderRoomIds = Optional.ofNullable(orderList).
// orElse(new ArrayList<>()).stream().filter(order -> order.getStatus().equals(OrderStatusEnum.UNUSED.getCode())) // orElse(new ArrayList<>()).stream().filter(order -> order.getStatus().equals(OrderStatusEnum.UNUSED.getCode()))
// .map(SOrder::getRoomId).collect(Collectors.toList()); // .map(SOrder::getRoomId).collect(Collectors.toList());
// if (unusedOrderRoomIds.contains(sCleanRecords.getRoomId())) { // if (unusedOrderRoomIds.contains(sCleanRecords.getRoomId())) {
// deviceOpService.openOrCloseDevice(sCleanRecords.getRoomId(), phone, OpTypeEnum.CUT_ELECTRIC.getCode(), true, FIVE); // deviceOpService.openOrCloseDevice(sCleanRecords.getRoomId(), phone, OpTypeEnum.CUT_ELECTRIC.getCode(), true, FIVE);
// } // }
}
return 0 < baseMapper.updateBatch(list);
} else {
List<Long> roomIdList = list.stream().map(SCleanRecords::getRoomId).collect(Collectors.toList());
//查找改房间门店的保洁人员和管理员
List<SRoom> sRoomList = sRoomMapper.selectBatchIds(roomIdList);
//获取门店id,去重
List<Long> storeIds = sRoomList.stream().map(SRoom::getStoreId).distinct().collect(Collectors.toList());
List<SStore> sStoreList = sStoreMapper.selectBatchIds(storeIds);
//获取门店的保洁人员和管理员
List<SStoreConsumer> sStoreConsumers = storeConsumerMapper.selectList(new LambdaQueryWrapper<SStoreConsumer>().in(SStoreConsumer::getStoreId, storeIds));
List<SConsumer> sConsumers = consumerMapper.selectBatchIds(sStoreConsumers.stream().map(SStoreConsumer::getConsumerId).collect(Collectors.toList()));
List<Long> roomId = new ArrayList<>();
sStoreConsumers.stream().forEach(item -> {
//循环门店和店员的关系表
sStoreList.stream().forEach(store -> {
//循环门店
sRoomList.stream().forEach(room -> {
//循环房间
//判断当前房间是否是当前门店的房间,并且是未打扫的房间
if (item.getStoreId().equals(store.getId()) && room.getStoreId().equals(store.getId()) && room.getIsDirtyRoom().equals(YesNoEnum.no.getIndex())) {
//发送短信
sConsumers.stream().forEach(consumer -> {
if (consumer.getId().equals(item.getConsumerId())) {
roomId.add(room.getId());
smsService.sendSmsCleanRecords(consumer.getPhone(), store, room);
}
});
}
});
});
});
if (CollectionUtils.isEmpty(roomId)) {
return false;
}
//修改房间为脏房
UpdateWrapper<SRoom> updateWrapper = new UpdateWrapper<>();
updateWrapper.set("is_dirty_room", YesNoEnum.yes.getIndex());
updateWrapper.in("id", roomId);
sRoomMapper.update(null, updateWrapper);
return false;
} }
return 0 < baseMapper.updateBatch(list);
} }
@Override @Override
...@@ -408,7 +450,10 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC ...@@ -408,7 +450,10 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC
isCleaner(sCleanRecords); isCleaner(sCleanRecords);
sCleanRecords.setEndDate(DateUtil.date()); sCleanRecords.setEndDate(DateUtil.date());
sCleanRecords.setStatus(CleaningStatusEnum.CLEANED.getCode()); sCleanRecords.setStatus(CleaningStatusEnum.CLEANED.getCode());
SRoom sRoom = new SRoom();
sRoom.setIsDirtyRoom(YesNoEnum.no.getIndex());
sRoom.setId(sCleanRecords.getRoomId());
sRoomMapper.updateById(sRoom);
SCleanRecords records = baseMapper.selectSCleanRecordsById(sCleanRecords.getId()); SCleanRecords records = baseMapper.selectSCleanRecordsById(sCleanRecords.getId());
if (records == null) { if (records == null) {
throw new RuntimeException("当前保洁任务不存在!"); throw new RuntimeException("当前保洁任务不存在!");
......
...@@ -1095,6 +1095,9 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme ...@@ -1095,6 +1095,9 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
// 计算各种价格 // 计算各种价格
ComputedOrderPriceResponse priceResponse = new ComputedOrderPriceResponse(); ComputedOrderPriceResponse priceResponse = new ComputedOrderPriceResponse();
SRoom room = roomService.getById(request.getRoomId()); SRoom room = roomService.getById(request.getRoomId());
if (ObjectUtil.isNotEmpty(room) && room.getIsDirtyRoom().equals(YesNoEnum.yes.getIndex())) {
throw new BaseException("当前房间未保洁,请选择其他房间");
}
BigDecimal totalPrice = computeTotalPrice(room.getPrice(), request.getPreStartDate(), request.getPreEndDate()); BigDecimal totalPrice = computeTotalPrice(room.getPrice(), request.getPreStartDate(), request.getPreEndDate());
BigDecimal payPrice; BigDecimal payPrice;
BuyTypeEnum buyTypeEnum = BuyTypeEnum.getEnumByCode(request.getBuyType()); BuyTypeEnum buyTypeEnum = BuyTypeEnum.getEnumByCode(request.getBuyType());
......
...@@ -506,6 +506,7 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme ...@@ -506,6 +506,7 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
put("id", store.getId()); put("id", store.getId());
put("name", store.getName()); put("name", store.getName());
put("storeType", store.getStoreType()); put("storeType", store.getStoreType());
put("deviceGroup", store.getDeviceGroup());
}}; }};
return map; return map;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
......
...@@ -23,27 +23,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -23,27 +23,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectDeviceLogVo"> <sql id="selectDeviceLogVo">
select id, dev_mac, dev_id, seq, mqtt_type, mqtt_describe, payload, topic, create_by, create_time, select s1.id, s1.dev_mac, s1.dev_id, s1.seq, s1.mqtt_type, s1.mqtt_describe, s1.payload, s1.topic,
update_by, update_time, remark, `result`, description from s_device_log s1.create_by, s1.create_time,
s1.update_by, s1.update_time, s1.remark, s1.`result`, s1.description
from s_device_log s1
left join s_device s2 on s1.dev_id = s2.dev_id
left join s_room s3 on s2.room_id = s3.id
left join s_store s4 on s3.store_id = s4.id
</sql> </sql>
<select id="selectDeviceLogList" parameterType="DeviceLog" resultMap="DeviceLogResult"> <select id="selectDeviceLogList" parameterType="DeviceLog" resultMap="DeviceLogResult">
<include refid="selectDeviceLogVo"/> <include refid="selectDeviceLogVo"/>
<where> <where>
<if test="devMac != null and devMac != ''"> and dev_mac = #{devMac}</if> <if test="devMac != null and devMac != ''"> and s1.dev_mac = #{devMac}</if>
<if test="devId != null and devId != ''"> and dev_id = #{devId}</if> <if test="devId != null and devId != ''"> and s1.dev_id = #{devId}</if>
<if test="seq != null and seq != ''"> and seq = #{seq}</if> <if test="seq != null and seq != ''"> and s1.seq = #{seq}</if>
<if test="mqttType != null and mqttType != ''"> and mqtt_type = #{mqttType}</if> <if test="mqttType != null and mqttType != ''"> and s1.mqtt_type = #{mqttType}</if>
<if test="mqttDescribe != null and mqttDescribe != ''"> and mqtt_describe = #{mqttDescribe}</if> <if test="mqttDescribe != null and mqttDescribe != ''"> and s1.mqtt_describe = #{mqttDescribe}</if>
<if test="payload != null and payload != ''"> and payload = #{payload}</if> <if test="payload != null and payload != ''"> and s1.payload = #{payload}</if>
<if test="topic != null and topic != ''"> and topic = #{topic}</if> <if test="topic != null and topic != ''"> and s1.topic = #{topic}</if>
<if test="storeName != null and storeName != ''"> and s4.name like concat('%', #{storeName}, '%')</if>
<if test="roomName != null and roomName != ''"> and s3.name like concat('%', #{roomName}, '%')</if>
</where> </where>
order by create_time desc order by s1.create_time desc
</select> </select>
<select id="selectDeviceLogById" parameterType="Long" resultMap="DeviceLogResult"> <select id="selectDeviceLogById" parameterType="Long" resultMap="DeviceLogResult">
<include refid="selectDeviceLogVo"/> <include refid="selectDeviceLogVo"/>
where id = #{id} where s1.id = #{id}
</select> </select>
<select id="selectListByMaxId" resultMap="DeviceLogResult"> <select id="selectListByMaxId" resultMap="DeviceLogResult">
SELECT t1.id, t1.dev_mac, t1.dev_id, t1.seq, t1.mqtt_type, t1.mqtt_describe, t1.payload, t1.topic, SELECT t1.id, t1.dev_mac, t1.dev_id, t1.seq, t1.mqtt_type, t1.mqtt_describe, t1.payload, t1.topic,
......
...@@ -22,29 +22,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -22,29 +22,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectDeviceStatusLogVo"> <sql id="selectDeviceStatusLogVo">
select id, dev_id, dev_mac, is_abnormal, status, room_id, voltage, signal_value, create_time, update_time, select s1.id, s1.dev_id, s1.dev_mac, s1.is_abnormal, s1.status, s1.room_id, s1.voltage,
remark, operate_log_id, is_send_sms, previous_status from s_device_status_log s1.signal_value, s1.create_time, s1.update_time,
s1.remark, s1.operate_log_id, s1.is_send_sms, s1.previous_status
from s_device_status_log s1
left join s_device s2 on s1.dev_id = s2.dev_id
left join s_room s3 on s2.room_id = s3.id
left join s_store s4 on s3.store_id = s4.id
</sql> </sql>
<select id="selectDeviceStatusLogList" parameterType="DeviceStatusLog" resultMap="DeviceStatusLogResult"> <select id="selectDeviceStatusLogList" parameterType="DeviceStatusLog" resultMap="DeviceStatusLogResult">
<include refid="selectDeviceStatusLogVo"/> <include refid="selectDeviceStatusLogVo"/>
<where> <where>
<if test="devId != null and devId != ''"> and dev_id = #{devId}</if> <if test="devId != null and devId != ''"> and s1.dev_id = #{devId}</if>
<if test="devMac != null and devMac != ''"> and dev_mac = #{devMac}</if> <if test="devMac != null and devMac != ''"> and s1.dev_mac = #{devMac}</if>
<if test="isAbnormal != null "> and is_abnormal = #{isAbnormal}</if> <if test="isAbnormal != null "> and s1.is_abnormal = #{isAbnormal}</if>
<if test="status != null and status != ''"> and status = #{status}</if> <if test="status != null and status != ''"> and s1.status = #{status}</if>
<if test="roomId != null "> and room_id = #{roomId}</if> <if test="roomId != null "> and s1.room_id = #{roomId}</if>
<if test="voltage != null and voltage != ''"> and voltage = #{voltage}</if> <if test="voltage != null and voltage != ''"> and s1.voltage = #{voltage}</if>
<if test="signalValue != null and signalValue != ''"> and signal_value = #{signalValue}</if> <if test="signalValue != null and signalValue != ''"> and s1.signal_value = #{signalValue}</if>
<if test="operateLogId != null "> and operate_log_id = #{operateLogId}</if> <if test="operateLogId != null "> and s1.operate_log_id = #{operateLogId}</if>
<if test="isSendSms != null "> and is_send_sms = #{isSendSms}</if> <if test="isSendSms != null "> and s1.is_send_sms = #{isSendSms}</if>
<if test="storeName != null and storeName != ''"> and s4.name like concat('%', #{storeName}, '%')</if>
<if test="roomName != null and roomName != ''"> and s3.name like concat('%', #{roomName}, '%')</if>
</where> </where>
order by create_time desc order by s1.create_time desc
</select> </select>
<select id="selectDeviceStatusLogById" parameterType="Long" resultMap="DeviceStatusLogResult"> <select id="selectDeviceStatusLogById" parameterType="Long" resultMap="DeviceStatusLogResult">
<include refid="selectDeviceStatusLogVo"/> <include refid="selectDeviceStatusLogVo"/>
where id = #{id} where s1.id = #{id}
</select> </select>
<insert id="insertDeviceStatusLog" parameterType="DeviceStatusLog"> <insert id="insertDeviceStatusLog" parameterType="DeviceStatusLog">
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<result property="info" column="info" /> <result property="info" column="info" />
<result property="status" column="status" /> <result property="status" column="status" />
<result property="price" column="price" /> <result property="price" column="price" />
<!-- <result property="isDirtyRoom" column="is_dirty_room"/>--> <result property="isDirtyRoom" column="is_dirty_room"/>
<result property="doorLockCode" column="door_lock_code" /> <result property="doorLockCode" column="door_lock_code" />
<result property="electricControlCode" column="electric_control_code" /> <result property="electricControlCode" column="electric_control_code" />
<result property="password" column="password" /> <result property="password" column="password" />
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
info, info,
status, status,
price, price,
<!-- is_dirty_room,--> is_dirty_room,
door_lock_code, door_lock_code,
electric_control_code, electric_control_code,
password, password,
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
<if test="info != null and info != ''"> and info = #{info}</if> <if test="info != null and info != ''"> and info = #{info}</if>
<if test="status != null and status != '' or status ==0">and status = #{status}</if> <if test="status != null and status != '' or status ==0">and status = #{status}</if>
<if test="price != null "> and price = #{price}</if> <if test="price != null "> and price = #{price}</if>
<!-- <if test="isDirtyRoom != null ">and is_dirty_room = #{isDirtyRoom}</if>--> <if test="isDirtyRoom != null ">and is_dirty_room = #{isDirtyRoom}</if>
<if test="doorLockCode != null and doorLockCode != ''"> and door_lock_code = #{doorLockCode}</if> <if test="doorLockCode != null and doorLockCode != ''"> and door_lock_code = #{doorLockCode}</if>
<if test="electricControlCode != null and electricControlCode != ''"> and electric_control_code = #{electricControlCode}</if> <if test="electricControlCode != null and electricControlCode != ''"> and electric_control_code = #{electricControlCode}</if>
<if test="password != null and password != ''"> and password = #{password}</if> <if test="password != null and password != ''"> and password = #{password}</if>
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
<if test="info != null">info,</if> <if test="info != null">info,</if>
<if test="status != null">status,</if> <if test="status != null">status,</if>
<if test="price != null">price,</if> <if test="price != null">price,</if>
<!-- <if test="isDirtyRoom != null">is_dirty_room,</if> --> <if test="isDirtyRoom != null">is_dirty_room,</if>
<if test="doorLockCode != null">door_lock_code,</if> <if test="doorLockCode != null">door_lock_code,</if>
<if test="electricControlCode != null">electric_control_code,</if> <if test="electricControlCode != null">electric_control_code,</if>
<if test="password != null">password,</if> <if test="password != null">password,</if>
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
<if test="info != null">#{info},</if> <if test="info != null">#{info},</if>
<if test="status != null">#{status},</if> <if test="status != null">#{status},</if>
<if test="price != null">#{price},</if> <if test="price != null">#{price},</if>
<!-- <if test="isDirtyRoom != null">#{isDirtyRoom},</if> --> <if test="isDirtyRoom != null">#{isDirtyRoom},</if>
<if test="doorLockCode != null">#{doorLockCode},</if> <if test="doorLockCode != null">#{doorLockCode},</if>
<if test="electricControlCode != null">#{electricControlCode},</if> <if test="electricControlCode != null">#{electricControlCode},</if>
<if test="password != null">#{password},</if> <if test="password != null">#{password},</if>
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
<if test="info != null">info = #{info},</if> <if test="info != null">info = #{info},</if>
<if test="status != null">status = #{status},</if> <if test="status != null">status = #{status},</if>
<if test="price != null">price = #{price},</if> <if test="price != null">price = #{price},</if>
<!-- <if test="isDirtyRoom != null">is_dirty_room = #{isDirtyRoom},</if> --> <if test="isDirtyRoom != null">is_dirty_room = #{isDirtyRoom},</if>
<if test="doorLockCode != null">door_lock_code = #{doorLockCode},</if> <if test="doorLockCode != null">door_lock_code = #{doorLockCode},</if>
<if test="electricControlCode != null">electric_control_code = #{electricControlCode},</if> <if test="electricControlCode != null">electric_control_code = #{electricControlCode},</if>
<if test="password != null">password = #{password},</if> <if test="password != null">password = #{password},</if>
...@@ -149,7 +149,9 @@ ...@@ -149,7 +149,9 @@
</update> </update>
<delete id="deleteSRoomById" parameterType="Long"> <delete id="deleteSRoomById" parameterType="Long">
delete from s_room where id = #{id} delete
from s_room
where id = #{id}
</delete> </delete>
<delete id="deleteSRoomByIds" parameterType="String"> <delete id="deleteSRoomByIds" parameterType="String">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment