| @@ -0,0 +1,31 @@ | |||
| CREATE TABLE `wx_car_pay_order` ( | |||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||
| `tenant_id` varchar(5) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '租户ID', | |||
| `parent_tenant_id` varchar(5) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID', | |||
| `create_time` datetime NOT NULL COMMENT '创建时间', | |||
| `update_time` datetime NOT NULL COMMENT '更新时间', | |||
| `c_user_id` bigint(20) NOT NULL COMMENT '用户ID', | |||
| `car_number` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '车牌号', | |||
| `pay_amount` int(11) NOT NULL COMMENT '支付金额(分)', | |||
| `pay_time_start` datetime NOT NULL COMMENT '支付发起时间', | |||
| `pay_time_end` datetime NOT NULL COMMENT '支付结束时间', | |||
| `prepay_id` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '微信预支付交易会话标识-发模板信息使用', | |||
| `transaction_id` varchar(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '微信生成的订单号', | |||
| `pay_vendor` int(11) NOT NULL DEFAULT '0' COMMENT '支付渠道: 0-微信 1-支付宝 2-银联 ', | |||
| `pay_version` smallint(1) DEFAULT NULL COMMENT '支付版本', | |||
| `pay_order_no` varchar(36) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '支付订单号', | |||
| `pay_order_status` int(11) NOT NULL DEFAULT '0' COMMENT '支付状态: 0-支付中;1-支付成功;2-支付失败', | |||
| `pay_param` json DEFAULT NULL COMMENT '额外参数', | |||
| `fail_reason` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '支付失败原因', | |||
| `pay_end_from` smallint(2) DEFAULT NULL COMMENT '支付后结果来源(0:callback, 1:query)', | |||
| `merchant_account` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '商户收款账户', | |||
| `merchant_id` int(20) NOT NULL COMMENT '商户编号', | |||
| `merchant_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '商户名称', | |||
| `amount` int(11) NOT NULL COMMENT '订单金额', | |||
| `free_amount` int(11) NOT NULL DEFAULT '0' COMMENT '优免金额', | |||
| `free_coupon_id` int(20) DEFAULT NULL COMMENT '优免优惠券编号', | |||
| `free_coupon_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '优免优惠券名称', | |||
| PRIMARY KEY (`id`), | |||
| UNIQUE KEY `id_UNIQUE` (`id`), | |||
| UNIQUE KEY `pay_order_no` (`pay_order_no`) | |||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='支付单表'; | |||
| @@ -0,0 +1,67 @@ | |||
| package com.iformall.domain.po; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| import java.util.*; | |||
| @TableName(value = "wx_car_pay_order") | |||
| @Data | |||
| @EqualsAndHashCode(callSuper = true) | |||
| @ToString | |||
| public class WxCarPayOrder extends TenantEntity { | |||
| private static final long serialVersionUID = -5094915301794376964L; | |||
| protected Long id; | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createTime") | |||
| private Date createTime; | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateTime") | |||
| private Date updateTime; | |||
| @io.swagger.annotations.ApiModelProperty(value="用户ID",name="cUserId") | |||
| private Long cUserId; | |||
| @io.swagger.annotations.ApiModelProperty(value="车牌号",name="carNumber") | |||
| private String carNumber; | |||
| @io.swagger.annotations.ApiModelProperty(value="支付金额(分)",name="payAmount") | |||
| private Integer payAmount; | |||
| @io.swagger.annotations.ApiModelProperty(value="支付发起时间",name="payTimeStart") | |||
| private Date payTimeStart; | |||
| @io.swagger.annotations.ApiModelProperty(value="支付结束时间",name="payTimeEnd") | |||
| private Date payTimeEnd; | |||
| @io.swagger.annotations.ApiModelProperty(value="微信预支付交易会话标识",name="prepayId") | |||
| private String prepayId; | |||
| @io.swagger.annotations.ApiModelProperty(value="微信生成的订单号",name="transactionId") | |||
| private String transactionId; | |||
| @io.swagger.annotations.ApiModelProperty(value="支付渠道: 0-微信 1-支付宝 2-银联 ",name="payVendor") | |||
| private Integer payVendor; | |||
| @io.swagger.annotations.ApiModelProperty(value="支付渠道版本EnumPayVersion ",name="payVersion") | |||
| private Integer payVersion; | |||
| @io.swagger.annotations.ApiModelProperty(value="支付订单号",name="payOrderNo") | |||
| private String payOrderNo; | |||
| @io.swagger.annotations.ApiModelProperty(value="支付状态: 0-支付中;1-支付成功;2-支付失败",name="payOrderStatus") | |||
| private Integer payOrderStatus; | |||
| @io.swagger.annotations.ApiModelProperty(value="支付额外参数",name="payParam") | |||
| private String payParam; | |||
| @io.swagger.annotations.ApiModelProperty(value="支付失败原因",name="failReason") | |||
| private String failReason; | |||
| @io.swagger.annotations.ApiModelProperty(value="支付后结果来源(0:callback, 1:query)",name="payEndFrom") | |||
| private Integer payEndFrom; | |||
| @io.swagger.annotations.ApiModelProperty(value="商户收款账户",name="merchantAccount") | |||
| private String merchantAccount; | |||
| @io.swagger.annotations.ApiModelProperty(value="商户编号",name="merchantId") | |||
| private Long merchantId; | |||
| @io.swagger.annotations.ApiModelProperty(value="商户名称",name="merchantName") | |||
| private String merchantName; | |||
| @io.swagger.annotations.ApiModelProperty(value="订单金额(分)",name="amount") | |||
| private Integer amount; | |||
| @io.swagger.annotations.ApiModelProperty(value="优免金额(分)",name="freeAmount") | |||
| private Integer freeAmount; | |||
| @io.swagger.annotations.ApiModelProperty(value="优免券编号",name="freeCouponId") | |||
| private Long freeCouponId; | |||
| @io.swagger.annotations.ApiModelProperty(value="优免券名称",name="freeCouponName") | |||
| private String freeCouponName; | |||
| } | |||
| @@ -0,0 +1,16 @@ | |||
| package com.iformall.mapper; | |||
| import java.util.*; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxCarPayOrder; | |||
| public interface WxCarPayOrderMapper extends CommonMapper<WxCarPayOrder, Long> { | |||
| WxCarPayOrder selectById(@Param("id")Long id,@Param("tenantId")String tenantId); | |||
| List<WxCarPayOrder> findList(WxCarPayOrder wxCarPayOrder); | |||
| } | |||
| @@ -0,0 +1,6 @@ | |||
| package com.iformall.service; | |||
| public interface WxCarPayOrderService { | |||
| } | |||
| @@ -0,0 +1,18 @@ | |||
| package com.iformall.service.impl; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import com.iformall.mapper.WxCarPayOrderMapper; | |||
| import com.iformall.service.WxCarPayOrderService; | |||
| @Service | |||
| public class WxCarPayOrderServiceImpl implements WxCarPayOrderService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| WxCarPayOrderMapper wxCarPayOrderMapper; | |||
| } | |||
| @@ -0,0 +1,146 @@ | |||
| <?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.iformall.mapper.WxCarPayOrderMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCarPayOrder"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | |||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> | |||
| <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> | |||
| <result column="c_user_id" jdbcType="BIGINT" property="cUserId"/> | |||
| <result column="car_number" jdbcType="VARCHAR" property="carNumber"/> | |||
| <result column="pay_amount" jdbcType="INTEGER" property="payAmount"/> | |||
| <result column="pay_time_start" jdbcType="TIMESTAMP" property="payTimeStart"/> | |||
| <result column="pay_time_end" jdbcType="TIMESTAMP" property="payTimeEnd"/> | |||
| <result column="prepay_id" jdbcType="VARCHAR" property="prepayId"/> | |||
| <result column="transaction_id" jdbcType="VARCHAR" property="transactionId"/> | |||
| <result column="pay_vendor" jdbcType="INTEGER" property="payVendor"/> | |||
| <result column="pay_version" jdbcType="INTEGER" property="payVersion"/> | |||
| <result column="pay_order_no" jdbcType="VARCHAR" property="payOrderNo"/> | |||
| <result column="pay_order_status" jdbcType="INTEGER" property="payOrderStatus"/> | |||
| <result column="pay_param" jdbcType="VARCHAR" property="payParam"/> | |||
| <result column="fail_reason" jdbcType="VARCHAR" property="failReason"/> | |||
| <result column="pay_end_from" jdbcType="INTEGER" property="payEndFrom"/> | |||
| <result column="merchant_account" jdbcType="VARCHAR" property="merchantAccount"/> | |||
| <result column="merchant_id" jdbcType="BIGINT" property="merchantId"/> | |||
| <result column="merchant_name" jdbcType="VARCHAR" property="merchantName"/> | |||
| <result column="amount" jdbcType="INTEGER" property="amount"/> | |||
| <result column="free_amount" jdbcType="INTEGER" property="freeAmount"/> | |||
| <result column="free_coupon_id" jdbcType="BIGINT" property="freeCouponId"/> | |||
| <result column="free_coupon_name" jdbcType="VARCHAR" property="freeCouponName"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`c_user_id`,`car_number`,`pay_amount`, | |||
| `pay_time_start`,`pay_time_end`,`prepay_id`,`transaction_id`,`pay_vendor`,`pay_version`,`pay_order_no`, | |||
| `pay_order_status`,`pay_param`,`fail_reason`,`pay_end_from`,`merchant_account`,`merchant_id`,`merchant_name`, | |||
| `amount`,`free_amount`,`free_coupon_id`,`free_coupon_name` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != createTime "> | |||
| and `create_time` = #{createTime} | |||
| </if> | |||
| <if test=" null != updateTime "> | |||
| and `update_time` = #{updateTime} | |||
| </if> | |||
| <if test=" null != cUserId "> | |||
| and `c_user_id` = #{cUserId} | |||
| </if> | |||
| <if test=" null != carNumber "> | |||
| and `car_number` like concat('%', #{carNumber},'%') | |||
| </if> | |||
| <if test=" null != payAmount "> | |||
| and `pay_amount` = #{payAmount} | |||
| </if> | |||
| <if test=" null != payTimeStart "> | |||
| and `pay_time_start` = #{payTimeStart} | |||
| </if> | |||
| <if test=" null != payTimeEnd "> | |||
| and `pay_time_end` = #{payTimeEnd} | |||
| </if> | |||
| <if test=" null != prepayId "> | |||
| and `prepay_id` like concat('%', #{prepayId},'%') | |||
| </if> | |||
| <if test=" null != transactionId "> | |||
| and `transaction_id` like concat('%', #{transactionId},'%') | |||
| </if> | |||
| <if test=" null != payVendor "> | |||
| and `pay_vendor` = #{payVendor} | |||
| </if> | |||
| <if test=" null != payVersion "> | |||
| and `pay_version` = #{payVersion} | |||
| </if> | |||
| <if test=" null != payOrderNo "> | |||
| and `pay_order_no` like concat('%', #{payOrderNo},'%') | |||
| </if> | |||
| <if test=" null != payOrderStatus "> | |||
| and `pay_order_status` = #{payOrderStatus} | |||
| </if> | |||
| <if test=" null != failReason "> | |||
| and `fail_reason` like concat('%', #{failReason},'%') | |||
| </if> | |||
| <if test=" null != merchantAccount "> | |||
| and `merchant_account` like concat('%', #{merchantAccount},'%') | |||
| </if> | |||
| <if test=" null != merchantId "> | |||
| and `merchant_id` = #{merchantId} | |||
| </if> | |||
| <if test=" null != merchantName "> | |||
| and `merchant_name` like concat('%', #{merchantName},'%') | |||
| </if> | |||
| <if test=" null != freeCouponId "> | |||
| and `free_coupon_id` = #{freeCouponId} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="selectById" parameterType="java.util.HashMap" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns"/> from wx_car_pay_order where id = #{id} and tenant_id = #{tenantId} | |||
| </select> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxPayOrder" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_car_pay_order | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| </mapper> | |||