mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
新增 订单保险信息相关实体类、Service、Mapper
This commit is contained in:
@@ -0,0 +1,101 @@
|
||||
package com.jsowell.pile.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 订单保险信息对象 order_insurance_info
|
||||
*
|
||||
* @author jsowell
|
||||
* @date 2025-09-05
|
||||
*/
|
||||
public class OrderInsuranceInfo extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* $column.columnComment
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 保险交易流水号
|
||||
*/
|
||||
@Excel(name = "保险交易流水号")
|
||||
private String insuranceTransactionCode;
|
||||
|
||||
/**
|
||||
* 关联订单号
|
||||
*/
|
||||
@Excel(name = "关联订单号")
|
||||
private String orderCode;
|
||||
|
||||
/**
|
||||
* 保险支付金额
|
||||
*/
|
||||
@Excel(name = "保险支付金额")
|
||||
private BigDecimal tradeAmount;
|
||||
|
||||
/**
|
||||
* 删除标识(0-否;1-是)
|
||||
*/
|
||||
private String delFlag;
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setInsuranceTransactionCode(String insuranceTransactionCode) {
|
||||
this.insuranceTransactionCode = insuranceTransactionCode;
|
||||
}
|
||||
|
||||
public String getInsuranceTransactionCode() {
|
||||
return insuranceTransactionCode;
|
||||
}
|
||||
|
||||
public void setOrderCode(String orderCode) {
|
||||
this.orderCode = orderCode;
|
||||
}
|
||||
|
||||
public String getOrderCode() {
|
||||
return orderCode;
|
||||
}
|
||||
|
||||
public void setTradeAmount(BigDecimal tradeAmount) {
|
||||
this.tradeAmount = tradeAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getTradeAmount() {
|
||||
return tradeAmount;
|
||||
}
|
||||
|
||||
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("insuranceTransactionCode", getInsuranceTransactionCode())
|
||||
.append("orderCode", getOrderCode())
|
||||
.append("tradeAmount", getTradeAmount())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("delFlag", getDelFlag())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -37,6 +37,11 @@ public class PayOrderDTO extends BaseDTO{
|
||||
*/
|
||||
private BigDecimal payAmount;
|
||||
|
||||
/**
|
||||
* 保险金额
|
||||
*/
|
||||
private BigDecimal insuranceAmount;
|
||||
|
||||
/**
|
||||
* @see ScenarioEnum
|
||||
* 支付场景
|
||||
|
||||
@@ -23,6 +23,11 @@ public class PayOrderSuccessCallbackDTO {
|
||||
*/
|
||||
private BigDecimal payAmount;
|
||||
|
||||
/**
|
||||
* 保险金额
|
||||
*/
|
||||
private BigDecimal insuranceAmount;
|
||||
|
||||
/**
|
||||
* 支付方式
|
||||
* 1-余额支付;2-微信支付;3-支付宝支付
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.jsowell.pile.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jsowell.pile.domain.OrderInsuranceInfo;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 订单保险信息Mapper接口
|
||||
*
|
||||
* @author jsowell
|
||||
* @date 2025-09-05
|
||||
*/
|
||||
@Repository
|
||||
public interface OrderInsuranceInfoMapper {
|
||||
/**
|
||||
* 查询订单保险信息
|
||||
*
|
||||
* @param id 订单保险信息主键
|
||||
* @return 订单保险信息
|
||||
*/
|
||||
public OrderInsuranceInfo selectOrderInsuranceInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询订单保险信息列表
|
||||
*
|
||||
* @param orderInsuranceInfo 订单保险信息
|
||||
* @return 订单保险信息集合
|
||||
*/
|
||||
public List<OrderInsuranceInfo> selectOrderInsuranceInfoList(OrderInsuranceInfo orderInsuranceInfo);
|
||||
|
||||
/**
|
||||
* 新增订单保险信息
|
||||
*
|
||||
* @param orderInsuranceInfo 订单保险信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertOrderInsuranceInfo(OrderInsuranceInfo orderInsuranceInfo);
|
||||
|
||||
/**
|
||||
* 修改订单保险信息
|
||||
*
|
||||
* @param orderInsuranceInfo 订单保险信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateOrderInsuranceInfo(OrderInsuranceInfo orderInsuranceInfo);
|
||||
|
||||
/**
|
||||
* 删除订单保险信息
|
||||
*
|
||||
* @param id 订单保险信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteOrderInsuranceInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除订单保险信息
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteOrderInsuranceInfoByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.jsowell.pile.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jsowell.pile.domain.OrderInsuranceInfo;
|
||||
|
||||
/**
|
||||
* 订单保险信息Service接口
|
||||
*
|
||||
* @author jsowell
|
||||
* @date 2025-09-05
|
||||
*/
|
||||
public interface IOrderInsuranceInfoService {
|
||||
/**
|
||||
* 查询订单保险信息
|
||||
*
|
||||
* @param id 订单保险信息主键
|
||||
* @return 订单保险信息
|
||||
*/
|
||||
public OrderInsuranceInfo selectOrderInsuranceInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询订单保险信息列表
|
||||
*
|
||||
* @param orderInsuranceInfo 订单保险信息
|
||||
* @return 订单保险信息集合
|
||||
*/
|
||||
public List<OrderInsuranceInfo> selectOrderInsuranceInfoList(OrderInsuranceInfo orderInsuranceInfo);
|
||||
|
||||
/**
|
||||
* 新增订单保险信息
|
||||
*
|
||||
* @param orderInsuranceInfo 订单保险信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertOrderInsuranceInfo(OrderInsuranceInfo orderInsuranceInfo);
|
||||
|
||||
/**
|
||||
* 修改订单保险信息
|
||||
*
|
||||
* @param orderInsuranceInfo 订单保险信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateOrderInsuranceInfo(OrderInsuranceInfo orderInsuranceInfo);
|
||||
|
||||
/**
|
||||
* 批量删除订单保险信息
|
||||
*
|
||||
* @param ids 需要删除的订单保险信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteOrderInsuranceInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除订单保险信息信息
|
||||
*
|
||||
* @param id 订单保险信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteOrderInsuranceInfoById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package com.jsowell.pile.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.jsowell.pile.mapper.OrderInsuranceInfoMapper;
|
||||
import com.jsowell.pile.domain.OrderInsuranceInfo;
|
||||
import com.jsowell.pile.service.IOrderInsuranceInfoService;
|
||||
|
||||
/**
|
||||
* 订单保险信息Service业务层处理
|
||||
*
|
||||
* @author jsowell
|
||||
* @date 2025-09-05
|
||||
*/
|
||||
@Service
|
||||
public class OrderInsuranceInfoServiceImpl implements IOrderInsuranceInfoService {
|
||||
@Autowired
|
||||
private OrderInsuranceInfoMapper orderInsuranceInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询订单保险信息
|
||||
*
|
||||
* @param id 订单保险信息主键
|
||||
* @return 订单保险信息
|
||||
*/
|
||||
@Override
|
||||
public OrderInsuranceInfo selectOrderInsuranceInfoById(Long id) {
|
||||
return orderInsuranceInfoMapper.selectOrderInsuranceInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单保险信息列表
|
||||
*
|
||||
* @param orderInsuranceInfo 订单保险信息
|
||||
* @return 订单保险信息
|
||||
*/
|
||||
@Override
|
||||
public List<OrderInsuranceInfo> selectOrderInsuranceInfoList(OrderInsuranceInfo orderInsuranceInfo) {
|
||||
return orderInsuranceInfoMapper.selectOrderInsuranceInfoList(orderInsuranceInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增订单保险信息
|
||||
*
|
||||
* @param orderInsuranceInfo 订单保险信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertOrderInsuranceInfo(OrderInsuranceInfo orderInsuranceInfo) {
|
||||
orderInsuranceInfo.setCreateTime(DateUtils.getNowDate());
|
||||
return orderInsuranceInfoMapper.insertOrderInsuranceInfo(orderInsuranceInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单保险信息
|
||||
*
|
||||
* @param orderInsuranceInfo 订单保险信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateOrderInsuranceInfo(OrderInsuranceInfo orderInsuranceInfo) {
|
||||
orderInsuranceInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
return orderInsuranceInfoMapper.updateOrderInsuranceInfo(orderInsuranceInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除订单保险信息
|
||||
*
|
||||
* @param ids 需要删除的订单保险信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteOrderInsuranceInfoByIds(Long[] ids) {
|
||||
return orderInsuranceInfoMapper.deleteOrderInsuranceInfoByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单保险信息信息
|
||||
*
|
||||
* @param id 订单保险信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteOrderInsuranceInfoById(Long id) {
|
||||
return orderInsuranceInfoMapper.deleteOrderInsuranceInfoById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
<?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.OrderInsuranceInfoMapper">
|
||||
|
||||
<resultMap type="com.jsowell.pile.domain.OrderInsuranceInfo" id="OrderInsuranceInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="insuranceTransactionCode" column="insurance_transaction_code" />
|
||||
<result property="orderCode" column="order_code" />
|
||||
<result property="tradeAmount" column="trade_amount" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectOrderInsuranceInfoVo">
|
||||
select id, insurance_transaction_code, order_code, trade_amount, create_time, create_by, update_time, update_by, del_flag from order_insurance_info
|
||||
</sql>
|
||||
|
||||
<select id="selectOrderInsuranceInfoList" parameterType="com.jsowell.pile.domain.OrderInsuranceInfo" resultMap="OrderInsuranceInfoResult">
|
||||
<include refid="selectOrderInsuranceInfoVo"/>
|
||||
<where>
|
||||
<if test="insuranceTransactionCode != null and insuranceTransactionCode != ''"> and insurance_transaction_code = #{insuranceTransactionCode}</if>
|
||||
<if test="orderCode != null and orderCode != ''"> and order_code = #{orderCode}</if>
|
||||
<if test="tradeAmount != null "> and trade_amount = #{tradeAmount}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectOrderInsuranceInfoById" parameterType="Long" resultMap="OrderInsuranceInfoResult">
|
||||
<include refid="selectOrderInsuranceInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertOrderInsuranceInfo" parameterType="com.jsowell.pile.domain.OrderInsuranceInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into order_insurance_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="insuranceTransactionCode != null">insurance_transaction_code,</if>
|
||||
<if test="orderCode != null">order_code,</if>
|
||||
<if test="tradeAmount != null">trade_amount,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="insuranceTransactionCode != null">#{insuranceTransactionCode},</if>
|
||||
<if test="orderCode != null">#{orderCode},</if>
|
||||
<if test="tradeAmount != null">#{tradeAmount},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateOrderInsuranceInfo" parameterType="com.jsowell.pile.domain.OrderInsuranceInfo">
|
||||
update order_insurance_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="insuranceTransactionCode != null">insurance_transaction_code = #{insuranceTransactionCode},</if>
|
||||
<if test="orderCode != null">order_code = #{orderCode},</if>
|
||||
<if test="tradeAmount != null">trade_amount = #{tradeAmount},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteOrderInsuranceInfoById" parameterType="Long">
|
||||
delete from order_insurance_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteOrderInsuranceInfoByIds" parameterType="String">
|
||||
delete from order_insurance_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user