正在显示
10 个修改的文件
包含
245 行增加
和
200 行删除
| @@ -41,4 +41,6 @@ public interface LocationMapper { | @@ -41,4 +41,6 @@ public interface LocationMapper { | ||
| 41 | int editEeId(@Param(value = "name") String name, | 41 | int editEeId(@Param(value = "name") String name, | 
| 42 | @Param(value = "deviceId") String deviceId); | 42 | @Param(value = "deviceId") String deviceId); | 
| 43 | 43 | ||
| 44 | + String findRoomName(@Param(value = "eeId") String eeId); | ||
| 45 | + | ||
| 44 | } | 46 | } | 
| 1 | +package com.sunyo.energy.location.dao; | ||
| 2 | + | ||
| 3 | +import com.sunyo.energy.location.model.NoteForm; | ||
| 4 | +import org.apache.ibatis.annotations.Param; | ||
| 5 | + | ||
| 6 | +public interface NoteFormMapper { | ||
| 7 | + int deleteByPrimaryKey(Integer id); | ||
| 8 | + | ||
| 9 | + int insert(NoteForm record); | ||
| 10 | + | ||
| 11 | + int insertSelective(NoteForm record); | ||
| 12 | + | ||
| 13 | + int count(@Param("roomName") String roomName); | ||
| 14 | + | ||
| 15 | + NoteForm selectByPrimaryKey(Integer id); | ||
| 16 | + | ||
| 17 | + int updateByPrimaryKeySelective(NoteForm record); | ||
| 18 | + | ||
| 19 | + int updateByPrimaryKey(NoteForm record); | ||
| 20 | +} | 
| 1 | +package com.sunyo.energy.location.model; | ||
| 2 | + | ||
| 3 | +import java.util.Date; | ||
| 4 | + | ||
| 5 | +public class NoteForm { | ||
| 6 | + private Integer id; | ||
| 7 | + | ||
| 8 | + private String roomName; | ||
| 9 | + | ||
| 10 | + private String waterEleType; | ||
| 11 | + | ||
| 12 | + private String informMoney; | ||
| 13 | + | ||
| 14 | + private String informStatus; | ||
| 15 | + | ||
| 16 | + private String informPhone; | ||
| 17 | + | ||
| 18 | + private Date informDate; | ||
| 19 | + | ||
| 20 | + private String status; | ||
| 21 | + | ||
| 22 | + public Integer getId() { | ||
| 23 | + return id; | ||
| 24 | + } | ||
| 25 | + | ||
| 26 | + public void setId(Integer id) { | ||
| 27 | + this.id = id; | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + public String getRoomName() { | ||
| 31 | + return roomName; | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + public void setRoomName(String roomName) { | ||
| 35 | + this.roomName = roomName == null ? null : roomName.trim(); | ||
| 36 | + } | ||
| 37 | + | ||
| 38 | + public String getWaterEleType() { | ||
| 39 | + return waterEleType; | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + public void setWaterEleType(String waterEleType) { | ||
| 43 | + this.waterEleType = waterEleType == null ? null : waterEleType.trim(); | ||
| 44 | + } | ||
| 45 | + | ||
| 46 | + public String getInformMoney() { | ||
| 47 | + return informMoney; | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | + public void setInformMoney(String informMoney) { | ||
| 51 | + this.informMoney = informMoney == null ? null : informMoney.trim(); | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + public String getInformStatus() { | ||
| 55 | + return informStatus; | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | + public void setInformStatus(String informStatus) { | ||
| 59 | + this.informStatus = informStatus == null ? null : informStatus.trim(); | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + public String getInformPhone() { | ||
| 63 | + return informPhone; | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + public void setInformPhone(String informPhone) { | ||
| 67 | + this.informPhone = informPhone == null ? null : informPhone.trim(); | ||
| 68 | + } | ||
| 69 | + | ||
| 70 | + public Date getInformDate() { | ||
| 71 | + return informDate; | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + public void setInformDate(Date informDate) { | ||
| 75 | + this.informDate = informDate; | ||
| 76 | + } | ||
| 77 | + | ||
| 78 | + public String getStatus() { | ||
| 79 | + return status; | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + public void setStatus(String status) { | ||
| 83 | + this.status = status == null ? null : status.trim(); | ||
| 84 | + } | ||
| 85 | +} | 
| @@ -8,18 +8,7 @@ import java.io.UnsupportedEncodingException; | @@ -8,18 +8,7 @@ import java.io.UnsupportedEncodingException; | ||
| 8 | 8 | ||
| 9 | public interface WaterMeterService { | 9 | public interface WaterMeterService { | 
| 10 | 10 | ||
| 11 | - int realTime(); | ||
| 12 | - | ||
| 13 | - WaterMeter findRealTime(String wmId); | ||
| 14 | - | ||
| 15 | ResultJson payWater(String payFees, String wmId); | 11 | ResultJson payWater(String payFees, String wmId); | 
| 16 | 12 | ||
| 17 | - ResultJson waterMeterAll(String wmId); | ||
| 18 | - | ||
| 19 | - /** | ||
| 20 | - * 请求返回二维码 | ||
| 21 | - */ | ||
| 22 | - ResultJson qrCode(String payFees, String wmId, String userId, String realName, String eeId) throws UnsupportedEncodingException; | ||
| 23 | - | ||
| 24 | 13 | ||
| 25 | } | 14 | } | 
| @@ -37,6 +37,9 @@ public class ElectricityMeterServiceImp implements ElectricityMeterService { | @@ -37,6 +37,9 @@ public class ElectricityMeterServiceImp implements ElectricityMeterService { | ||
| 37 | @Autowired | 37 | @Autowired | 
| 38 | ElectrifyInfoMapper electrifyInfoMapper; | 38 | ElectrifyInfoMapper electrifyInfoMapper; | 
| 39 | 39 | ||
| 40 | + @Autowired | ||
| 41 | + NoteFormMapper noteFormMapper; | ||
| 42 | + | ||
| 40 | 43 | ||
| 41 | /** | 44 | /** | 
| 42 | * 获取电表实时数据/余额 | 45 | * 获取电表实时数据/余额 | 
| @@ -119,6 +122,20 @@ public class ElectricityMeterServiceImp implements ElectricityMeterService { | @@ -119,6 +122,20 @@ public class ElectricityMeterServiceImp implements ElectricityMeterService { | ||
| 119 | electrifyInfo1.setDeviceid(deviceId); | 122 | electrifyInfo1.setDeviceid(deviceId); | 
| 120 | electrifyInfoMapper.insertSelective(electrifyInfo1); | 123 | electrifyInfoMapper.insertSelective(electrifyInfo1); | 
| 121 | log.info("送电信息插入临时表-----------------------------------"); | 124 | log.info("送电信息插入临时表-----------------------------------"); | 
| 125 | + /** | ||
| 126 | + * 修改短信通知状态 | ||
| 127 | + */ | ||
| 128 | + ElectricityMeter energyInfoForRealTime = getEnergyInfoForRealTime(deviceId); | ||
| 129 | + if (energyInfoForRealTime.getBalance().compareTo(new BigDecimal(50)) == 1){ | ||
| 130 | + String roomName = locationMapper.findRoomName(deviceId); | ||
| 131 | + if (noteFormMapper.count(roomName) > 0){ | ||
| 132 | + NoteForm noteForm = new NoteForm(); | ||
| 133 | + noteForm.setInformStatus("1"); | ||
| 134 | + noteForm.setWaterEleType("2"); | ||
| 135 | + noteForm.setRoomName(roomName); | ||
| 136 | + noteFormMapper.updateByPrimaryKeySelective(noteForm); | ||
| 137 | + } | ||
| 138 | + } | ||
| 122 | return 1; | 139 | return 1; | 
| 123 | } else { | 140 | } else { | 
| 124 | log.info("电表充值失败,充值额度:{}", money); | 141 | log.info("电表充值失败,充值额度:{}", money); | 
| 1 | package com.sunyo.energy.location.service.imp; | 1 | package com.sunyo.energy.location.service.imp; | 
| 2 | 2 | ||
| 3 | import com.alibaba.fastjson.JSON; | 3 | import com.alibaba.fastjson.JSON; | 
| 4 | -import com.alibaba.fastjson.JSONArray; | ||
| 5 | import com.sunyo.energy.location.controller.response.ResultJson; | 4 | import com.sunyo.energy.location.controller.response.ResultJson; | 
| 6 | import com.sunyo.energy.location.dao.LocationMapper; | 5 | import com.sunyo.energy.location.dao.LocationMapper; | 
| 7 | import com.sunyo.energy.location.dao.PayRecordsMapper; | 6 | import com.sunyo.energy.location.dao.PayRecordsMapper; | 
| 8 | import com.sunyo.energy.location.dao.WaterMeterMapper; | 7 | import com.sunyo.energy.location.dao.WaterMeterMapper; | 
| 9 | import com.sunyo.energy.location.dao.WaterMeterSaccMapper; | 8 | import com.sunyo.energy.location.dao.WaterMeterSaccMapper; | 
| 10 | -import com.sunyo.energy.location.demopay.QrDemo; | ||
| 11 | -import com.sunyo.energy.location.model.PayRecords; | ||
| 12 | -import com.sunyo.energy.location.model.WaterMeter; | ||
| 13 | import com.sunyo.energy.location.model.WaterMeterSacc; | 9 | import com.sunyo.energy.location.model.WaterMeterSacc; | 
| 14 | import com.sunyo.energy.location.service.WaterMeterService; | 10 | import com.sunyo.energy.location.service.WaterMeterService; | 
| 15 | import com.sunyo.energy.location.utils.AllUtils; | 11 | import com.sunyo.energy.location.utils.AllUtils; | 
| 16 | import com.sunyo.energy.location.utils.HttpsUtils; | 12 | import com.sunyo.energy.location.utils.HttpsUtils; | 
| 17 | import org.springframework.beans.factory.annotation.Autowired; | 13 | import org.springframework.beans.factory.annotation.Autowired; | 
| 18 | -import org.springframework.scheduling.annotation.Scheduled; | ||
| 19 | import org.springframework.stereotype.Service; | 14 | import org.springframework.stereotype.Service; | 
| 20 | - | ||
| 21 | -import java.io.UnsupportedEncodingException; | ||
| 22 | import java.math.BigDecimal; | 15 | import java.math.BigDecimal; | 
| 23 | -import java.util.Date; | ||
| 24 | -import java.util.HashMap; | ||
| 25 | -import java.util.List; | ||
| 26 | -import java.util.Map; | 16 | +import java.util.*; | 
| 27 | 17 | ||
| 28 | 18 | ||
| 29 | @Service | 19 | @Service | 
| @@ -51,76 +41,6 @@ public class WaterMeterServiceImp implements WaterMeterService { | @@ -51,76 +41,6 @@ public class WaterMeterServiceImp implements WaterMeterService { | ||
| 51 | private static final String addUrl = "http://123.56.159.203:8023/nowwmrd/getSelectNowwmrdbyProjectID"; | 41 | private static final String addUrl = "http://123.56.159.203:8023/nowwmrd/getSelectNowwmrdbyProjectID"; | 
| 52 | 42 | ||
| 53 | 43 | ||
| 54 | - @Override | ||
| 55 | - @Scheduled(cron = "0 0 03 * * ?") | ||
| 56 | - public int realTime() { | ||
| 57 | - | ||
| 58 | - try { | ||
| 59 | - | ||
| 60 | - Map<String, Object> datas = new HashMap<>(); | ||
| 61 | - datas.put("ProjectID", "33-99-00-00-00-00-01"); | ||
| 62 | - // 远程调用 | ||
| 63 | - String s = HttpsUtils.httpRequest(addUrl, datas); | ||
| 64 | - JSONArray jsonArray = JSON.parseArray(s); | ||
| 65 | - for (Object jsonObject : jsonArray) { | ||
| 66 | - WaterMeter waterMeter = new WaterMeter(); | ||
| 67 | - Map<String, Object> map = (Map) jsonObject; | ||
| 68 | - if (!map.containsKey("state")) { | ||
| 69 | - waterMeter.setWmId(map.get("wm_id").toString()); | ||
| 70 | - waterMeter.setWmErrmessage(map.get("wm_errmessage").toString()); | ||
| 71 | - waterMeter.setWmFmstate(map.get("wm_fmstate").toString()); | ||
| 72 | - waterMeter.setWmSacc(map.get("wm_sacc").toString()); | ||
| 73 | - waterMeter.setWmLacc(map.get("wm_lacc").toString()); | ||
| 74 | - waterMeter.setWmRdtime(map.get("wm_rdtime").toString()); | ||
| 75 | - waterMeter.setWmSignalpower(map.get("wm_signalpower").toString()); | ||
| 76 | - waterMeter.setWmVoltage(map.get("wm_voltage").toString()); | ||
| 77 | - waterMeter.setCreattime(new Date()); | ||
| 78 | - waterMeter.setReamke1(map.get("wm_sacc").toString()); | ||
| 79 | - waterMeterMapper.insertSelective(waterMeter); | ||
| 80 | - } else { | ||
| 81 | - if ("0".equals(map.get("state").toString())) { | ||
| 82 | - return 1; | ||
| 83 | - } | ||
| 84 | - return 0; | ||
| 85 | - } | ||
| 86 | - } | ||
| 87 | - return 1; | ||
| 88 | - } catch (Exception e) { | ||
| 89 | - e.printStackTrace(); | ||
| 90 | - return 0; | ||
| 91 | - } | ||
| 92 | - } | ||
| 93 | - | ||
| 94 | - @Override | ||
| 95 | - public WaterMeter findRealTime(String wmId) { | ||
| 96 | - try { | ||
| 97 | - Map<String, Object> datas = new HashMap<>(); | ||
| 98 | - datas.put("MtId", wmId); | ||
| 99 | - | ||
| 100 | - String s = HttpsUtils.httpRequest(selectUrl, datas); | ||
| 101 | - JSONArray jsonArray = JSON.parseArray(s); | ||
| 102 | - WaterMeter waterMeter = new WaterMeter(); | ||
| 103 | - for (Object jsonObject : jsonArray) { | ||
| 104 | - | ||
| 105 | - Map<String, Object> map = (Map) jsonObject; | ||
| 106 | - if (!map.containsKey("state")) { | ||
| 107 | - waterMeter.setWmId(map.get("wm_id").toString()); | ||
| 108 | - waterMeter.setWmErrmessage(map.get("wm_errmessage").toString()); | ||
| 109 | - waterMeter.setWmFmstate(map.get("wm_fmstate").toString()); | ||
| 110 | - waterMeter.setWmSacc(map.get("wm_sacc").toString()); | ||
| 111 | - waterMeter.setWmLacc(map.get("wm_lacc").toString()); | ||
| 112 | - waterMeter.setWmRdtime(map.get("wm_rdtime").toString()); | ||
| 113 | - waterMeter.setWmSignalpower(map.get("wm_signalpower").toString()); | ||
| 114 | - waterMeter.setWmVoltage(map.get("wm_voltage").toString()); | ||
| 115 | - } | ||
| 116 | - } | ||
| 117 | - return waterMeter; | ||
| 118 | - } catch (Exception e) { | ||
| 119 | - e.printStackTrace(); | ||
| 120 | - return new WaterMeter(); | ||
| 121 | - } | ||
| 122 | - } | ||
| 123 | - | ||
| 124 | /** | 44 | /** | 
| 125 | * 水费充值 换算总水量 生成订单 | 45 | * 水费充值 换算总水量 生成订单 | 
| 126 | * | 46 | * | 
| @@ -163,66 +83,6 @@ public class WaterMeterServiceImp implements WaterMeterService { | @@ -163,66 +83,6 @@ public class WaterMeterServiceImp implements WaterMeterService { | ||
| 163 | } | 83 | } | 
| 164 | } | 84 | } | 
| 165 | 85 | ||
| 166 | - @Override | ||
| 167 | - public ResultJson waterMeterAll(String wmId) { | ||
| 168 | - ResultJson<Object> resultJson = new ResultJson<>(); | ||
| 169 | - try { | ||
| 170 | - | ||
| 171 | - List<WaterMeter> waterMeterList = waterMeterMapper.waterMeterAll(wmId); | ||
| 172 | - | ||
| 173 | - return new ResultJson("200", "success", waterMeterList); | ||
| 174 | - } catch (Exception e) { | ||
| 175 | - e.printStackTrace(); | ||
| 176 | - resultJson.setCode("203"); | ||
| 177 | - return resultJson; | ||
| 178 | - } | ||
| 179 | - } | ||
| 180 | - | ||
| 181 | - // 请求返回二维码 | ||
| 182 | - @Override | ||
| 183 | - public ResultJson qrCode(String payFees, String wmId, String userId, String realName, String eeId) throws UnsupportedEncodingException { | ||
| 184 | - ResultJson<Object> resultJson = new ResultJson<>(); | ||
| 185 | - // 成功生成水费订单 | ||
| 186 | - if (!"".equals(wmId)) { | ||
| 187 | - PayRecords payRecords = payRecords(payFees, wmId, userId, realName, ""); | ||
| 188 | - // 请求返回二维码lujing | ||
| 189 | - String url = QrDemo.orUrl(payRecords.getOrdernumber(), payFees); | ||
| 190 | - | ||
| 191 | - if (!"".equals(url)) { | ||
| 192 | - payRecords.setReamke2(url); | ||
| 193 | - // 返回map 包含订单号 二维码url | ||
| 194 | - Map<String, Object> map = new HashMap<>(); | ||
| 195 | - map.put("url", url); | ||
| 196 | - map.put("orderNumber", payRecords.getOrdernumber()); | ||
| 197 | - resultJson.setData(map); | ||
| 198 | - } | ||
| 199 | - int i = payRecordsMapper.insertSelective(payRecords); | ||
| 200 | - if (i > 0) { | ||
| 201 | - resultJson.setCode("200"); | ||
| 202 | - } | ||
| 203 | - } else { | ||
| 204 | - | ||
| 205 | - PayRecords payRecords = payRecords(payFees, "", userId, realName, eeId); | ||
| 206 | - // 请求返回二维码lujing | ||
| 207 | - String url = QrDemo.orUrl(payRecords.getOrdernumber(), payFees); | ||
| 208 | - | ||
| 209 | - if (!"".equals(url)) { | ||
| 210 | - payRecords.setReamke2(url); | ||
| 211 | - // 返回map 包含订单号 二维码url | ||
| 212 | - Map<String, Object> map = new HashMap<>(); | ||
| 213 | - map.put("url", url); | ||
| 214 | - map.put("orderNumber", payRecords.getOrdernumber()); | ||
| 215 | - resultJson.setData(map); | ||
| 216 | - } | ||
| 217 | - int i = payRecordsMapper.insertSelective(payRecords); | ||
| 218 | - if (i > 0) { | ||
| 219 | - resultJson.setCode("200"); | ||
| 220 | - } | ||
| 221 | - } | ||
| 222 | - | ||
| 223 | - return resultJson; | ||
| 224 | - } | ||
| 225 | - | ||
| 226 | /** | 86 | /** | 
| 227 | * 总水量 换算 | 87 | * 总水量 换算 | 
| 228 | * | 88 | * | 
| @@ -250,40 +110,4 @@ public class WaterMeterServiceImp implements WaterMeterService { | @@ -250,40 +110,4 @@ public class WaterMeterServiceImp implements WaterMeterService { | ||
| 250 | 110 | ||
| 251 | return datas; | 111 | return datas; | 
| 252 | } | 112 | } | 
| 253 | - | ||
| 254 | - /** | ||
| 255 | - * 订单生成 | ||
| 256 | - * | ||
| 257 | - * @param payFees | ||
| 258 | - * @param wmId | ||
| 259 | - * @param userId | ||
| 260 | - * @param realName | ||
| 261 | - * @return | ||
| 262 | - */ | ||
| 263 | - public PayRecords payRecords(String payFees, String wmId, String userId, String realName, String eeId) { | ||
| 264 | - | ||
| 265 | - PayRecords payRecords = new PayRecords(); | ||
| 266 | - payRecords.setOrdernumber(AllUtils.getOrderIdByTime()); | ||
| 267 | - payRecords.setPayfees(new BigDecimal(payFees)); | ||
| 268 | - payRecords.setPaystatus(false); | ||
| 269 | - if (!"".equals(wmId)) { | ||
| 270 | - payRecords.setPaytype(false); | ||
| 271 | - payRecords.setPaytypeaddress(wmId); | ||
| 272 | - String roomNumber = locationMapper.selectRoomNumber(wmId); | ||
| 273 | - payRecords.setPaylocationname(roomNumber); | ||
| 274 | - } else { | ||
| 275 | - payRecords.setPaytype(true); | ||
| 276 | - payRecords.setPaytypeaddress(eeId); | ||
| 277 | - String roomNumber = locationMapper.selectRoomNumberElectricity(eeId); | ||
| 278 | - payRecords.setPaylocationname(roomNumber); | ||
| 279 | - } | ||
| 280 | - payRecords.setReamke1("0"); | ||
| 281 | - payRecords.setPayuserid(Integer.valueOf(userId)); | ||
| 282 | - payRecords.setPaytime(new Date()); | ||
| 283 | - payRecords.setPayusername(realName); | ||
| 284 | - | ||
| 285 | - | ||
| 286 | - return payRecords; | ||
| 287 | - } | ||
| 288 | - | ||
| 289 | } | 113 | } | 
| @@ -43,18 +43,6 @@ public class AllUtils { | @@ -43,18 +43,6 @@ public class AllUtils { | ||
| 43 | } | 43 | } | 
| 44 | 44 | ||
| 45 | 45 | ||
| 46 | - // 订单号生成 时间加随机数 | ||
| 47 | - public static String getOrderIdByTime() { | ||
| 48 | - // 商户码 | ||
| 49 | - String merchantId = "105001453995827"; | ||
| 50 | - String result = ""; | ||
| 51 | - Random random = new Random(); | ||
| 52 | - for (int i = 0; i < 3; i++) { | ||
| 53 | - result += random.nextInt(10); | ||
| 54 | - } | ||
| 55 | - return merchantId + result; | ||
| 56 | - } | ||
| 57 | - | ||
| 58 | /** | 46 | /** | 
| 59 | * 处理水表编号加 '-' 问题 | 47 | * 处理水表编号加 '-' 问题 | 
| 60 | * @param replace 水表编号 | 48 | * @param replace 水表编号 | 
| @@ -30,6 +30,10 @@ | @@ -30,6 +30,10 @@ | ||
| 30 | <!--</if>--> | 30 | <!--</if>--> | 
| 31 | </select> | 31 | </select> | 
| 32 | 32 | ||
| 33 | + <select id="findRoomName" parameterType="string" resultType="string"> | ||
| 34 | + select adrName from location where ee_id=#{eeId, jdbcType=VARCHAR} | ||
| 35 | + </select> | ||
| 36 | + | ||
| 33 | <select id="selectAllAdrName" resultMap="BaseResultMap" parameterType="java.lang.String"> | 37 | <select id="selectAllAdrName" resultMap="BaseResultMap" parameterType="java.lang.String"> | 
| 34 | select | 38 | select | 
| 35 | * | 39 | * | 
| 1 | +<?xml version="1.0" encoding="UTF-8" ?> | ||
| 2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > | ||
| 3 | +<mapper namespace="com.sunyo.energy.location.dao.NoteFormMapper" > | ||
| 4 | + <resultMap id="BaseResultMap" type="com.sunyo.energy.location.model.NoteForm" > | ||
| 5 | + <id column="id" property="id" jdbcType="INTEGER" /> | ||
| 6 | + <result column="room_name" property="roomName" jdbcType="VARCHAR" /> | ||
| 7 | + <result column="water_ele_type" property="waterEleType" jdbcType="VARCHAR" /> | ||
| 8 | + <result column="inform_money" property="informMoney" jdbcType="VARCHAR" /> | ||
| 9 | + <result column="inform_status" property="informStatus" jdbcType="VARCHAR" /> | ||
| 10 | + <result column="inform_phone" property="informPhone" jdbcType="VARCHAR" /> | ||
| 11 | + <result column="inform_date" property="informDate" jdbcType="TIMESTAMP" /> | ||
| 12 | + <result column="status" property="status" jdbcType="VARCHAR" /> | ||
| 13 | + </resultMap> | ||
| 14 | + <sql id="Base_Column_List" > | ||
| 15 | + id, room_name, water_ele_type, inform_money, inform_status, inform_phone, inform_date, | ||
| 16 | + status | ||
| 17 | + </sql> | ||
| 18 | + <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" > | ||
| 19 | + select | ||
| 20 | + <include refid="Base_Column_List" /> | ||
| 21 | + from note_inform | ||
| 22 | + where id = #{id,jdbcType=INTEGER} | ||
| 23 | + </select> | ||
| 24 | + | ||
| 25 | + <select id="count" resultType="int" parameterType="string"> | ||
| 26 | + select count(*) from note_form where room_name = #{roomName,jdbcType=VARCHAR } | ||
| 27 | + </select> | ||
| 28 | + <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" > | ||
| 29 | + delete from note_inform | ||
| 30 | + where id = #{id,jdbcType=INTEGER} | ||
| 31 | + </delete> | ||
| 32 | + <insert id="insert" parameterType="com.sunyo.energy.location.model.NoteForm" > | ||
| 33 | + insert into note_inform (id, room_name, water_ele_type, | ||
| 34 | + inform_money, inform_status, inform_phone, | ||
| 35 | + inform_date, status) | ||
| 36 | + values (#{id,jdbcType=INTEGER}, #{roomName,jdbcType=VARCHAR}, #{waterEleType,jdbcType=VARCHAR}, | ||
| 37 | + #{informMoney,jdbcType=VARCHAR}, #{informStatus,jdbcType=VARCHAR}, #{informPhone,jdbcType=VARCHAR}, | ||
| 38 | + #{informDate,jdbcType=TIMESTAMP}, #{status,jdbcType=VARCHAR}) | ||
| 39 | + </insert> | ||
| 40 | + <insert id="insertSelective" parameterType="com.sunyo.energy.location.model.NoteForm" > | ||
| 41 | + insert into note_inform | ||
| 42 | + <trim prefix="(" suffix=")" suffixOverrides="," > | ||
| 43 | + <if test="id != null" > | ||
| 44 | + id, | ||
| 45 | + </if> | ||
| 46 | + <if test="roomName != null" > | ||
| 47 | + room_name, | ||
| 48 | + </if> | ||
| 49 | + <if test="waterEleType != null" > | ||
| 50 | + water_ele_type, | ||
| 51 | + </if> | ||
| 52 | + <if test="informMoney != null" > | ||
| 53 | + inform_money, | ||
| 54 | + </if> | ||
| 55 | + <if test="informStatus != null" > | ||
| 56 | + inform_status, | ||
| 57 | + </if> | ||
| 58 | + <if test="informPhone != null" > | ||
| 59 | + inform_phone, | ||
| 60 | + </if> | ||
| 61 | + <if test="informDate != null" > | ||
| 62 | + inform_date, | ||
| 63 | + </if> | ||
| 64 | + <if test="status != null" > | ||
| 65 | + status, | ||
| 66 | + </if> | ||
| 67 | + </trim> | ||
| 68 | + <trim prefix="values (" suffix=")" suffixOverrides="," > | ||
| 69 | + <if test="id != null" > | ||
| 70 | + #{id,jdbcType=INTEGER}, | ||
| 71 | + </if> | ||
| 72 | + <if test="roomName != null" > | ||
| 73 | + #{roomName,jdbcType=VARCHAR}, | ||
| 74 | + </if> | ||
| 75 | + <if test="waterEleType != null" > | ||
| 76 | + #{waterEleType,jdbcType=VARCHAR}, | ||
| 77 | + </if> | ||
| 78 | + <if test="informMoney != null" > | ||
| 79 | + #{informMoney,jdbcType=VARCHAR}, | ||
| 80 | + </if> | ||
| 81 | + <if test="informStatus != null" > | ||
| 82 | + #{informStatus,jdbcType=VARCHAR}, | ||
| 83 | + </if> | ||
| 84 | + <if test="informPhone != null" > | ||
| 85 | + #{informPhone,jdbcType=VARCHAR}, | ||
| 86 | + </if> | ||
| 87 | + <if test="informDate != null" > | ||
| 88 | + #{informDate,jdbcType=TIMESTAMP}, | ||
| 89 | + </if> | ||
| 90 | + <if test="status != null" > | ||
| 91 | + #{status,jdbcType=VARCHAR}, | ||
| 92 | + </if> | ||
| 93 | + </trim> | ||
| 94 | + </insert> | ||
| 95 | + <update id="updateByPrimaryKeySelective" parameterType="com.sunyo.energy.location.model.NoteForm" > | ||
| 96 | + update note_inform | ||
| 97 | + <set > | ||
| 98 | + <if test="informStatus != null" > | ||
| 99 | + inform_status = #{informStatus,jdbcType=VARCHAR}, | ||
| 100 | + </if> | ||
| 101 | + </set> | ||
| 102 | + where room_name = #{roomName,jdbcType=INTEGER} | ||
| 103 | + and water_ele_type = #{waterEleType,jdbcType=VARCHAR} | ||
| 104 | + </update> | ||
| 105 | + <update id="updateByPrimaryKey" parameterType="com.sunyo.energy.location.model.NoteForm" > | ||
| 106 | + update note_inform | ||
| 107 | + set room_name = #{roomName,jdbcType=VARCHAR}, | ||
| 108 | + water_ele_type = #{waterEleType,jdbcType=VARCHAR}, | ||
| 109 | + inform_money = #{informMoney,jdbcType=VARCHAR}, | ||
| 110 | + inform_status = #{informStatus,jdbcType=VARCHAR}, | ||
| 111 | + inform_phone = #{informPhone,jdbcType=VARCHAR}, | ||
| 112 | + inform_date = #{informDate,jdbcType=TIMESTAMP}, | ||
| 113 | + status = #{status,jdbcType=VARCHAR} | ||
| 114 | + where id = #{id,jdbcType=INTEGER} | ||
| 115 | + </update> | ||
| 116 | +</mapper> | 
- 
请 注册 或 登录 后发表评论