作者 shenhailong

订单 水表实施信息查询 电表参数配置

package com.sunyo.energy.location.controller;
import com.github.pagehelper.PageInfo;
import com.sunyo.energy.location.controller.response.ResultJson;
import com.sunyo.energy.location.model.PayRecords;
import com.sunyo.energy.location.service.PayOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* Created by XYH on 2019/12/16.
* 订单查询,新增,更新,删除
*/
@Api(description = "订单管理")
@RestController
@RequestMapping("/order")
public class PayOrderController {
@Autowired
PayOrderService payOrderService;
@ApiOperation(value = "查询缴费订单")
@RequestMapping("/list")
public ResultJson<PageInfo> getOrder(){
return new ResultJson("200","wokao");
}
@ApiOperation(value = "新增缴费订单")
@PostMapping("/add")
public ResultJson addOrder(@RequestBody PayRecords records){
int mgs=0;
int result=payOrderService.addOrder(records);
if(result>0){
mgs=1;
}
return mgs==1?new ResultJson("200","新增订单成功"):new ResultJson("500","新增订单失败");
}
@ApiOperation(value = "更新缴费订单")
@PutMapping("/edi")
public ResultJson ediOrder(@RequestBody PayRecords records){
int mgs=0;
int result=payOrderService.ediOrder(records);
if(result>0){
mgs=1;
}
return mgs==1? new ResultJson("200","订单信息更新成功"):new ResultJson("500","订单信息更新失败");
}
@ApiOperation(value = "删除缴费订单")
@DeleteMapping("/del")
public ResultJson delOrder(@RequestBody PayRecords payRecords){
int mgs=0;
int result=payOrderService.delOrder(payRecords);
if(result>0){
mgs=1;
}
return mgs==1? new ResultJson("200","订单信息删除成功"):new ResultJson("500","订单信息删除失败");
}
}
... ...
package com.sunyo.energy.location.controller;
import com.sunyo.energy.location.controller.response.ResultJson;
import com.sunyo.energy.location.model.WaterElectricityParameter;
import com.sunyo.energy.location.service.WaterElectricityParameterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.Date;
@RequestMapping("/electricity_meter")
@Controller
public class WaterElectricityParameterController {
@Autowired
private WaterElectricityParameterService waterElectricityParameterService;
/**
* 电表参数配置
*
*/
@RequestMapping("/add")
@ResponseBody
public ResultJson eetParam(ResultJson resultJson, WaterElectricityParameter waterElectricityParameter){
try {
if (waterElectricityParameterService.countOne(waterElectricityParameter.getEeId())>0){
resultJson.setCode("200");
return resultJson;
}else {
int i = waterElectricityParameterService.insertSelective(waterElectricityParameter);
if (i>0){
resultJson.setCode("200");
resultJson.setMsg("添加成功");
return resultJson;
}else {
resultJson.setCode("500");
resultJson.setMsg("网络异常");
return resultJson;
}
}
}catch (Exception e){
e.printStackTrace();
resultJson.setCode("500");
resultJson.setMsg("网络异常");
return resultJson;
}
}
/**
* 电表参数查询
*/
@RequestMapping("/getEEModel")
@ResponseBody
public WaterElectricityParameter getEEModel(@RequestParam(value = "eeId", required = false) String eeId){
WaterElectricityParameter oneElectricity = waterElectricityParameterService.findOneElectricity(eeId);
System.out.println("111");
return oneElectricity;
}
/**
* 电表参数编辑
*/
@RequestMapping("/edit")
@ResponseBody
public ResultJson edit(ResultJson resultJson, WaterElectricityParameter waterElectricityParameter){
try {
if (waterElectricityParameterService.updateByPrimaryKeySelective(waterElectricityParameter)>0){
resultJson.setCode("200");
return resultJson;
}else {
resultJson.setCode("500");
resultJson.setMsg("网络异常");
return resultJson;
}
}catch (Exception e){
e.printStackTrace();
resultJson.setCode("500");
resultJson.setMsg("网络异常");
return resultJson;
}
}
}
... ...
package com.sunyo.energy.location.controller;
import com.sunyo.energy.location.controller.response.ResultJson;
import com.sunyo.energy.location.model.WaterElectricityParameter;
import com.sunyo.energy.location.model.WaterMeter;
import com.sunyo.energy.location.service.WaterMeterService;
import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -45,5 +46,5 @@ public class WaterMeterController {
return waterMeterService.findRealTime(wmId);
}
}
... ...
package com.sunyo.energy.location.dao;
import com.sunyo.energy.location.model.PayRecords;
public interface PayRecordsMapper {
int deleteByPrimaryKey(Integer id);
int insert(PayRecords record);
int insertSelective(PayRecords record);
PayRecords selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(PayRecords record);
int updateByPrimaryKey(PayRecords record);
}
\ No newline at end of file
... ...
... ... @@ -14,4 +14,8 @@ public interface WaterElectricityParameterMapper {
int updateByPrimaryKeySelective(WaterElectricityParameter record);
int updateByPrimaryKey(WaterElectricityParameter record);
int countOne(String eeId);
WaterElectricityParameter findOneElectricity(String eeId);
}
\ No newline at end of file
... ...
package com.sunyo.energy.location.model;
import java.util.Date;
public class PayRecords {
private Integer id;
private Long payfees;
private Integer payuserid;
private Date paytime;
private Integer paylocationid;
private Boolean paystatus;
private Boolean paytype;
private Boolean payfesstype;
private String ordernumber;
private String reamke1;
private String reamke2;
private String reamke3;
private String reamke4;
private String payusername;
private String paylocationname;
private String paytypeaddress;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Long getPayfees() {
return payfees;
}
public void setPayfees(Long payfees) {
this.payfees = payfees;
}
public Integer getPayuserid() {
return payuserid;
}
public void setPayuserid(Integer payuserid) {
this.payuserid = payuserid;
}
public Date getPaytime() {
return paytime;
}
public void setPaytime(Date paytime) {
this.paytime = paytime;
}
public Integer getPaylocationid() {
return paylocationid;
}
public void setPaylocationid(Integer paylocationid) {
this.paylocationid = paylocationid;
}
public Boolean getPaystatus() {
return paystatus;
}
public void setPaystatus(Boolean paystatus) {
this.paystatus = paystatus;
}
public Boolean getPaytype() {
return paytype;
}
public void setPaytype(Boolean paytype) {
this.paytype = paytype;
}
public Boolean getPayfesstype() {
return payfesstype;
}
public void setPayfesstype(Boolean payfesstype) {
this.payfesstype = payfesstype;
}
public String getOrdernumber() {
return ordernumber;
}
public void setOrdernumber(String ordernumber) {
this.ordernumber = ordernumber == null ? null : ordernumber.trim();
}
public String getReamke1() {
return reamke1;
}
public void setReamke1(String reamke1) {
this.reamke1 = reamke1 == null ? null : reamke1.trim();
}
public String getReamke2() {
return reamke2;
}
public void setReamke2(String reamke2) {
this.reamke2 = reamke2 == null ? null : reamke2.trim();
}
public String getReamke3() {
return reamke3;
}
public void setReamke3(String reamke3) {
this.reamke3 = reamke3 == null ? null : reamke3.trim();
}
public String getReamke4() {
return reamke4;
}
public void setReamke4(String reamke4) {
this.reamke4 = reamke4 == null ? null : reamke4.trim();
}
public String getPayusername() {
return payusername;
}
public void setPayusername(String payusername) {
this.payusername = payusername == null ? null : payusername.trim();
}
public String getPaylocationname() {
return paylocationname;
}
public void setPaylocationname(String paylocationname) {
this.paylocationname = paylocationname == null ? null : paylocationname.trim();
}
public String getPaytypeaddress() {
return paytypeaddress;
}
public void setPaytypeaddress(String paytypeaddress) {
this.paytypeaddress = paytypeaddress == null ? null : paytypeaddress.trim();
}
}
\ No newline at end of file
... ...
... ... @@ -15,7 +15,7 @@ public class WaterElectricityParameter {
private Long overdraftthreshold;
private Boolean load;
private Boolean waterload;
private Long water;
... ... @@ -87,12 +87,12 @@ public class WaterElectricityParameter {
this.overdraftthreshold = overdraftthreshold;
}
public Boolean getLoad() {
return load;
public Boolean getWaterload() {
return waterload;
}
public void setLoad(Boolean load) {
this.load = load;
public void setWaterload(Boolean waterload) {
this.waterload = waterload;
}
public Long getWater() {
... ...
package com.sunyo.energy.location.service;
import com.github.pagehelper.PageInfo;
import com.sunyo.energy.location.model.PayRecords;
/**
* Created by XYH on 2019/12/16.
*/
public interface PayOrderService {
PageInfo<PayRecords> getOrder(PayRecords payRecords, int currentPage, int pageSize);
int addOrder(PayRecords payRecords);
int ediOrder(PayRecords payRecords);
int delOrder(PayRecords payRecords);
}
... ...
package com.sunyo.energy.location.service;
import com.sunyo.energy.location.model.WaterElectricityParameter;
public interface WaterElectricityParameterService {
int insertSelective(WaterElectricityParameter record);
int updateByPrimaryKeySelective(WaterElectricityParameter record);
int countOne(String eeId);
WaterElectricityParameter findOneElectricity(String eeId);
}
... ...
package com.sunyo.energy.location.service.imp;
import com.github.pagehelper.PageInfo;
import com.sunyo.energy.location.dao.PayRecordsMapper;
import com.sunyo.energy.location.model.PayRecords;
import com.sunyo.energy.location.service.PayOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* Created by XYH on 2019/12/16.
*/
@Service
public class PayOrderImpl implements PayOrderService {
@Autowired
PayRecordsMapper recordsMapper;
@Override
public PageInfo<PayRecords> getOrder(PayRecords payRecords, int currentPage, int pageSize) {
return null;
}
@Override
public int addOrder(PayRecords payRecords) {
return recordsMapper.insert(payRecords);
}
@Override
public int ediOrder(PayRecords payRecords) {
return recordsMapper.updateByPrimaryKey(payRecords);
}
@Override
public int delOrder(PayRecords payRecords) {
return recordsMapper.deleteByPrimaryKey(payRecords.getId());
}
}
... ...
package com.sunyo.energy.location.service.imp;
import com.sunyo.energy.location.controller.response.ResultJson;
import com.sunyo.energy.location.dao.WaterElectricityParameterMapper;
import com.sunyo.energy.location.model.WaterElectricityParameter;
import com.sunyo.energy.location.service.WaterElectricityParameterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
@Service
public class WaterElectricityParameterServiceImp implements WaterElectricityParameterService {
@Autowired
private WaterElectricityParameterMapper waterElectricityParameterMapper;
@Override
public int insertSelective(WaterElectricityParameter record) {
record.setCreattime(new Date());
return waterElectricityParameterMapper.insertSelective(record);
}
@Override
public int updateByPrimaryKeySelective(WaterElectricityParameter record) {
return waterElectricityParameterMapper.updateByPrimaryKeySelective(record);
}
@Override
public int countOne(String eeId) {
return waterElectricityParameterMapper.countOne(eeId);
}
@Override
public WaterElectricityParameter findOneElectricity(String eeId) {
try {
return waterElectricityParameterMapper.findOneElectricity(eeId);
}catch (Exception e){
return null;
}
}
}
... ...
<?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.sunyo.energy.location.dao.LocationMapper" >
<resultMap id="BaseResultMap" type="com.sunyo.energy.location.model.Location" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="adrName" property="adrname" jdbcType="VARCHAR" />
<result column="parent" property="parent" jdbcType="INTEGER" />
<result column="type" property="type" jdbcType="INTEGER" />
<collection property="children" select="selectAll" column="id"></collection>
</resultMap>
<sql id="Base_Column_List" >
id, adrName, parent, type
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from location
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectAll" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
*
from location
where parent = #{parent,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from location
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.sunyo.energy.location.model.Location" >
insert into location (id, adrName, parent,
type)
values (#{id,jdbcType=INTEGER}, #{adrname,jdbcType=VARCHAR}, #{parent,jdbcType=INTEGER},
#{type,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.sunyo.energy.location.model.Location" >
insert into location
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="adrname != null" >
adrName,
</if>
<if test="parent != null" >
parent,
</if>
<if test="type != null" >
type,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="adrname != null" >
#{adrname,jdbcType=VARCHAR},
</if>
<if test="parent != null" >
#{parent,jdbcType=INTEGER},
</if>
<if test="type != null" >
#{type,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sunyo.energy.location.model.Location" >
update location
<set >
<if test="adrname != null" >
adrName = #{adrname,jdbcType=VARCHAR},
</if>
<if test="parent != null" >
parent = #{parent,jdbcType=INTEGER},
</if>
<if test="type != null" >
type = #{type,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.sunyo.energy.location.model.Location" >
update location
set adrName = #{adrname,jdbcType=VARCHAR},
parent = #{parent,jdbcType=INTEGER},
type = #{type,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.sunyo.energy.location.dao.PayRecordsMapper" >
<resultMap id="BaseResultMap" type="com.sunyo.energy.location.model.PayRecords" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="payFees" property="payfees" jdbcType="DECIMAL" />
<result column="payUserId" property="payuserid" jdbcType="INTEGER" />
<result column="payTime" property="paytime" jdbcType="TIMESTAMP" />
<result column="payLocationId" property="paylocationid" jdbcType="INTEGER" />
<result column="payStatus" property="paystatus" jdbcType="BIT" />
<result column="payType" property="paytype" jdbcType="BIT" />
<result column="payFessType" property="payfesstype" jdbcType="BIT" />
<result column="orderNumber" property="ordernumber" jdbcType="VARCHAR" />
<result column="reamke1" property="reamke1" jdbcType="VARCHAR" />
<result column="reamke2" property="reamke2" jdbcType="VARCHAR" />
<result column="reamke3" property="reamke3" jdbcType="VARCHAR" />
<result column="reamke4" property="reamke4" jdbcType="VARCHAR" />
<result column="payUserName" property="payusername" jdbcType="VARCHAR" />
<result column="payLocationName" property="paylocationname" jdbcType="VARCHAR" />
<result column="payTypeAddress" property="paytypeaddress" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
id, payFees, payUserId, payTime, payLocationId, payStatus, payType, payFessType,
orderNumber, reamke1, reamke2, reamke3, reamke4, payUserName, payLocationName, payTypeAddress
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from pay_records
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from pay_records
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.sunyo.energy.location.model.PayRecords" >
insert into pay_records (id, payFees, payUserId,
payTime, payLocationId, payStatus,
payType, payFessType, orderNumber,
reamke1, reamke2, reamke3,
reamke4, payUserName, payLocationName,
payTypeAddress)
values (#{id,jdbcType=INTEGER}, #{payfees,jdbcType=DECIMAL}, #{payuserid,jdbcType=INTEGER},
#{paytime,jdbcType=TIMESTAMP}, #{paylocationid,jdbcType=INTEGER}, #{paystatus,jdbcType=BIT},
#{paytype,jdbcType=BIT}, #{payfesstype,jdbcType=BIT}, #{ordernumber,jdbcType=VARCHAR},
#{reamke1,jdbcType=VARCHAR}, #{reamke2,jdbcType=VARCHAR}, #{reamke3,jdbcType=VARCHAR},
#{reamke4,jdbcType=VARCHAR}, #{payusername,jdbcType=VARCHAR}, #{paylocationname,jdbcType=VARCHAR},
#{paytypeaddress,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.sunyo.energy.location.model.PayRecords" >
insert into pay_records
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="payfees != null" >
payFees,
</if>
<if test="payuserid != null" >
payUserId,
</if>
<if test="paytime != null" >
payTime,
</if>
<if test="paylocationid != null" >
payLocationId,
</if>
<if test="paystatus != null" >
payStatus,
</if>
<if test="paytype != null" >
payType,
</if>
<if test="payfesstype != null" >
payFessType,
</if>
<if test="ordernumber != null" >
orderNumber,
</if>
<if test="reamke1 != null" >
reamke1,
</if>
<if test="reamke2 != null" >
reamke2,
</if>
<if test="reamke3 != null" >
reamke3,
</if>
<if test="reamke4 != null" >
reamke4,
</if>
<if test="payusername != null" >
payUserName,
</if>
<if test="paylocationname != null" >
payLocationName,
</if>
<if test="paytypeaddress != null" >
payTypeAddress,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="payfees != null" >
#{payfees,jdbcType=DECIMAL},
</if>
<if test="payuserid != null" >
#{payuserid,jdbcType=INTEGER},
</if>
<if test="paytime != null" >
#{paytime,jdbcType=TIMESTAMP},
</if>
<if test="paylocationid != null" >
#{paylocationid,jdbcType=INTEGER},
</if>
<if test="paystatus != null" >
#{paystatus,jdbcType=BIT},
</if>
<if test="paytype != null" >
#{paytype,jdbcType=BIT},
</if>
<if test="payfesstype != null" >
#{payfesstype,jdbcType=BIT},
</if>
<if test="ordernumber != null" >
#{ordernumber,jdbcType=VARCHAR},
</if>
<if test="reamke1 != null" >
#{reamke1,jdbcType=VARCHAR},
</if>
<if test="reamke2 != null" >
#{reamke2,jdbcType=VARCHAR},
</if>
<if test="reamke3 != null" >
#{reamke3,jdbcType=VARCHAR},
</if>
<if test="reamke4 != null" >
#{reamke4,jdbcType=VARCHAR},
</if>
<if test="payusername != null" >
#{payusername,jdbcType=VARCHAR},
</if>
<if test="paylocationname != null" >
#{paylocationname,jdbcType=VARCHAR},
</if>
<if test="paytypeaddress != null" >
#{paytypeaddress,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sunyo.energy.location.model.PayRecords" >
update pay_records
<set >
<if test="payfees != null" >
payFees = #{payfees,jdbcType=DECIMAL},
</if>
<if test="payuserid != null" >
payUserId = #{payuserid,jdbcType=INTEGER},
</if>
<if test="paytime != null" >
payTime = #{paytime,jdbcType=TIMESTAMP},
</if>
<if test="paylocationid != null" >
payLocationId = #{paylocationid,jdbcType=INTEGER},
</if>
<if test="paystatus != null" >
payStatus = #{paystatus,jdbcType=BIT},
</if>
<if test="paytype != null" >
payType = #{paytype,jdbcType=BIT},
</if>
<if test="payfesstype != null" >
payFessType = #{payfesstype,jdbcType=BIT},
</if>
<if test="ordernumber != null" >
orderNumber = #{ordernumber,jdbcType=VARCHAR},
</if>
<if test="reamke1 != null" >
reamke1 = #{reamke1,jdbcType=VARCHAR},
</if>
<if test="reamke2 != null" >
reamke2 = #{reamke2,jdbcType=VARCHAR},
</if>
<if test="reamke3 != null" >
reamke3 = #{reamke3,jdbcType=VARCHAR},
</if>
<if test="reamke4 != null" >
reamke4 = #{reamke4,jdbcType=VARCHAR},
</if>
<if test="payusername != null" >
payUserName = #{payusername,jdbcType=VARCHAR},
</if>
<if test="paylocationname != null" >
payLocationName = #{paylocationname,jdbcType=VARCHAR},
</if>
<if test="paytypeaddress != null" >
payTypeAddress = #{paytypeaddress,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.sunyo.energy.location.model.PayRecords" >
update pay_records
set payFees = #{payfees,jdbcType=DECIMAL},
payUserId = #{payuserid,jdbcType=INTEGER},
payTime = #{paytime,jdbcType=TIMESTAMP},
payLocationId = #{paylocationid,jdbcType=INTEGER},
payStatus = #{paystatus,jdbcType=BIT},
payType = #{paytype,jdbcType=BIT},
payFessType = #{payfesstype,jdbcType=BIT},
orderNumber = #{ordernumber,jdbcType=VARCHAR},
reamke1 = #{reamke1,jdbcType=VARCHAR},
reamke2 = #{reamke2,jdbcType=VARCHAR},
reamke3 = #{reamke3,jdbcType=VARCHAR},
reamke4 = #{reamke4,jdbcType=VARCHAR},
payUserName = #{payusername,jdbcType=VARCHAR},
payLocationName = #{paylocationname,jdbcType=VARCHAR},
payTypeAddress = #{paytypeaddress,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.sunyo.energy.location.dao.WaterElectricityParameterMapper" >
<resultMap id="BaseResultMap" type="com.sunyo.energy.location.model.WaterElectricityParameter" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="prepaid" property="prepaid" jdbcType="BIT" />
<result column="warningTrip" property="warningtrip" jdbcType="BIT" />
<result column="warningThreshold" property="warningthreshold" jdbcType="DECIMAL" />
<result column="overdraft" property="overdraft" jdbcType="BIT" />
<result column="overdraftThreshold" property="overdraftthreshold" jdbcType="DECIMAL" />
<result column="waterLoad" property="waterload" jdbcType="BIT" />
<result column="water" property="water" jdbcType="DECIMAL" />
<result column="power" property="power" jdbcType="DECIMAL" />
<result column="powerFactor" property="powerfactor" jdbcType="VARCHAR" />
<result column="free" property="free" jdbcType="BIT" />
<result column="freeElectricityLimit" property="freeelectricitylimit" jdbcType="DECIMAL" />
<result column="freeWater" property="freewater" jdbcType="VARCHAR" />
<result column="wm_id" property="wmId" jdbcType="VARCHAR" />
<result column="creatTime" property="creattime" jdbcType="TIMESTAMP" />
<result column="ee_id" property="eeId" jdbcType="VARCHAR" />
<result column="reamke2" property="reamke2" jdbcType="VARCHAR" />
<result column="reamke3" property="reamke3" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
id, prepaid, warningTrip, warningThreshold, overdraft, overdraftThreshold, waterLoad,
water, power, powerFactor, free, freeElectricityLimit, freeWater, wm_id, creatTime,
ee_id, reamke2, reamke3
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from water_electricity_parameter
where id = #{id,jdbcType=INTEGER}
</select>
<select id="countOne" parameterType="java.lang.String" resultType="int">
select count(*) from water_electricity_parameter where ee_id=#{value, jdbcType=VARCHAR}
</select>
<select id="findOneElectricity" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>
from water_electricity_parameter where ee_id = #{value,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from water_electricity_parameter
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.sunyo.energy.location.model.WaterElectricityParameter" >
insert into water_electricity_parameter (id, prepaid, warningTrip,
warningThreshold, overdraft, overdraftThreshold,
waterLoad, water, power,
powerFactor, free, freeElectricityLimit,
freeWater, wm_id, creatTime,
ee_id, reamke2, reamke3
)
values (#{id,jdbcType=INTEGER}, #{prepaid,jdbcType=BIT}, #{warningtrip,jdbcType=BIT},
#{warningthreshold,jdbcType=DECIMAL}, #{overdraft,jdbcType=BIT}, #{overdraftthreshold,jdbcType=DECIMAL},
#{waterload,jdbcType=BIT}, #{water,jdbcType=DECIMAL}, #{power,jdbcType=DECIMAL},
#{powerfactor,jdbcType=VARCHAR}, #{free,jdbcType=BIT}, #{freeelectricitylimit,jdbcType=DECIMAL},
#{freewater,jdbcType=VARCHAR}, #{wmId,jdbcType=VARCHAR}, #{creattime,jdbcType=TIMESTAMP},
#{eeId,jdbcType=VARCHAR}, #{reamke2,jdbcType=VARCHAR}, #{reamke3,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.sunyo.energy.location.model.WaterElectricityParameter" >
insert into water_electricity_parameter
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="prepaid != null" >
prepaid,
</if>
<if test="warningtrip != null" >
warningTrip,
</if>
<if test="warningthreshold != null" >
warningThreshold,
</if>
<if test="overdraft != null" >
overdraft,
</if>
<if test="overdraftthreshold != null" >
overdraftThreshold,
</if>
<if test="waterload != null" >
waterLoad,
</if>
<if test="water != null" >
water,
</if>
<if test="power != null" >
power,
</if>
<if test="powerfactor != null" >
powerFactor,
</if>
<if test="free != null" >
free,
</if>
<if test="freeelectricitylimit != null" >
freeElectricityLimit,
</if>
<if test="freewater != null" >
freeWater,
</if>
<if test="wmId != null" >
wm_id,
</if>
<if test="creattime != null" >
creatTime,
</if>
<if test="eeId != null" >
ee_id,
</if>
<if test="reamke2 != null" >
reamke2,
</if>
<if test="reamke3 != null" >
reamke3,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="prepaid != null" >
#{prepaid,jdbcType=BIT},
</if>
<if test="warningtrip != null" >
#{warningtrip,jdbcType=BIT},
</if>
<if test="warningthreshold != null" >
#{warningthreshold,jdbcType=DECIMAL},
</if>
<if test="overdraft != null" >
#{overdraft,jdbcType=BIT},
</if>
<if test="overdraftthreshold != null" >
#{overdraftthreshold,jdbcType=DECIMAL},
</if>
<if test="waterload != null" >
#{waterload,jdbcType=BIT},
</if>
<if test="water != null" >
#{water,jdbcType=DECIMAL},
</if>
<if test="power != null" >
#{power,jdbcType=DECIMAL},
</if>
<if test="powerfactor != null" >
#{powerfactor,jdbcType=VARCHAR},
</if>
<if test="free != null" >
#{free,jdbcType=BIT},
</if>
<if test="freeelectricitylimit != null" >
#{freeelectricitylimit,jdbcType=DECIMAL},
</if>
<if test="freewater != null" >
#{freewater,jdbcType=VARCHAR},
</if>
<if test="wmId != null" >
#{wmId,jdbcType=VARCHAR},
</if>
<if test="creattime != null" >
#{creattime,jdbcType=TIMESTAMP},
</if>
<if test="eeId != null" >
#{eeId,jdbcType=VARCHAR},
</if>
<if test="reamke2 != null" >
#{reamke2,jdbcType=VARCHAR},
</if>
<if test="reamke3 != null" >
#{reamke3,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sunyo.energy.location.model.WaterElectricityParameter" >
update water_electricity_parameter
<set >
<if test="prepaid != null" >
prepaid = #{prepaid,jdbcType=BIT},
</if>
<if test="warningtrip != null" >
warningTrip = #{warningtrip,jdbcType=BIT},
</if>
<if test="warningthreshold != null" >
warningThreshold = #{warningthreshold,jdbcType=DECIMAL},
</if>
<if test="overdraft != null" >
overdraft = #{overdraft,jdbcType=BIT},
</if>
<if test="overdraftthreshold != null" >
overdraftThreshold = #{overdraftthreshold,jdbcType=DECIMAL},
</if>
<if test="waterload != null" >
waterLoad = #{waterload,jdbcType=BIT},
</if>
<if test="water != null" >
water = #{water,jdbcType=DECIMAL},
</if>
<if test="power != null" >
power = #{power,jdbcType=DECIMAL},
</if>
<if test="powerfactor != null" >
powerFactor = #{powerfactor,jdbcType=VARCHAR},
</if>
<if test="free != null" >
free = #{free,jdbcType=BIT},
</if>
<if test="freeelectricitylimit != null" >
freeElectricityLimit = #{freeelectricitylimit,jdbcType=DECIMAL},
</if>
<if test="freewater != null" >
freeWater = #{freewater,jdbcType=VARCHAR},
</if>
<if test="wmId != null" >
wm_id = #{wmId,jdbcType=VARCHAR},
</if>
<if test="creattime != null" >
creatTime = #{creattime,jdbcType=TIMESTAMP},
</if>
<if test="eeId != null" >
ee_id = #{eeId,jdbcType=VARCHAR},
</if>
<if test="reamke2 != null" >
reamke2 = #{reamke2,jdbcType=VARCHAR},
</if>
<if test="reamke3 != null" >
reamke3 = #{reamke3,jdbcType=VARCHAR},
</if>
</set>
where ee_id = #{eeId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.sunyo.energy.location.model.WaterElectricityParameter" >
update water_electricity_parameter
set prepaid = #{prepaid,jdbcType=BIT},
warningTrip = #{warningtrip,jdbcType=BIT},
warningThreshold = #{warningthreshold,jdbcType=DECIMAL},
overdraft = #{overdraft,jdbcType=BIT},
overdraftThreshold = #{overdraftthreshold,jdbcType=DECIMAL},
waterLoad = #{waterload,jdbcType=BIT},
water = #{water,jdbcType=DECIMAL},
power = #{power,jdbcType=DECIMAL},
powerFactor = #{powerfactor,jdbcType=VARCHAR},
free = #{free,jdbcType=BIT},
freeElectricityLimit = #{freeelectricitylimit,jdbcType=DECIMAL},
freeWater = #{freewater,jdbcType=VARCHAR},
wm_id = #{wmId,jdbcType=VARCHAR},
creatTime = #{creattime,jdbcType=TIMESTAMP},
ee_id = #{eeId,jdbcType=VARCHAR},
reamke2 = #{reamke2,jdbcType=VARCHAR},
reamke3 = #{reamke3,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.sunyo.energy.location.dao.WaterMeterMapper" >
<resultMap id="BaseResultMap" type="com.sunyo.energy.location.model.WaterMeter" >
<result column="wm_id" property="wmId" jdbcType="VARCHAR" />
<result column="wm_sacc" property="wmSacc" jdbcType="VARCHAR" />
<result column="wm_lacc" property="wmLacc" jdbcType="VARCHAR" />
<result column="wm_rdtime" property="wmRdtime" jdbcType="VARCHAR" />
<result column="wm_fmstate" property="wmFmstate" jdbcType="VARCHAR" />
<result column="wm_errmessage" property="wmErrmessage" jdbcType="VARCHAR" />
<result column="wm_voltage" property="wmVoltage" jdbcType="VARCHAR" />
<result column="wm_signalpower" property="wmSignalpower" jdbcType="VARCHAR" />
<result column="creatTime" property="creattime" jdbcType="TIMESTAMP" />
<result column="updateTime" property="updatetime" jdbcType="TIMESTAMP" />
<result column="reamke1" property="reamke1" jdbcType="VARCHAR" />
<result column="reamke2" property="reamke2" jdbcType="VARCHAR" />
<result column="reamke3" property="reamke3" jdbcType="VARCHAR" />
<result column="reamke4" property="reamke4" jdbcType="VARCHAR" />
</resultMap>
<insert id="insert" parameterType="com.sunyo.energy.location.model.WaterMeter" >
insert into water_meter (wm_id, wm_sacc, wm_lacc,
wm_rdtime, wm_fmstate, wm_errmessage,
wm_voltage, wm_signalpower, creatTime,
updateTime, reamke1, reamke2,
reamke3, reamke4)
values (#{wmId,jdbcType=VARCHAR}, #{wmSacc,jdbcType=VARCHAR}, #{wmLacc,jdbcType=VARCHAR},
#{wmRdtime,jdbcType=VARCHAR}, #{wmFmstate,jdbcType=VARCHAR}, #{wmErrmessage,jdbcType=VARCHAR},
#{wmVoltage,jdbcType=VARCHAR}, #{wmSignalpower,jdbcType=VARCHAR}, #{creattime,jdbcType=TIMESTAMP},
#{updatetime,jdbcType=TIMESTAMP}, #{reamke1,jdbcType=VARCHAR}, #{reamke2,jdbcType=VARCHAR},
#{reamke3,jdbcType=VARCHAR}, #{reamke4,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.sunyo.energy.location.model.WaterMeter" >
insert into water_meter
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="wmId != null" >
wm_id,
</if>
<if test="wmSacc != null" >
wm_sacc,
</if>
<if test="wmLacc != null" >
wm_lacc,
</if>
<if test="wmRdtime != null" >
wm_rdtime,
</if>
<if test="wmFmstate != null" >
wm_fmstate,
</if>
<if test="wmErrmessage != null" >
wm_errmessage,
</if>
<if test="wmVoltage != null" >
wm_voltage,
</if>
<if test="wmSignalpower != null" >
wm_signalpower,
</if>
<if test="creattime != null" >
creatTime,
</if>
<if test="updatetime != null" >
updateTime,
</if>
<if test="reamke1 != null" >
reamke1,
</if>
<if test="reamke2 != null" >
reamke2,
</if>
<if test="reamke3 != null" >
reamke3,
</if>
<if test="reamke4 != null" >
reamke4,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="wmId != null" >
#{wmId,jdbcType=VARCHAR},
</if>
<if test="wmSacc != null" >
#{wmSacc,jdbcType=VARCHAR},
</if>
<if test="wmLacc != null" >
#{wmLacc,jdbcType=VARCHAR},
</if>
<if test="wmRdtime != null" >
#{wmRdtime,jdbcType=VARCHAR},
</if>
<if test="wmFmstate != null" >
#{wmFmstate,jdbcType=VARCHAR},
</if>
<if test="wmErrmessage != null" >
#{wmErrmessage,jdbcType=VARCHAR},
</if>
<if test="wmVoltage != null" >
#{wmVoltage,jdbcType=VARCHAR},
</if>
<if test="wmSignalpower != null" >
#{wmSignalpower,jdbcType=VARCHAR},
</if>
<if test="creattime != null" >
#{creattime,jdbcType=TIMESTAMP},
</if>
<if test="updatetime != null" >
#{updatetime,jdbcType=TIMESTAMP},
</if>
<if test="reamke1 != null" >
#{reamke1,jdbcType=VARCHAR},
</if>
<if test="reamke2 != null" >
#{reamke2,jdbcType=VARCHAR},
</if>
<if test="reamke3 != null" >
#{reamke3,jdbcType=VARCHAR},
</if>
<if test="reamke4 != null" >
#{reamke4,jdbcType=VARCHAR},
</if>
</trim>
ON DUPLICATE KEY
UPDATE
wm_sacc = #{wmSacc,jdbcType=VARCHAR},
wm_lacc = #{wmLacc,jdbcType=VARCHAR},
wm_rdtime = #{wmRdtime,jdbcType=VARCHAR},
wm_fmstate = #{wmFmstate,jdbcType=VARCHAR},
wm_errmessage = #{wmErrmessage,jdbcType=VARCHAR},
wm_voltage = #{wmVoltage,jdbcType=VARCHAR},
wm_signalpower = #{wmSignalpower,jdbcType=VARCHAR},
creatTime = #{creattime,jdbcType=TIMESTAMP},
updateTime = #{updatetime,jdbcType=TIMESTAMP},
reamke1 = #{reamke1,jdbcType=VARCHAR},
reamke2 = #{reamke2,jdbcType=VARCHAR},
reamke3 = #{reamke3,jdbcType=VARCHAR},
reamke4 = #{reamke4,jdbcType=VARCHAR}
</insert>
</mapper>
\ No newline at end of file
... ...