添加新版收银系统支付

This commit is contained in:
韩鹏辉 2024-05-17 10:52:22 +08:00
parent e64bce5e93
commit 9b441ba636
3 changed files with 306 additions and 0 deletions

View File

@ -0,0 +1,26 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbQuickPay;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Mapper
public interface TbQuickPayMapper {
int deleteByPrimaryKey(Integer id);
int insert(TbQuickPay record);
int insertSelective(TbQuickPay record);
TbQuickPay selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(TbQuickPay record);
int updateByPrimaryKey(TbQuickPay record);
List<TbQuickPay> selectByShopIdAndStaffId(@Param("shopId") Integer shopId,@Param("staffId") Integer staffId);
}

View File

@ -0,0 +1,123 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
public class TbQuickPay implements Serializable {
private Integer id;
private Integer staffId;
private Integer shopId;
private String orderNo;
private String payType;
private BigDecimal amount;
private String status;
private String tradeNo;
private Date createTime;
private Date updateTime;
private static final long serialVersionUID = 1L;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getStaffId() {
return staffId;
}
public void setStaffId(Integer staffId) {
this.staffId = staffId;
}
public Integer getShopId() {
return shopId;
}
public void setShopId(Integer shopId) {
this.shopId = shopId;
}
public String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo == null ? null : orderNo.trim();
}
public String getPayType() {
return payType;
}
public void setPayType(String payType) {
this.payType = payType == null ? null : payType.trim();
}
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status == null ? null : status.trim();
}
public String getTradeNo() {
return tradeNo;
}
public void setTradeNo(String tradeNo) {
this.tradeNo = tradeNo == null ? null : tradeNo.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public TbQuickPay(Integer id, Integer staffId, Integer shopId, String orderNo, String payType, BigDecimal amount, String status, String tradeNo, Date createTime, Date updateTime) {
this.id = id;
this.staffId = staffId;
this.shopId = shopId;
this.orderNo = orderNo;
this.payType = payType;
this.amount = amount;
this.status = status;
this.tradeNo = tradeNo;
this.createTime = createTime;
this.updateTime = updateTime;
}
}

View File

@ -0,0 +1,157 @@
<?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.chaozhanggui.system.cashierservice.dao.TbQuickPayMapper">
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbQuickPay">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="staff_id" jdbcType="INTEGER" property="staffId" />
<result column="shop_id" jdbcType="INTEGER" property="shopId" />
<result column="order_no" jdbcType="VARCHAR" property="orderNo" />
<result column="pay_type" jdbcType="VARCHAR" property="payType" />
<result column="amount" jdbcType="DECIMAL" property="amount" />
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="trade_no" jdbcType="VARCHAR" property="tradeNo" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
id, staff_id, shop_id, order_no, pay_type, amount, status, trade_no, create_time,
update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tb_quick_pay
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tb_quick_pay
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbQuickPay" useGeneratedKeys="true" keyProperty="id">
insert into tb_quick_pay (id, staff_id, shop_id,
order_no, pay_type, amount,
status, trade_no, create_time,
update_time)
values (#{id,jdbcType=INTEGER}, #{staffId,jdbcType=INTEGER}, #{shopId,jdbcType=INTEGER},
#{orderNo,jdbcType=VARCHAR}, #{payType,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL},
#{status,jdbcType=VARCHAR}, #{tradeNo,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbQuickPay">
insert into tb_quick_pay
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="staffId != null">
staff_id,
</if>
<if test="shopId != null">
shop_id,
</if>
<if test="orderNo != null">
order_no,
</if>
<if test="payType != null">
pay_type,
</if>
<if test="amount != null">
amount,
</if>
<if test="status != null">
status,
</if>
<if test="tradeNo != null">
trade_no,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="staffId != null">
#{staffId,jdbcType=INTEGER},
</if>
<if test="shopId != null">
#{shopId,jdbcType=INTEGER},
</if>
<if test="orderNo != null">
#{orderNo,jdbcType=VARCHAR},
</if>
<if test="payType != null">
#{payType,jdbcType=VARCHAR},
</if>
<if test="amount != null">
#{amount,jdbcType=DECIMAL},
</if>
<if test="status != null">
#{status,jdbcType=VARCHAR},
</if>
<if test="tradeNo != null">
#{tradeNo,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbQuickPay">
update tb_quick_pay
<set>
<if test="staffId != null">
staff_id = #{staffId,jdbcType=INTEGER},
</if>
<if test="shopId != null">
shop_id = #{shopId,jdbcType=INTEGER},
</if>
<if test="orderNo != null">
order_no = #{orderNo,jdbcType=VARCHAR},
</if>
<if test="payType != null">
pay_type = #{payType,jdbcType=VARCHAR},
</if>
<if test="amount != null">
amount = #{amount,jdbcType=DECIMAL},
</if>
<if test="status != null">
status = #{status,jdbcType=VARCHAR},
</if>
<if test="tradeNo != null">
trade_no = #{tradeNo,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.TbQuickPay">
update tb_quick_pay
set staff_id = #{staffId,jdbcType=INTEGER},
shop_id = #{shopId,jdbcType=INTEGER},
order_no = #{orderNo,jdbcType=VARCHAR},
pay_type = #{payType,jdbcType=VARCHAR},
amount = #{amount,jdbcType=DECIMAL},
status = #{status,jdbcType=VARCHAR},
trade_no = #{tradeNo,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectByShopIdAndStaffId" resultMap="BaseResultMap">
select * from tb_quick_pay where shop_id=#{shopId} and staff_id=#{staffId} and `status`='0' order by id desc
</select>
</mapper>