mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-09 04:20:08 +08:00
update 订单日报
This commit is contained in:
@@ -1,233 +1,100 @@
|
||||
package com.jsowell.pile.domain;
|
||||
|
||||
import com.jsowell.common.annotation.Excel;
|
||||
import com.jsowell.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* 结算订单报对象 settle_order_report
|
||||
*
|
||||
* @author jsowell
|
||||
* @date 2023-06-05
|
||||
* 结算订单报表
|
||||
*/
|
||||
public class SettleOrderReport extends BaseEntity {
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SettleOrderReport {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 运营商id
|
||||
*/
|
||||
@Excel(name = "运营商id")
|
||||
private String merchantId;
|
||||
|
||||
/**
|
||||
* 站点id
|
||||
*/
|
||||
@Excel(name = "站点id")
|
||||
private String stationId;
|
||||
|
||||
/**
|
||||
* 包含订单编号
|
||||
*/
|
||||
private String orderCodes;
|
||||
|
||||
/**
|
||||
* 用电度数
|
||||
*/
|
||||
@Excel(name = "用电度数")
|
||||
private BigDecimal useElectricity;
|
||||
|
||||
/**
|
||||
* 充电次数
|
||||
*/
|
||||
@Excel(name = "充电次数")
|
||||
private String chargeNum;
|
||||
|
||||
/**
|
||||
* 充电时长
|
||||
*/
|
||||
@Excel(name = "充电时长")
|
||||
private String chargeTime;
|
||||
|
||||
/**
|
||||
* 电费金额
|
||||
*/
|
||||
@Excel(name = "电费金额")
|
||||
private BigDecimal electricityAmount;
|
||||
|
||||
/**
|
||||
* 服务费金额
|
||||
*/
|
||||
@Excel(name = "服务费金额")
|
||||
private BigDecimal serviceAmount;
|
||||
|
||||
/**
|
||||
* 收入金额
|
||||
*/
|
||||
@Excel(name = "收入金额")
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 虚拟金额
|
||||
*/
|
||||
@Excel(name = "虚拟金额")
|
||||
private BigDecimal virtualAmount;
|
||||
|
||||
/**
|
||||
* 交易日期
|
||||
*/
|
||||
@Excel(name = "交易日期")
|
||||
private String tradeDate;
|
||||
|
||||
/**
|
||||
* 交易金额
|
||||
*/
|
||||
@Excel(name = "交易金额")
|
||||
private BigDecimal tradeAmount;
|
||||
|
||||
/**
|
||||
* 交易手续费
|
||||
*/
|
||||
@Excel(name = "交易手续费")
|
||||
private BigDecimal tradeFee;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 删除标识(0-正常;1-删除)
|
||||
*/
|
||||
private String delFlag;
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setMerchantId(String merchantId) {
|
||||
this.merchantId = merchantId;
|
||||
}
|
||||
|
||||
public String getMerchantId() {
|
||||
return merchantId;
|
||||
}
|
||||
|
||||
public void setStationId(String stationId) {
|
||||
this.stationId = stationId;
|
||||
}
|
||||
|
||||
public String getStationId() {
|
||||
return stationId;
|
||||
}
|
||||
|
||||
public void setUseElectricity(BigDecimal useElectricity) {
|
||||
this.useElectricity = useElectricity;
|
||||
}
|
||||
|
||||
public BigDecimal getUseElectricity() {
|
||||
return useElectricity;
|
||||
}
|
||||
|
||||
public void setChargeNum(String chargeNum) {
|
||||
this.chargeNum = chargeNum;
|
||||
}
|
||||
|
||||
public String getChargeNum() {
|
||||
return chargeNum;
|
||||
}
|
||||
|
||||
public void setChargeTime(String chargeTime) {
|
||||
this.chargeTime = chargeTime;
|
||||
}
|
||||
|
||||
public String getChargeTime() {
|
||||
return chargeTime;
|
||||
}
|
||||
|
||||
public void setElectricityAmount(BigDecimal electricityAmount) {
|
||||
this.electricityAmount = electricityAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getElectricityAmount() {
|
||||
return electricityAmount;
|
||||
}
|
||||
|
||||
public void setServiceAmount(BigDecimal serviceAmount) {
|
||||
this.serviceAmount = serviceAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getServiceAmount() {
|
||||
return serviceAmount;
|
||||
}
|
||||
|
||||
public void setTotalAmount(BigDecimal totalAmount) {
|
||||
this.totalAmount = totalAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalAmount() {
|
||||
return totalAmount;
|
||||
}
|
||||
|
||||
public void setVirtualAmount(BigDecimal virtualAmount) {
|
||||
this.virtualAmount = virtualAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getVirtualAmount() {
|
||||
return virtualAmount;
|
||||
}
|
||||
|
||||
public void setTradeDate(String tradeDate) {
|
||||
this.tradeDate = tradeDate;
|
||||
}
|
||||
|
||||
public String getTradeDate() {
|
||||
return tradeDate;
|
||||
}
|
||||
|
||||
public void setTradeAmount(BigDecimal tradeAmount) {
|
||||
this.tradeAmount = tradeAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getTradeAmount() {
|
||||
return tradeAmount;
|
||||
}
|
||||
|
||||
public void setTradeFee(BigDecimal tradeFee) {
|
||||
this.tradeFee = tradeFee;
|
||||
}
|
||||
|
||||
public BigDecimal getTradeFee() {
|
||||
return tradeFee;
|
||||
}
|
||||
|
||||
public void setDelFlag(String delFlag) {
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getDelFlag() {
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.JSON_STYLE)
|
||||
.append("id", getId())
|
||||
.append("merchantId", getMerchantId())
|
||||
.append("stationId", getStationId())
|
||||
.append("useElectricity", getUseElectricity())
|
||||
.append("chargeNum", getChargeNum())
|
||||
.append("chargeTime", getChargeTime())
|
||||
.append("electricityAmount", getElectricityAmount())
|
||||
.append("serviceAmount", getServiceAmount())
|
||||
.append("totalAmount", getTotalAmount())
|
||||
.append("virtualAmount", getVirtualAmount())
|
||||
.append("tradeDate", getTradeDate())
|
||||
.append("tradeAmount", getTradeAmount())
|
||||
.append("tradeFee", getTradeFee())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("delFlag", getDelFlag())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,25 +4,75 @@ import com.jsowell.pile.domain.SettleOrderReport;
|
||||
import com.jsowell.pile.dto.MerchantOrderReportDTO;
|
||||
import com.jsowell.pile.vo.web.SettleOrderReportVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 结算订单报Mapper接口
|
||||
*
|
||||
* @author jsowell
|
||||
* @date 2023-06-05
|
||||
*/
|
||||
@Repository
|
||||
public interface SettleOrderReportMapper {
|
||||
/**
|
||||
* delete by primary key
|
||||
*
|
||||
* @param id primaryKey
|
||||
* @return deleteCount
|
||||
*/
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
/**
|
||||
* insert record to table
|
||||
*
|
||||
* @param record the record
|
||||
* @return insert count
|
||||
*/
|
||||
int insert(SettleOrderReport record);
|
||||
|
||||
int insertOrUpdate(SettleOrderReport record);
|
||||
|
||||
int insertOrUpdateSelective(SettleOrderReport record);
|
||||
|
||||
/**
|
||||
* insert record to table selective
|
||||
*
|
||||
* @param record the record
|
||||
* @return insert count
|
||||
*/
|
||||
int insertSelective(SettleOrderReport record);
|
||||
|
||||
/**
|
||||
* select by primary key
|
||||
*
|
||||
* @param id primary key
|
||||
* @return object by primary key
|
||||
*/
|
||||
SettleOrderReport selectByPrimaryKey(Integer id);
|
||||
|
||||
/**
|
||||
* update record selective
|
||||
*
|
||||
* @param record the updated record
|
||||
* @return update count
|
||||
*/
|
||||
int updateByPrimaryKeySelective(SettleOrderReport record);
|
||||
|
||||
/**
|
||||
* update record
|
||||
*
|
||||
* @param record the updated record
|
||||
* @return update count
|
||||
*/
|
||||
int updateByPrimaryKey(SettleOrderReport record);
|
||||
|
||||
int updateBatch(List<SettleOrderReport> list);
|
||||
|
||||
int updateBatchSelective(List<SettleOrderReport> list);
|
||||
|
||||
int batchInsert(@Param("list") List<SettleOrderReport> list);
|
||||
|
||||
/**
|
||||
* 查询结算订单报
|
||||
*
|
||||
* @param id 结算订单报主键
|
||||
* @return 结算订单报
|
||||
*/
|
||||
public SettleOrderReport selectSettleOrderReportById(Long id);
|
||||
SettleOrderReport selectSettleOrderReportById(Long id);
|
||||
|
||||
/**
|
||||
* 查询结算订单报列表
|
||||
@@ -30,7 +80,7 @@ public interface SettleOrderReportMapper {
|
||||
* @param settleOrderReport 结算订单报
|
||||
* @return 结算订单报集合
|
||||
*/
|
||||
public List<SettleOrderReport> selectSettleOrderReportList(SettleOrderReport settleOrderReport);
|
||||
List<SettleOrderReport> selectSettleOrderReportList(SettleOrderReport settleOrderReport);
|
||||
|
||||
/**
|
||||
* 新增结算订单报
|
||||
@@ -38,7 +88,7 @@ public interface SettleOrderReportMapper {
|
||||
* @param settleOrderReport 结算订单报
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSettleOrderReport(SettleOrderReport settleOrderReport);
|
||||
int insertSettleOrderReport(SettleOrderReport settleOrderReport);
|
||||
|
||||
/**
|
||||
* 修改结算订单报
|
||||
@@ -46,7 +96,7 @@ public interface SettleOrderReportMapper {
|
||||
* @param settleOrderReport 结算订单报
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSettleOrderReport(SettleOrderReport settleOrderReport);
|
||||
int updateSettleOrderReport(SettleOrderReport settleOrderReport);
|
||||
|
||||
/**
|
||||
* 删除结算订单报
|
||||
@@ -54,7 +104,7 @@ public interface SettleOrderReportMapper {
|
||||
* @param id 结算订单报主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSettleOrderReportById(Long id);
|
||||
int deleteSettleOrderReportById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除结算订单报
|
||||
@@ -62,14 +112,29 @@ public interface SettleOrderReportMapper {
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSettleOrderReportByIds(Long[] ids);
|
||||
int deleteSettleOrderReportByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 根据运营商id查询订单报表
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
List<SettleOrderReportVO> getMerchantOrderReport(@Param("dto") MerchantOrderReportDTO dto);
|
||||
|
||||
/**
|
||||
* 根据站点id和日期查询订单日报
|
||||
*
|
||||
* @param stationId 站点id
|
||||
* @param date 交易日期
|
||||
*/
|
||||
SettleOrderReport selectByStationIdAndDate(@Param("stationId") String stationId, @Param("date") String date);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据运营商id和日期查询订单日报
|
||||
*
|
||||
* @param merchantId 运营商id
|
||||
* @param date 交易日期
|
||||
*/
|
||||
List<SettleOrderReport> selectByMerchantIdAndDate(@Param("merchantId") String merchantId, @Param("date") String date);
|
||||
}
|
||||
@@ -23,6 +23,8 @@ public interface ISettleOrderReportService {
|
||||
|
||||
SettleOrderReport selectByStationIdAndDate(String stationId, String date);
|
||||
|
||||
List<SettleOrderReport> selectByMerchantIdAndDate(String merchantId, String date);
|
||||
|
||||
/**
|
||||
* 查询结算订单报列表
|
||||
*
|
||||
@@ -69,4 +71,26 @@ public interface ISettleOrderReportService {
|
||||
* @return
|
||||
*/
|
||||
MerchantOrderReportVO getMerchantOrderReport(MerchantOrderReportDTO dto);
|
||||
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(SettleOrderReport record);
|
||||
|
||||
int insertOrUpdate(SettleOrderReport record);
|
||||
|
||||
int insertOrUpdateSelective(SettleOrderReport record);
|
||||
|
||||
int insertSelective(SettleOrderReport record);
|
||||
|
||||
SettleOrderReport selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(SettleOrderReport record);
|
||||
|
||||
int updateByPrimaryKey(SettleOrderReport record);
|
||||
|
||||
int updateBatch(List<SettleOrderReport> list);
|
||||
|
||||
int updateBatchSelective(List<SettleOrderReport> list);
|
||||
|
||||
int batchInsert(List<SettleOrderReport> list);
|
||||
}
|
||||
|
||||
@@ -118,6 +118,9 @@ public class AdapayMemberAccountServiceImpl implements IAdapayMemberAccountServi
|
||||
|
||||
@Override
|
||||
public AdapayMemberAccount selectByMerchantId(String merchantId) {
|
||||
if (StringUtils.isBlank(merchantId)) {
|
||||
return null;
|
||||
}
|
||||
String redisKey = CacheConstants.ADAPAY_MEMBER_ACCOUNT + merchantId;
|
||||
AdapayMemberAccount adapayMemberAccount = redisCache.getCacheObject(redisKey);
|
||||
if (adapayMemberAccount == null) {
|
||||
|
||||
@@ -870,16 +870,29 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
|
||||
/**
|
||||
* 订单分账逻辑
|
||||
* orderSplittingOperations
|
||||
* 只有开通结算账户的运营商才走分账逻辑
|
||||
*/
|
||||
private void ledgerAccount(OrderBasicInfo orderBasicInfo) throws BaseAdaPayException {
|
||||
private void orderSplittingOperations(String merchantId, String tradeDate) {
|
||||
// 查询运营商有没有开通结算账户
|
||||
String merchantId = orderBasicInfo.getMerchantId();
|
||||
AdapayMemberAccount adapayMemberAccount = adapayMemberAccountService.selectByMerchantId(merchantId);
|
||||
if (adapayMemberAccount == null) {
|
||||
logger.error("订单分账逻辑error, 运营商id:{}, 未配置结算账户", merchantId);
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_ADAPAY_MEMBER_IS_NULL_ERROR);
|
||||
}
|
||||
|
||||
// 根据交易日期查询运营商下面所有站点的交易日报
|
||||
List<SettleOrderReport> orderReports = settleOrderReportService.selectByMerchantIdAndDate(merchantId, tradeDate);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 交易确认
|
||||
* @param orderBasicInfo 订单
|
||||
* @param adapayMemberAccount 结算账户
|
||||
* @throws BaseAdaPayException
|
||||
*/
|
||||
private void doPaymentConfirm(OrderBasicInfo orderBasicInfo, AdapayMemberAccount adapayMemberAccount) throws BaseAdaPayException {
|
||||
// 查询订单的交易id
|
||||
AdapayCallbackRecord adapayCallbackRecord = adapayCallbackRecordService.selectByOrderCode(orderBasicInfo.getOrderCode());
|
||||
if (adapayCallbackRecord == null) {
|
||||
|
||||
@@ -46,6 +46,11 @@ public class SettleOrderReportServiceImpl implements ISettleOrderReportService {
|
||||
return settleOrderReportMapper.selectByStationIdAndDate(stationId, date);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SettleOrderReport> selectByMerchantIdAndDate(String merchantId, String date) {
|
||||
return settleOrderReportMapper.selectByMerchantIdAndDate(merchantId, date);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询结算订单报列表
|
||||
*
|
||||
@@ -104,6 +109,7 @@ public class SettleOrderReportServiceImpl implements ISettleOrderReportService {
|
||||
|
||||
/**
|
||||
* 根据运营商id查询订单报表
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@@ -161,4 +167,60 @@ public class SettleOrderReportServiceImpl implements ISettleOrderReportService {
|
||||
vo.setMerchantOrderReport(report);
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByPrimaryKey(Integer id) {
|
||||
return settleOrderReportMapper.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insert(SettleOrderReport record) {
|
||||
return settleOrderReportMapper.insert(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertOrUpdate(SettleOrderReport record) {
|
||||
return settleOrderReportMapper.insertOrUpdate(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertOrUpdateSelective(SettleOrderReport record) {
|
||||
return settleOrderReportMapper.insertOrUpdateSelective(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertSelective(SettleOrderReport record) {
|
||||
return settleOrderReportMapper.insertSelective(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SettleOrderReport selectByPrimaryKey(Integer id) {
|
||||
return settleOrderReportMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateByPrimaryKeySelective(SettleOrderReport record) {
|
||||
return settleOrderReportMapper.updateByPrimaryKeySelective(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateByPrimaryKey(SettleOrderReport record) {
|
||||
return settleOrderReportMapper.updateByPrimaryKey(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateBatch(List<SettleOrderReport> list) {
|
||||
return settleOrderReportMapper.updateBatch(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateBatchSelective(List<SettleOrderReport> list) {
|
||||
return settleOrderReportMapper.updateBatchSelective(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int batchInsert(List<SettleOrderReport> list) {
|
||||
return settleOrderReportMapper.batchInsert(list);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,37 +1,694 @@
|
||||
<?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">
|
||||
<?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.jsowell.pile.mapper.SettleOrderReportMapper">
|
||||
<resultMap id="BaseResultMap" type="com.jsowell.pile.domain.SettleOrderReport">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table settle_order_report-->
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="merchant_id" jdbcType="VARCHAR" property="merchantId" />
|
||||
<result column="station_id" jdbcType="VARCHAR" property="stationId" />
|
||||
<result column="order_codes" jdbcType="LONGVARCHAR" property="orderCodes" />
|
||||
<result column="use_electricity" jdbcType="DECIMAL" property="useElectricity" />
|
||||
<result column="charge_num" jdbcType="VARCHAR" property="chargeNum" />
|
||||
<result column="charge_time" jdbcType="VARCHAR" property="chargeTime" />
|
||||
<result column="electricity_amount" jdbcType="DECIMAL" property="electricityAmount" />
|
||||
<result column="service_amount" jdbcType="DECIMAL" property="serviceAmount" />
|
||||
<result column="total_amount" jdbcType="DECIMAL" property="totalAmount" />
|
||||
<result column="virtual_amount" jdbcType="DECIMAL" property="virtualAmount" />
|
||||
<result column="trade_date" jdbcType="VARCHAR" property="tradeDate" />
|
||||
<result column="trade_amount" jdbcType="DECIMAL" property="tradeAmount" />
|
||||
<result column="trade_fee" jdbcType="DECIMAL" property="tradeFee" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="del_flag" jdbcType="VARCHAR" property="delFlag" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, merchant_id, station_id, order_codes, use_electricity, charge_num, charge_time,
|
||||
electricity_amount, service_amount, total_amount, virtual_amount, trade_date, trade_amount,
|
||||
trade_fee, create_time, del_flag
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
<!--@mbg.generated-->
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from settle_order_report
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
<!--@mbg.generated-->
|
||||
delete from settle_order_report
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.SettleOrderReport" useGeneratedKeys="true">
|
||||
<!--@mbg.generated-->
|
||||
insert into settle_order_report (merchant_id, station_id, order_codes,
|
||||
use_electricity, charge_num, charge_time,
|
||||
electricity_amount, service_amount, total_amount,
|
||||
virtual_amount, trade_date, trade_amount,
|
||||
trade_fee, create_time, del_flag
|
||||
)
|
||||
values (#{merchantId,jdbcType=VARCHAR}, #{stationId,jdbcType=VARCHAR}, #{orderCodes,jdbcType=LONGVARCHAR},
|
||||
#{useElectricity,jdbcType=DECIMAL}, #{chargeNum,jdbcType=VARCHAR}, #{chargeTime,jdbcType=VARCHAR},
|
||||
#{electricityAmount,jdbcType=DECIMAL}, #{serviceAmount,jdbcType=DECIMAL}, #{totalAmount,jdbcType=DECIMAL},
|
||||
#{virtualAmount,jdbcType=DECIMAL}, #{tradeDate,jdbcType=VARCHAR}, #{tradeAmount,jdbcType=DECIMAL},
|
||||
#{tradeFee,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.SettleOrderReport" useGeneratedKeys="true">
|
||||
<!--@mbg.generated-->
|
||||
insert into settle_order_report
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="merchantId != null">
|
||||
merchant_id,
|
||||
</if>
|
||||
<if test="stationId != null">
|
||||
station_id,
|
||||
</if>
|
||||
<if test="orderCodes != null">
|
||||
order_codes,
|
||||
</if>
|
||||
<if test="useElectricity != null">
|
||||
use_electricity,
|
||||
</if>
|
||||
<if test="chargeNum != null">
|
||||
charge_num,
|
||||
</if>
|
||||
<if test="chargeTime != null">
|
||||
charge_time,
|
||||
</if>
|
||||
<if test="electricityAmount != null">
|
||||
electricity_amount,
|
||||
</if>
|
||||
<if test="serviceAmount != null">
|
||||
service_amount,
|
||||
</if>
|
||||
<if test="totalAmount != null">
|
||||
total_amount,
|
||||
</if>
|
||||
<if test="virtualAmount != null">
|
||||
virtual_amount,
|
||||
</if>
|
||||
<if test="tradeDate != null">
|
||||
trade_date,
|
||||
</if>
|
||||
<if test="tradeAmount != null">
|
||||
trade_amount,
|
||||
</if>
|
||||
<if test="tradeFee != null">
|
||||
trade_fee,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="delFlag != null">
|
||||
del_flag,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="merchantId != null">
|
||||
#{merchantId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="stationId != null">
|
||||
#{stationId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="orderCodes != null">
|
||||
#{orderCodes,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
<if test="useElectricity != null">
|
||||
#{useElectricity,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="chargeNum != null">
|
||||
#{chargeNum,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="chargeTime != null">
|
||||
#{chargeTime,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="electricityAmount != null">
|
||||
#{electricityAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="serviceAmount != null">
|
||||
#{serviceAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="totalAmount != null">
|
||||
#{totalAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="virtualAmount != null">
|
||||
#{virtualAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="tradeDate != null">
|
||||
#{tradeDate,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="tradeAmount != null">
|
||||
#{tradeAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="tradeFee != null">
|
||||
#{tradeFee,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="delFlag != null">
|
||||
#{delFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.jsowell.pile.domain.SettleOrderReport">
|
||||
<!--@mbg.generated-->
|
||||
update settle_order_report
|
||||
<set>
|
||||
<if test="merchantId != null">
|
||||
merchant_id = #{merchantId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="stationId != null">
|
||||
station_id = #{stationId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="orderCodes != null">
|
||||
order_codes = #{orderCodes,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
<if test="useElectricity != null">
|
||||
use_electricity = #{useElectricity,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="chargeNum != null">
|
||||
charge_num = #{chargeNum,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="chargeTime != null">
|
||||
charge_time = #{chargeTime,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="electricityAmount != null">
|
||||
electricity_amount = #{electricityAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="serviceAmount != null">
|
||||
service_amount = #{serviceAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="totalAmount != null">
|
||||
total_amount = #{totalAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="virtualAmount != null">
|
||||
virtual_amount = #{virtualAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="tradeDate != null">
|
||||
trade_date = #{tradeDate,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="tradeAmount != null">
|
||||
trade_amount = #{tradeAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="tradeFee != null">
|
||||
trade_fee = #{tradeFee,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="delFlag != null">
|
||||
del_flag = #{delFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.jsowell.pile.domain.SettleOrderReport">
|
||||
<!--@mbg.generated-->
|
||||
update settle_order_report
|
||||
set merchant_id = #{merchantId,jdbcType=VARCHAR},
|
||||
station_id = #{stationId,jdbcType=VARCHAR},
|
||||
order_codes = #{orderCodes,jdbcType=LONGVARCHAR},
|
||||
use_electricity = #{useElectricity,jdbcType=DECIMAL},
|
||||
charge_num = #{chargeNum,jdbcType=VARCHAR},
|
||||
charge_time = #{chargeTime,jdbcType=VARCHAR},
|
||||
electricity_amount = #{electricityAmount,jdbcType=DECIMAL},
|
||||
service_amount = #{serviceAmount,jdbcType=DECIMAL},
|
||||
total_amount = #{totalAmount,jdbcType=DECIMAL},
|
||||
virtual_amount = #{virtualAmount,jdbcType=DECIMAL},
|
||||
trade_date = #{tradeDate,jdbcType=VARCHAR},
|
||||
trade_amount = #{tradeAmount,jdbcType=DECIMAL},
|
||||
trade_fee = #{tradeFee,jdbcType=DECIMAL},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
del_flag = #{delFlag,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateBatch" parameterType="java.util.List">
|
||||
<!--@mbg.generated-->
|
||||
update settle_order_report
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<trim prefix="merchant_id = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.merchantId,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="station_id = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.stationId,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="order_codes = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.orderCodes,jdbcType=LONGVARCHAR}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="use_electricity = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.useElectricity,jdbcType=DECIMAL}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="charge_num = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.chargeNum,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="charge_time = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.chargeTime,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="electricity_amount = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.electricityAmount,jdbcType=DECIMAL}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="service_amount = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.serviceAmount,jdbcType=DECIMAL}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="total_amount = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.totalAmount,jdbcType=DECIMAL}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="virtual_amount = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.virtualAmount,jdbcType=DECIMAL}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="trade_date = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.tradeDate,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="trade_amount = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.tradeAmount,jdbcType=DECIMAL}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="trade_fee = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.tradeFee,jdbcType=DECIMAL}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="create_time = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="del_flag = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.delFlag,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</trim>
|
||||
</trim>
|
||||
where id in
|
||||
<foreach close=")" collection="list" item="item" open="(" separator=", ">
|
||||
#{item.id,jdbcType=INTEGER}
|
||||
</foreach>
|
||||
</update>
|
||||
<update id="updateBatchSelective" parameterType="java.util.List">
|
||||
<!--@mbg.generated-->
|
||||
update settle_order_report
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<trim prefix="merchant_id = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.merchantId != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.merchantId,jdbcType=VARCHAR}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="station_id = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.stationId != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.stationId,jdbcType=VARCHAR}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="order_codes = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.orderCodes != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.orderCodes,jdbcType=LONGVARCHAR}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="use_electricity = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.useElectricity != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.useElectricity,jdbcType=DECIMAL}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="charge_num = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.chargeNum != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.chargeNum,jdbcType=VARCHAR}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="charge_time = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.chargeTime != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.chargeTime,jdbcType=VARCHAR}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="electricity_amount = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.electricityAmount != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.electricityAmount,jdbcType=DECIMAL}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="service_amount = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.serviceAmount != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.serviceAmount,jdbcType=DECIMAL}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="total_amount = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.totalAmount != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.totalAmount,jdbcType=DECIMAL}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="virtual_amount = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.virtualAmount != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.virtualAmount,jdbcType=DECIMAL}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="trade_date = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.tradeDate != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.tradeDate,jdbcType=VARCHAR}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="trade_amount = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.tradeAmount != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.tradeAmount,jdbcType=DECIMAL}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="trade_fee = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.tradeFee != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.tradeFee,jdbcType=DECIMAL}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="create_time = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.createTime != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="del_flag = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.delFlag != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.delFlag,jdbcType=VARCHAR}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
</trim>
|
||||
where id in
|
||||
<foreach close=")" collection="list" item="item" open="(" separator=", ">
|
||||
#{item.id,jdbcType=INTEGER}
|
||||
</foreach>
|
||||
</update>
|
||||
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
|
||||
<!--@mbg.generated-->
|
||||
insert into settle_order_report
|
||||
(merchant_id, station_id, order_codes, use_electricity, charge_num, charge_time,
|
||||
electricity_amount, service_amount, total_amount, virtual_amount, trade_date, trade_amount,
|
||||
trade_fee, create_time, del_flag)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.merchantId,jdbcType=VARCHAR}, #{item.stationId,jdbcType=VARCHAR}, #{item.orderCodes,jdbcType=LONGVARCHAR},
|
||||
#{item.useElectricity,jdbcType=DECIMAL}, #{item.chargeNum,jdbcType=VARCHAR}, #{item.chargeTime,jdbcType=VARCHAR},
|
||||
#{item.electricityAmount,jdbcType=DECIMAL}, #{item.serviceAmount,jdbcType=DECIMAL},
|
||||
#{item.totalAmount,jdbcType=DECIMAL}, #{item.virtualAmount,jdbcType=DECIMAL}, #{item.tradeDate,jdbcType=VARCHAR},
|
||||
#{item.tradeAmount,jdbcType=DECIMAL}, #{item.tradeFee,jdbcType=DECIMAL}, #{item.createTime,jdbcType=TIMESTAMP},
|
||||
#{item.delFlag,jdbcType=VARCHAR})
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.SettleOrderReport" useGeneratedKeys="true">
|
||||
<!--@mbg.generated-->
|
||||
insert into settle_order_report
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
merchant_id,
|
||||
station_id,
|
||||
order_codes,
|
||||
use_electricity,
|
||||
charge_num,
|
||||
charge_time,
|
||||
electricity_amount,
|
||||
service_amount,
|
||||
total_amount,
|
||||
virtual_amount,
|
||||
trade_date,
|
||||
trade_amount,
|
||||
trade_fee,
|
||||
create_time,
|
||||
del_flag,
|
||||
</trim>
|
||||
values
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
#{merchantId,jdbcType=VARCHAR},
|
||||
#{stationId,jdbcType=VARCHAR},
|
||||
#{orderCodes,jdbcType=LONGVARCHAR},
|
||||
#{useElectricity,jdbcType=DECIMAL},
|
||||
#{chargeNum,jdbcType=VARCHAR},
|
||||
#{chargeTime,jdbcType=VARCHAR},
|
||||
#{electricityAmount,jdbcType=DECIMAL},
|
||||
#{serviceAmount,jdbcType=DECIMAL},
|
||||
#{totalAmount,jdbcType=DECIMAL},
|
||||
#{virtualAmount,jdbcType=DECIMAL},
|
||||
#{tradeDate,jdbcType=VARCHAR},
|
||||
#{tradeAmount,jdbcType=DECIMAL},
|
||||
#{tradeFee,jdbcType=DECIMAL},
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
#{delFlag,jdbcType=VARCHAR},
|
||||
</trim>
|
||||
on duplicate key update
|
||||
<trim suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id = #{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
merchant_id = #{merchantId,jdbcType=VARCHAR},
|
||||
station_id = #{stationId,jdbcType=VARCHAR},
|
||||
order_codes = #{orderCodes,jdbcType=LONGVARCHAR},
|
||||
use_electricity = #{useElectricity,jdbcType=DECIMAL},
|
||||
charge_num = #{chargeNum,jdbcType=VARCHAR},
|
||||
charge_time = #{chargeTime,jdbcType=VARCHAR},
|
||||
electricity_amount = #{electricityAmount,jdbcType=DECIMAL},
|
||||
service_amount = #{serviceAmount,jdbcType=DECIMAL},
|
||||
total_amount = #{totalAmount,jdbcType=DECIMAL},
|
||||
virtual_amount = #{virtualAmount,jdbcType=DECIMAL},
|
||||
trade_date = #{tradeDate,jdbcType=VARCHAR},
|
||||
trade_amount = #{tradeAmount,jdbcType=DECIMAL},
|
||||
trade_fee = #{tradeFee,jdbcType=DECIMAL},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
del_flag = #{delFlag,jdbcType=VARCHAR},
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.SettleOrderReport" useGeneratedKeys="true">
|
||||
<!--@mbg.generated-->
|
||||
insert into settle_order_report
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="merchantId != null">
|
||||
merchant_id,
|
||||
</if>
|
||||
<if test="stationId != null">
|
||||
station_id,
|
||||
</if>
|
||||
<if test="orderCodes != null">
|
||||
order_codes,
|
||||
</if>
|
||||
<if test="useElectricity != null">
|
||||
use_electricity,
|
||||
</if>
|
||||
<if test="chargeNum != null">
|
||||
charge_num,
|
||||
</if>
|
||||
<if test="chargeTime != null">
|
||||
charge_time,
|
||||
</if>
|
||||
<if test="electricityAmount != null">
|
||||
electricity_amount,
|
||||
</if>
|
||||
<if test="serviceAmount != null">
|
||||
service_amount,
|
||||
</if>
|
||||
<if test="totalAmount != null">
|
||||
total_amount,
|
||||
</if>
|
||||
<if test="virtualAmount != null">
|
||||
virtual_amount,
|
||||
</if>
|
||||
<if test="tradeDate != null">
|
||||
trade_date,
|
||||
</if>
|
||||
<if test="tradeAmount != null">
|
||||
trade_amount,
|
||||
</if>
|
||||
<if test="tradeFee != null">
|
||||
trade_fee,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="delFlag != null">
|
||||
del_flag,
|
||||
</if>
|
||||
</trim>
|
||||
values
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="merchantId != null">
|
||||
#{merchantId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="stationId != null">
|
||||
#{stationId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="orderCodes != null">
|
||||
#{orderCodes,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
<if test="useElectricity != null">
|
||||
#{useElectricity,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="chargeNum != null">
|
||||
#{chargeNum,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="chargeTime != null">
|
||||
#{chargeTime,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="electricityAmount != null">
|
||||
#{electricityAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="serviceAmount != null">
|
||||
#{serviceAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="totalAmount != null">
|
||||
#{totalAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="virtualAmount != null">
|
||||
#{virtualAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="tradeDate != null">
|
||||
#{tradeDate,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="tradeAmount != null">
|
||||
#{tradeAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="tradeFee != null">
|
||||
#{tradeFee,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="delFlag != null">
|
||||
#{delFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
on duplicate key update
|
||||
<trim suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id = #{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="merchantId != null">
|
||||
merchant_id = #{merchantId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="stationId != null">
|
||||
station_id = #{stationId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="orderCodes != null">
|
||||
order_codes = #{orderCodes,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
<if test="useElectricity != null">
|
||||
use_electricity = #{useElectricity,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="chargeNum != null">
|
||||
charge_num = #{chargeNum,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="chargeTime != null">
|
||||
charge_time = #{chargeTime,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="electricityAmount != null">
|
||||
electricity_amount = #{electricityAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="serviceAmount != null">
|
||||
service_amount = #{serviceAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="totalAmount != null">
|
||||
total_amount = #{totalAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="virtualAmount != null">
|
||||
virtual_amount = #{virtualAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="tradeDate != null">
|
||||
trade_date = #{tradeDate,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="tradeAmount != null">
|
||||
trade_amount = #{tradeAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="tradeFee != null">
|
||||
trade_fee = #{tradeFee,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="delFlag != null">
|
||||
del_flag = #{delFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<resultMap type="com.jsowell.pile.domain.SettleOrderReport" id="SettleOrderReportResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="merchantId" column="merchant_id" />
|
||||
<result property="stationId" column="station_id" />
|
||||
<result property="useElectricity" column="use_electricity" />
|
||||
<result property="chargeNum" column="charge_num" />
|
||||
<result property="chargeTime" column="charge_time" />
|
||||
<result property="electricityAmount" column="electricity_amount" />
|
||||
<result property="serviceAmount" column="service_amount" />
|
||||
<result property="totalAmount" column="total_amount" />
|
||||
<result property="virtualAmount" column="virtual_amount" />
|
||||
<result property="tradeDate" column="trade_date" />
|
||||
<result property="tradeAmount" column="trade_amount" />
|
||||
<result property="tradeFee" column="trade_fee" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<resultMap id="SettleOrderReportResult" type="com.jsowell.pile.domain.SettleOrderReport">
|
||||
<result column="id" property="id" />
|
||||
<result column="merchant_id" property="merchantId" />
|
||||
<result column="station_id" property="stationId" />
|
||||
<result column="use_electricity" property="useElectricity" />
|
||||
<result column="charge_num" property="chargeNum" />
|
||||
<result column="charge_time" property="chargeTime" />
|
||||
<result column="electricity_amount" property="electricityAmount" />
|
||||
<result column="service_amount" property="serviceAmount" />
|
||||
<result column="total_amount" property="totalAmount" />
|
||||
<result column="virtual_amount" property="virtualAmount" />
|
||||
<result column="trade_date" property="tradeDate" />
|
||||
<result column="trade_amount" property="tradeAmount" />
|
||||
<result column="trade_fee" property="tradeFee" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="del_flag" property="delFlag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSettleOrderReportVo">
|
||||
select id, merchant_id, station_id, use_electricity, charge_num, charge_time, electricity_amount, service_amount, total_amount, virtual_amount, trade_date, trade_amount, trade_fee, create_time, del_flag from settle_order_report
|
||||
</sql>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, merchant_id, station_id, use_electricity, charge_num, charge_time, electricity_amount, service_amount, total_amount, virtual_amount, trade_date, trade_amount, trade_fee, create_time, del_flag
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from settle_order_report
|
||||
</sql>
|
||||
|
||||
<select id="selectSettleOrderReportList" parameterType="com.jsowell.pile.domain.SettleOrderReport" resultMap="SettleOrderReportResult">
|
||||
<include refid="selectSettleOrderReportVo"/>
|
||||
<include refid="selectSettleOrderReportVo" />
|
||||
<where>
|
||||
<if test="merchantId != null and merchantId != ''"> and merchant_id = #{merchantId}</if>
|
||||
<if test="stationId != null and stationId != ''"> and station_id = #{stationId}</if>
|
||||
@@ -50,7 +707,7 @@
|
||||
</select>
|
||||
|
||||
<select id="selectSettleOrderReportById" parameterType="Long" resultMap="SettleOrderReportResult">
|
||||
<include refid="selectSettleOrderReportVo"/>
|
||||
<include refid="selectSettleOrderReportVo" />
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
@@ -119,7 +776,7 @@
|
||||
|
||||
<delete id="deleteSettleOrderReportByIds" parameterType="String">
|
||||
delete from settle_order_report where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
<foreach close=")" collection="array" item="id" open="(" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
@@ -157,10 +814,18 @@
|
||||
</select>
|
||||
|
||||
<select id="selectByStationIdAndDate" resultMap="SettleOrderReportResult">
|
||||
select <include refid="Base_Column_List"/>
|
||||
select <include refid="Base_Column_List" />
|
||||
from settle_order_report
|
||||
where del_flag = '0'
|
||||
and station_id = #{stationId,jdbcType=VARCHAR}
|
||||
and trade_date = #{date,jdbcType=VARCHAR}
|
||||
</select>
|
||||
|
||||
<select id="selectByMerchantIdAndDate" resultMap="SettleOrderReportResult">
|
||||
select <include refid="Base_Column_List" />
|
||||
from settle_order_report
|
||||
where del_flag = '0'
|
||||
and merchant_id = #{merchantId,jdbcType=VARCHAR}
|
||||
and trade_date = #{date,jdbcType=VARCHAR}
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user