Browse Source

[POS][修改]:POS订单及POS支付订单添加

release_toaliyun_real
Stormeye Wu 6 years ago
parent
commit
5c27fe8745
14 changed files with 718 additions and 1 deletions
  1. +39
    -0
      mallinkAdmin/src/main/resources/db/migration/V201908221020__POS_ORDER.sql
  2. +71
    -0
      mallinkBApi/src/main/java/com/iformall/controller/PosOrderController.java
  3. +73
    -0
      mallinkBApi/src/main/java/com/iformall/controller/PosPayOrderController.java
  4. +1
    -1
      mallinkBApi/src/main/java/com/iformall/controller/WxPosController.java
  5. +39
    -0
      mallinkService/src/main/java/com/iformall/domain/po/PosOrder.java
  6. +69
    -0
      mallinkService/src/main/java/com/iformall/domain/po/PosPayOrder.java
  7. +17
    -0
      mallinkService/src/main/java/com/iformall/mapper/PosOrderMapper.java
  8. +17
    -0
      mallinkService/src/main/java/com/iformall/mapper/PosPayOrderMapper.java
  9. +48
    -0
      mallinkService/src/main/java/com/iformall/service/PosOrderService.java
  10. +48
    -0
      mallinkService/src/main/java/com/iformall/service/PosPayOrderService.java
  11. +54
    -0
      mallinkService/src/main/java/com/iformall/service/impl/PosOrderServiceImpl.java
  12. +54
    -0
      mallinkService/src/main/java/com/iformall/service/impl/PosPayOrderServiceImpl.java
  13. +64
    -0
      mallinkService/src/main/resources/mapper/PosOrderMapper.xml
  14. +124
    -0
      mallinkService/src/main/resources/mapper/PosPayOrderMapper.xml

+ 39
- 0
mallinkAdmin/src/main/resources/db/migration/V201908221020__POS_ORDER.sql View File

