霸王餐查询修改接口
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
package cn.ysk.cashier.mybatis.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.Instant;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class TbFreeDineConfig {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id", nullable = false)
|
||||
private Integer id;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "enable", nullable = false)
|
||||
private Boolean enable = false;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "recharge_times", nullable = false)
|
||||
private Integer rechargeTimes;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "recharge_threshold", nullable = false, precision = 10, scale = 2)
|
||||
private BigDecimal rechargeThreshold;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "with_coupon", nullable = false)
|
||||
private Boolean withCoupon = false;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "with_points", nullable = false)
|
||||
private Boolean withPoints = false;
|
||||
|
||||
@Size(max = 500)
|
||||
@Column(name = "recharge_desc", length = 500)
|
||||
private String rechargeDesc;
|
||||
|
||||
@Size(max = 255)
|
||||
@Column(name = "use_type")
|
||||
private String useType;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "shop_id", nullable = false)
|
||||
private Integer shopId;
|
||||
|
||||
@Column(name = "create_time")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
|
||||
@Column(name = "update_time")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date updateTime;
|
||||
|
||||
@Size(max = 255)
|
||||
@Column(name = "child_shop_id_list")
|
||||
private String childShopIdList;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<String> useTypeList;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package cn.ysk.cashier.mybatis.mapper;
|
||||
|
||||
import cn.ysk.cashier.mybatis.entity.TbFreeDineConfig;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
* @description 针对表【tb_free_dine_config(霸王餐配置信息表)】的数据库操作Mapper
|
||||
* @createDate 2024-10-22 14:49:18
|
||||
* @Entity cn.ysk.cashier.mybatis.entity.TbFreeDineConfig
|
||||
*/
|
||||
public interface TbFreeDineConfigMapper extends BaseMapper<TbFreeDineConfig> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package cn.ysk.cashier.mybatis.service;
|
||||
|
||||
import cn.ysk.cashier.mybatis.entity.TbFreeDineConfig;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
* @description 针对表【tb_free_dine_config(霸王餐配置信息表)】的数据库操作Service
|
||||
* @createDate 2024-10-22 14:49:18
|
||||
*/
|
||||
public interface TbFreeDineConfigService extends IService<TbFreeDineConfig> {
|
||||
|
||||
/**
|
||||
* 根据店铺id获取霸王餐配置
|
||||
* @param shopId 店铺id
|
||||
* @return 霸王餐配置
|
||||
*/
|
||||
TbFreeDineConfig getByShopId(Integer shopId);
|
||||
|
||||
/**
|
||||
* 通过shopId和id获取配置
|
||||
* @param id 主键
|
||||
* @param shopId 店铺
|
||||
* @return 信息
|
||||
*/
|
||||
TbFreeDineConfig getByIdAndShopId(Integer id, Integer shopId);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package cn.ysk.cashier.mybatis.service.impl;
|
||||
|
||||
import cn.ysk.cashier.mybatis.entity.TbFreeDineConfig;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import cn.ysk.cashier.mybatis.service.TbFreeDineConfigService;
|
||||
import cn.ysk.cashier.mybatis.mapper.TbFreeDineConfigMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
* @description 针对表【tb_free_dine_config(霸王餐配置信息表)】的数据库操作Service实现
|
||||
* @createDate 2024-10-22 14:49:18
|
||||
*/
|
||||
@Service
|
||||
public class TbFreeDineConfigServiceImpl extends ServiceImpl<TbFreeDineConfigMapper, TbFreeDineConfig>
|
||||
implements TbFreeDineConfigService{
|
||||
@Override
|
||||
public TbFreeDineConfig getByShopId(Integer shopId) {
|
||||
return getOne(new LambdaQueryWrapper<TbFreeDineConfig>()
|
||||
.eq(TbFreeDineConfig::getShopId, shopId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TbFreeDineConfig getByIdAndShopId(Integer id, Integer shopId) {
|
||||
return getOne(new LambdaQueryWrapper<TbFreeDineConfig>()
|
||||
.eq(TbFreeDineConfig::getId, id)
|
||||
.eq(TbFreeDineConfig::getShopId, shopId));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user