mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
深圳停车平台
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
package com.jsowell.pile.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 充电停车优惠表
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@SuperBuilder
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ChargeParkingDiscount {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 站点id
|
||||
*/
|
||||
private String stationId;
|
||||
|
||||
/**
|
||||
* 道闸平台id
|
||||
*/
|
||||
private Integer parkingPlatformId;
|
||||
|
||||
/**
|
||||
* 条件类型(1-固定电量;2-固定时长)
|
||||
*/
|
||||
private String conditionType;
|
||||
|
||||
private String conditionValue;
|
||||
|
||||
/**
|
||||
* 优惠类型(1-减时间单位分钟; 2-减金额单位元)
|
||||
*/
|
||||
private String discountType;
|
||||
|
||||
private String discountValue;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 删除标识(0-正常; 1-删除)
|
||||
*/
|
||||
private String delFlag;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.jsowell.pile.mapper;
|
||||
|
||||
import com.jsowell.pile.domain.ChargeParkingDiscount;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ChargeParkingDiscountMapper {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insertSelective(ChargeParkingDiscount record);
|
||||
|
||||
ChargeParkingDiscount selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(ChargeParkingDiscount record);
|
||||
|
||||
int updateBatchSelective(List<ChargeParkingDiscount> list);
|
||||
|
||||
int batchInsert(@Param("list") List<ChargeParkingDiscount> list);
|
||||
|
||||
int insertOrUpdate(ChargeParkingDiscount record);
|
||||
|
||||
int insertOrUpdateSelective(ChargeParkingDiscount record);
|
||||
|
||||
ChargeParkingDiscount selectByStationId(String stationId);
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.jsowell.pile.service;
|
||||
|
||||
import com.jsowell.pile.domain.ChargeParkingDiscount;
|
||||
import com.jsowell.pile.vo.web.ChargeParkingDiscountVO;
|
||||
|
||||
import java.util.List;
|
||||
public interface ChargeParkingDiscountService{
|
||||
|
||||
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insertSelective(ChargeParkingDiscount record);
|
||||
|
||||
ChargeParkingDiscount selectByPrimaryKey(Integer id);
|
||||
|
||||
/**
|
||||
* 根据车场ID查询车场信息
|
||||
* @param stationId
|
||||
* @return
|
||||
*/
|
||||
ChargeParkingDiscount selectByStationId(String stationId);
|
||||
|
||||
ChargeParkingDiscountVO getChargeParkingDiscount(String stationId);
|
||||
|
||||
int updateByPrimaryKeySelective(ChargeParkingDiscount record);
|
||||
|
||||
int updateBatchSelective(List<ChargeParkingDiscount> list);
|
||||
|
||||
int batchInsert(List<ChargeParkingDiscount> list);
|
||||
|
||||
int insertOrUpdate(ChargeParkingDiscount record);
|
||||
|
||||
int insertOrUpdateSelective(ChargeParkingDiscount record);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.jsowell.pile.service.impl;
|
||||
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.pile.domain.ChargeParkingDiscount;
|
||||
import com.jsowell.pile.mapper.ChargeParkingDiscountMapper;
|
||||
import com.jsowell.pile.service.ChargeParkingDiscountService;
|
||||
import com.jsowell.pile.vo.web.ChargeParkingDiscountVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
@Service
|
||||
public class ChargeParkingDiscountServiceImpl implements ChargeParkingDiscountService{
|
||||
|
||||
@Resource
|
||||
private ChargeParkingDiscountMapper chargeParkingDiscountMapper;
|
||||
|
||||
@Override
|
||||
public int deleteByPrimaryKey(Integer id) {
|
||||
return chargeParkingDiscountMapper.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertSelective(ChargeParkingDiscount record) {
|
||||
return chargeParkingDiscountMapper.insertSelective(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChargeParkingDiscount selectByPrimaryKey(Integer id) {
|
||||
return chargeParkingDiscountMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChargeParkingDiscount selectByStationId(String stationId) {
|
||||
return chargeParkingDiscountMapper.selectByStationId(stationId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChargeParkingDiscountVO getChargeParkingDiscount(String stationId) {
|
||||
if (StringUtils.isBlank(stationId)) {
|
||||
return null;
|
||||
}
|
||||
ChargeParkingDiscount chargeParkingDiscount = this.selectByStationId(stationId);
|
||||
if (chargeParkingDiscount == null) {
|
||||
return null;
|
||||
}
|
||||
// 查询该站点的停车优惠信息
|
||||
ChargeParkingDiscountVO discountVO = new ChargeParkingDiscountVO();
|
||||
discountVO.setStationId(chargeParkingDiscount.getStationId());
|
||||
discountVO.setConditionType(chargeParkingDiscount.getConditionType());
|
||||
discountVO.setConditionValue(chargeParkingDiscount.getConditionValue());
|
||||
discountVO.setDiscountType(chargeParkingDiscount.getDiscountType());
|
||||
discountVO.setDiscountValue(chargeParkingDiscount.getDiscountValue());
|
||||
discountVO.setStartTime(DateUtils.formatDateTime(chargeParkingDiscount.getStartTime()));
|
||||
discountVO.setEndTime(DateUtils.formatDateTime(chargeParkingDiscount.getEndTime()));
|
||||
return discountVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateByPrimaryKeySelective(ChargeParkingDiscount record) {
|
||||
return chargeParkingDiscountMapper.updateByPrimaryKeySelective(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateBatchSelective(List<ChargeParkingDiscount> list) {
|
||||
return chargeParkingDiscountMapper.updateBatchSelective(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int batchInsert(List<ChargeParkingDiscount> list) {
|
||||
return chargeParkingDiscountMapper.batchInsert(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertOrUpdate(ChargeParkingDiscount record) {
|
||||
return chargeParkingDiscountMapper.insertOrUpdate(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertOrUpdateSelective(ChargeParkingDiscount record) {
|
||||
return chargeParkingDiscountMapper.insertOrUpdateSelective(record);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user