@@ -0,0 +1,39 @@
create table `pos_order` (
`id` bigint(20) NOT NULL COMMENT '主键ID',
`tenant_id` varchar(10) NOT NULL COMMENT '租户ID',
`pos_order_no` varchar(20) NULL COMMENT 'POS订单ID',
`type` tinyint(6) NOT NULL DEFAULT 0 COMMENT '支付类型(1: 独立核销, 2:支付)',
`order_status` tinyint(6) NOT NULL DEFAULT '0' COMMENT '订单状态:0-待付款;1-已支付;2-已取消(限定时间内未付款);3-待退款;4-已退款;5-退款失败',
`bu_user_id` bigint(20) DEFAULT NULL COMMENT 'b端用户',
`create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='POS订单';

CREATE TABLE `pos_pay_order` (
`id` bigint(20) NOT NULL COMMENT '主键ID',
`tenant_id` varchar(10) NOT NULL COMMENT '租户ID',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_time` datetime NOT NULL COMMENT '更新时间',
`order_id` bigint(20) NOT NULL COMMENT '订单ID',
`bu_user_id` bigint(20) DEFAULT NULL COMMENT 'b端用户',
`type` tinyint(6) NOT NULL DEFAULT 0 COMMENT '支付类型(1:独立核销 2:支付核销 3:现金支付)',
`pay_from` tinyint(6) NOT NULL DEFAULT 0 COMMENT '支付来源(0: 现金, 1:微信 2:支付核销 3:现金支付)',
`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) DEFAULT NULL COMMENT '微信预支付交易会话标识-发模板信息使用',
`transaction_id` varchar(36) DEFAULT NULL COMMENT '微信生成的订单号',
`pay_vendor` int(11) NOT NULL DEFAULT 0 COMMENT '支付渠道: 0-微信 1-支付宝 2-银联 ',
`pay_order_no` varchar(36) DEFAULT '' COMMENT '支付订单号',
`pay_order_status` int(11) NOT NULL DEFAULT 0 COMMENT '支付状态: 0-支付中;1-支付成功;2-支付失败',
`share` smallint(2) DEFAULT NULL COMMENT '是否支持分账(0:不支持,1:支持)',
`share_amount` int(11) DEFAULT NULL COMMENT '分账金额(总金额扣掉手续费后的金额)',
`rate_amount` int(11) DEFAULT NULL COMMENT '分账实际通道费',
`fail_reason` varchar(50) DEFAULT '' COMMENT '支付失败原因',
`auth_code` varchar(128) DEFAULT NULL COMMENT '扫码支付授权码',
`open_id` varchar(128) DEFAULT NULL COMMENT '微信支付后获取的open_id',
`pay_end_from` smallint(2) DEFAULT NULL COMMENT '支付后结果来源(0:callback, 1:query)',
PRIMARY KEY (`id`),
UNIQUE `id_UNIQUE` USING BTREE (`id`) comment ''
) ENGINE=`InnoDB` DEFAULT CHARSET=utf8mb4 COMMENT='POS支付订单';

+ 71
- 0
mallinkBApi/src/main/java/com/iformall/controller/PosOrderController.java View File

@@ -0,0 +1,71 @@
package com.iformall.controller;

import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.iformall.common.Result;
import com.iformall.common.ResultData;

import com.iformall.domain.po.PosOrder;
import com.iformall.service.PosOrderService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;


@RestController
@RequestMapping("/api/posOrder")
@AllArgsConstructor
@Api(description = "POS订单接口")
public class PosOrderController extends BaseController {
private final Logger logger = LoggerFactory.getLogger(this.getClass());

private final PosOrderService posOrderService;
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute PosOrder posOrder,Integer pageNum, Integer pageSize) {
if (null == posOrder) posOrder = new PosOrder();
final PageInfo<PosOrder> page = posOrderService.listAsPage(posOrder, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增POS订单接口")
@PostMapping("add")
public ResultData add(@RequestBody PosOrder posOrder) {
posOrderService.saveOrUpdate(posOrder);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody PosOrder posOrder) {
posOrderService.saveOrUpdate(posOrder);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
posOrderService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",posOrderService.getById(id));
}
}

+ 73
- 0
mallinkBApi/src/main/java/com/iformall/controller/PosPayOrderController.java View File

@@ -0,0 +1,73 @@
package com.iformall.controller;

import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.iformall.common.Result;
import com.iformall.common.ResultData;

import com.iformall.domain.po.PosPayOrder;
import com.iformall.service.PosPayOrderService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("/api/posPayOrder")
@AllArgsConstructor
@Api(description = "POS支付订单接口")
public class PosPayOrderController extends BaseController {
private final Logger logger = LoggerFactory.getLogger(this.getClass());

private final PosPayOrderService posPayOrderService;

@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute PosPayOrder posPayOrder,Integer pageNum, Integer pageSize) {
if (null == posPayOrder) posPayOrder = new PosPayOrder();
final PageInfo<PosPayOrder> page = posPayOrderService.listAsPage(posPayOrder, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增POS订单接口")
@PostMapping("add")
public ResultData add(@RequestBody PosPayOrder posPayOrder) {
//Assert.notNull(posPayOrder.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
posPayOrderService.saveOrUpdate(posPayOrder);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody PosPayOrder posPayOrder) {
posPayOrderService.saveOrUpdate(posPayOrder);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
posPayOrderService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",posPayOrderService.getById(id));
}
}

+ 1
- 1
mallinkBApi/src/main/java/com/iformall/controller/WxPosController.java View File

@@ -22,7 +22,7 @@ import java.util.Map;

@RestController
@RequestMapping("/api/pos")
@Api(description = "卡券相关接口")
@Api(description = "POS服务相关接口")
public class WxPosController extends BaseController {
private final Logger logger = LoggerFactory.getLogger(this.getClass());



+ 39
- 0
mallinkService/src/main/java/com/iformall/domain/po/PosOrder.java View File

@@ -0,0 +1,39 @@
package com.iformall.domain.po;

import lombok.Data;
import javax.persistence.*;
import java.util.*;
import java.math.*;
import javax.persistence.Transient;
import java.util.List;
import javax.persistence.Id;
import java.io.Serializable;

@Table(name = "pos_order")
@Data
public class PosOrder implements Serializable {
private static final long serialVersionUID = 1L;
@Id
protected Long id;
@Transient
protected List<Long> ids;
@io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId")
private String tenantId;
@io.swagger.annotations.ApiModelProperty(value="POS订单ID",name="posOrderNo")
private String posOrderNo;
@io.swagger.annotations.ApiModelProperty(value="支付类型(1: 独立核销, 2:支付)",name="type")
private Integer type;
@io.swagger.annotations.ApiModelProperty(value="订单状态:0-待付款;1-已支付;2-已取消(限定时间内未付款);3-待退款;4-已退款;5-退款失败",name="orderStatus")
private Integer orderStatus;
@io.swagger.annotations.ApiModelProperty(value="b端用户",name="buUserId")
private Long buUserId;
@io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate")
private Date createDate;
@io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate")
private Date updateDate;


}

+ 69
- 0
mallinkService/src/main/java/com/iformall/domain/po/PosPayOrder.java View File

@@ -0,0 +1,69 @@
package com.iformall.domain.po;

import lombok.Data;
import javax.persistence.*;
import java.util.*;
import java.math.*;
import javax.persistence.Transient;
import java.util.List;
import javax.persistence.Id;
import java.io.Serializable;

@Table(name = "pos_pay_order")
@Data
public class PosPayOrder implements Serializable {
private static final long serialVersionUID = 1L;
@Id
protected Long id;
@Transient
protected List<Long> ids;
@io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId")
private String tenantId;
@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="orderId")
private Long orderId;
@io.swagger.annotations.ApiModelProperty(value="b端用户",name="buUserId")
private Long buUserId;
@io.swagger.annotations.ApiModelProperty(value="支付类型(1:独立核销 2:支付核销 3:现金支付)",name="type")
private Integer type;
@io.swagger.annotations.ApiModelProperty(value="支付来源(0: 现金, 1:微信 2:支付核销 3:现金支付)",name="payFrom")
private Integer payFrom;
@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="支付订单号",name="payOrderNo")
private String payOrderNo;
@io.swagger.annotations.ApiModelProperty(value="支付状态: 0-支付中;1-支付成功;2-支付失败",name="payOrderStatus")
private Integer payOrderStatus;
@io.swagger.annotations.ApiModelProperty(value="是否支持分账(0:不支持,1:支持)",name="share")
private Integer share;
@io.swagger.annotations.ApiModelProperty(value="分账金额(总金额扣掉手续费后的金额)",name="shareAmount")
private Integer shareAmount;
@io.swagger.annotations.ApiModelProperty(value="分账实际通道费",name="rateAmount")
private Integer rateAmount;
@io.swagger.annotations.ApiModelProperty(value="支付失败原因",name="failReason")
private String failReason;
@io.swagger.annotations.ApiModelProperty(value="扫码支付授权码",name="authCode")
private String authCode;
@io.swagger.annotations.ApiModelProperty(value="微信支付后获取的open_id",name="openId")
private String openId;
@io.swagger.annotations.ApiModelProperty(value="支付后结果来源(0:callback, 1:query)",name="payEndFrom")
private Integer payEndFrom;


}

+ 17
- 0
mallinkService/src/main/java/com/iformall/mapper/PosOrderMapper.java View File

@@ -0,0 +1,17 @@
package com.iformall.mapper;

import java.util.*;
import com.iformall.common.CommonMapper;
import org.apache.ibatis.annotations.Param;
import com.iformall.domain.po.PosOrder;

public interface PosOrderMapper extends CommonMapper<PosOrder, Long> {

List<PosOrder> findList(PosOrder posOrder);

}

+ 17
- 0
mallinkService/src/main/java/com/iformall/mapper/PosPayOrderMapper.java View File

@@ -0,0 +1,17 @@
package com.iformall.mapper;

import java.util.*;
import com.iformall.common.CommonMapper;
import org.apache.ibatis.annotations.Param;
import com.iformall.domain.po.PosPayOrder;

public interface PosPayOrderMapper extends CommonMapper<PosPayOrder, Long> {

List<PosPayOrder> findList(PosPayOrder posPayOrder);

}

+ 48
- 0
mallinkService/src/main/java/com/iformall/service/PosOrderService.java View File

@@ -0,0 +1,48 @@
package com.iformall.service;

import java.util.*;
import com.github.pagehelper.PageInfo;
import com.iformall.domain.po.PosOrder;

public interface PosOrderService {

/**
* 根据实体查询分页列表
*
* @param record
* @param pageIndex
* @param pageSize
* @return
*/
PageInfo<PosOrder> listAsPage(PosOrder record, Integer pageIndex, Integer pageSize);
/**
* 根据Id获得实体
*
* @param id
* @return
*/
PosOrder getById(Long id);
/**
* 保存或更新实体
*
* @param record
*/
void saveOrUpdate(PosOrder record);

/**
* 根据Id删除实体
*
* @param id
*/
void deleteById(Long id);

}

+ 48
- 0
mallinkService/src/main/java/com/iformall/service/PosPayOrderService.java View File

@@ -0,0 +1,48 @@
package com.iformall.service;

import java.util.*;
import com.github.pagehelper.PageInfo;
import com.iformall.domain.po.PosPayOrder;

public interface PosPayOrderService {

/**
* 根据实体查询分页列表
*
* @param record
* @param pageIndex
* @param pageSize
* @return
*/
PageInfo<PosPayOrder> listAsPage(PosPayOrder record, Integer pageIndex, Integer pageSize);
/**
* 根据Id获得实体
*
* @param id
* @return
*/
PosPayOrder getById(Long id);
/**
* 保存或更新实体
*
* @param record
*/
void saveOrUpdate(PosPayOrder record);

/**
* 根据Id删除实体
*
* @param id
*/
void deleteById(Long id);

}

+ 54
- 0
mallinkService/src/main/java/com/iformall/service/impl/PosOrderServiceImpl.java View File

@@ -0,0 +1,54 @@
package com.iformall.service.impl;

import java.util.*;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.iformall.domain.po.PosOrder;
import com.iformall.mapper.PosOrderMapper;
import com.iformall.service.PosOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.iformall.common.IdWorker;

@Service
public class PosOrderServiceImpl implements PosOrderService {
@Autowired
PosOrderMapper posOrderMapper;


@Override
public PageInfo<PosOrder> listAsPage(PosOrder record, Integer pageIndex, Integer pageSize) {
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> posOrderMapper.findList(record));
}

@Override
public PosOrder getById(Long id) {
return posOrderMapper.selectByPrimaryKey(id);
}

@Override
public void saveOrUpdate(PosOrder record) {
if (record.getId() == null) {
//record.setId(UUID.randomUUID().toString().replaceAll("-", ""));
final IdWorker idWorker = IdWorker.get();
record.setId(idWorker.nextId());
posOrderMapper.insertSelective(record);
} else {
posOrderMapper.updateByPrimaryKeySelective(record);
}
}

@Override
public void deleteById(Long id) {
posOrderMapper.deleteByPrimaryKey(id);
}
}

+ 54
- 0
mallinkService/src/main/java/com/iformall/service/impl/PosPayOrderServiceImpl.java View File

@@ -0,0 +1,54 @@
package com.iformall.service.impl;

import java.util.*;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.iformall.domain.po.PosPayOrder;
import com.iformall.mapper.PosPayOrderMapper;
import com.iformall.service.PosPayOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.iformall.common.IdWorker;

@Service
public class PosPayOrderServiceImpl implements PosPayOrderService {
@Autowired
PosPayOrderMapper posPayOrderMapper;


@Override
public PageInfo<PosPayOrder> listAsPage(PosPayOrder record, Integer pageIndex, Integer pageSize) {
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> posPayOrderMapper.findList(record));
}

@Override
public PosPayOrder getById(Long id) {
return posPayOrderMapper.selectByPrimaryKey(id);
}

@Override
public void saveOrUpdate(PosPayOrder record) {
if (record.getId() == null) {
//record.setId(UUID.randomUUID().toString().replaceAll("-", ""));
final IdWorker idWorker = IdWorker.get();
record.setId(idWorker.nextId());
posPayOrderMapper.insertSelective(record);
} else {
posPayOrderMapper.updateByPrimaryKeySelective(record);
}
}

@Override
public void deleteById(Long id) {
posPayOrderMapper.deleteByPrimaryKey(id);
}
}

+ 64
- 0
mallinkService/src/main/resources/mapper/PosOrderMapper.xml View File

@@ -0,0 +1,64 @@
<?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.PosOrderMapper">
<resultMap id="BaseResultMap" type="com.iformall.domain.po.PosOrder">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
<result column="pos_order_no" jdbcType="VARCHAR" property="posOrderNo" />
<result column="type" jdbcType="INTEGER" property="type" />
<result column="order_status" jdbcType="INTEGER" property="orderStatus" />
<result column="bu_user_id" jdbcType="BIGINT" property="buUserId" />
<result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
</resultMap>
<sql id="allColumns">
`id`,`tenant_id`,`pos_order_no`,`type`,`order_status`,`bu_user_id`,`create_date`,`update_date`
</sql>

<sql id="dynamicWhereConditions">
where 1 = 1
<if test=" null != id ">
and `id` = #{id}
</if>
<if test=" null != tenantId ">
and `tenant_id` like concat('%', #{tenantId},'%')
</if>
<if test=" null != posOrderNo ">
and `pos_order_no` like concat('%', #{posOrderNo},'%')
</if>
<if test=" null != type ">
and `type` = #{type}
</if>
<if test=" null != orderStatus ">
and `order_status` = #{orderStatus}
</if>
<if test=" null != buUserId ">
and `bu_user_id` = #{buUserId}
</if>
<if test=" null != createDate ">
and `create_date` = #{createDate}
</if>
<if test=" null != updateDate ">
and `update_date` = #{updateDate}
</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="findList" parameterType="com.iformall.domain.po.PosOrder" resultMap="BaseResultMap">
select <include refid="allColumns" /> from pos_order
<include refid="dynamicWhereConditions" />
</select>
</mapper>

+ 124
- 0
mallinkService/src/main/resources/mapper/PosPayOrderMapper.xml View File

@@ -0,0 +1,124 @@
<?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.PosPayOrderMapper">
<resultMap id="BaseResultMap" type="com.iformall.domain.po.PosPayOrder">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="order_id" jdbcType="BIGINT" property="orderId" />
<result column="bu_user_id" jdbcType="BIGINT" property="buUserId" />
<result column="type" jdbcType="INTEGER" property="type" />
<result column="pay_from" jdbcType="INTEGER" property="payFrom" />
<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_order_no" jdbcType="VARCHAR" property="payOrderNo" />
<result column="pay_order_status" jdbcType="INTEGER" property="payOrderStatus" />
<result column="share" jdbcType="INTEGER" property="share" />
<result column="share_amount" jdbcType="INTEGER" property="shareAmount" />
<result column="rate_amount" jdbcType="INTEGER" property="rateAmount" />
<result column="fail_reason" jdbcType="VARCHAR" property="failReason" />
<result column="auth_code" jdbcType="VARCHAR" property="authCode" />
<result column="open_id" jdbcType="VARCHAR" property="openId" />
<result column="pay_end_from" jdbcType="INTEGER" property="payEndFrom" />
</resultMap>
<sql id="allColumns">
`id`,`tenant_id`,`create_time`,`update_time`,`order_id`,`bu_user_id`,`type`,`pay_from`,`pay_amount`,`pay_time_start`,`pay_time_end`,`prepay_id`,`transaction_id`,`pay_vendor`,`pay_order_no`,`pay_order_status`,`share`,`share_amount`,`rate_amount`,`fail_reason`,`auth_code`,`open_id`,`pay_end_from`
</sql>

<sql id="dynamicWhereConditions">
where 1 = 1
<if test=" null != id ">
and `id` = #{id}
</if>
<if test=" null != tenantId ">
and `tenant_id` like concat('%', #{tenantId},'%')
</if>
<if test=" null != createTime ">
and `create_time` = #{createTime}
</if>
<if test=" null != updateTime ">
and `update_time` = #{updateTime}
</if>
<if test=" null != orderId ">
and `order_id` = #{orderId}
</if>
<if test=" null != buUserId ">
and `bu_user_id` = #{buUserId}
</if>
<if test=" null != type ">
and `type` = #{type}
</if>
<if test=" null != payFrom ">
and `pay_from` = #{payFrom}
</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 != payOrderNo ">
and `pay_order_no` like concat('%', #{payOrderNo},'%')
</if>
<if test=" null != payOrderStatus ">
and `pay_order_status` = #{payOrderStatus}
</if>
<if test=" null != share ">
and `share` = #{share}
</if>
<if test=" null != shareAmount ">
and `share_amount` = #{shareAmount}
</if>
<if test=" null != rateAmount ">
and `rate_amount` = #{rateAmount}
</if>
<if test=" null != failReason ">
and `fail_reason` like concat('%', #{failReason},'%')
</if>
<if test=" null != authCode ">
and `auth_code` like concat('%', #{authCode},'%')
</if>
<if test=" null != openId ">
and `open_id` like concat('%', #{openId},'%')
</if>
<if test=" null != payEndFrom ">
and `pay_end_from` = #{payEndFrom}
</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="findList" parameterType="com.iformall.domain.po.PosPayOrder" resultMap="BaseResultMap">
select <include refid="allColumns" /> from pos_pay_order
<include refid="dynamicWhereConditions" />
</select>
</mapper>

Loading…
Cancel
Save