提交代码

master
胡锐 11 months ago
parent d587b58f2c
commit 087429e992
  1. 3
      cweb/src/main/java/com/cweb/config/AuthConfig.java
  2. 28
      cweb/src/main/java/com/cweb/controller/group/BsStoreProductCategoryController.java
  3. 23
      cweb/src/main/java/com/cweb/controller/meal/BsMealShopCartController.java
  4. 64
      cweb/src/main/java/com/cweb/controller/meal/BsMealTableOrderController.java
  5. 6
      service/src/main/java/com/hfkj/dao/BsMealShopCartMapperExt.java
  6. 29
      service/src/main/java/com/hfkj/dao/BsMealTableOrderChildMapper.java
  7. 159
      service/src/main/java/com/hfkj/dao/BsMealTableOrderChildProductMapper.java
  8. 7
      service/src/main/java/com/hfkj/dao/BsMealTableOrderChildProductMapperExt.java
  9. 444
      service/src/main/java/com/hfkj/dao/BsMealTableOrderChildProductSqlProvider.java
  10. 30
      service/src/main/java/com/hfkj/dao/BsMealTableOrderChildSqlProvider.java
  11. 41
      service/src/main/java/com/hfkj/dao/BsMealTableOrderMapper.java
  12. 150
      service/src/main/java/com/hfkj/dao/BsMealTableOrderProductMapper.java
  13. 7
      service/src/main/java/com/hfkj/dao/BsMealTableOrderProductMapperExt.java
  14. 416
      service/src/main/java/com/hfkj/dao/BsMealTableOrderProductSqlProvider.java
  15. 4
      service/src/main/java/com/hfkj/dao/BsMealTableOrderSqlProvider.java
  16. 36
      service/src/main/java/com/hfkj/entity/BsMealTableOrderChild.java
  17. 118
      service/src/main/java/com/hfkj/entity/BsMealTableOrderChildExample.java
  18. 358
      service/src/main/java/com/hfkj/entity/BsMealTableOrderChildProduct.java
  19. 1514
      service/src/main/java/com/hfkj/entity/BsMealTableOrderChildProductExample.java
  20. 326
      service/src/main/java/com/hfkj/entity/BsMealTableOrderProduct.java
  21. 1384
      service/src/main/java/com/hfkj/entity/BsMealTableOrderProductExample.java
  22. 5
      service/src/main/java/com/hfkj/service/group/impl/BsStoreGroupServiceImpl.java
  23. 11
      service/src/main/java/com/hfkj/service/meal/BsMealShopCartService.java
  24. 18
      service/src/main/java/com/hfkj/service/meal/BsMealTableOrderChildProductService.java
  25. 18
      service/src/main/java/com/hfkj/service/meal/BsMealTableOrderChildService.java
  26. 17
      service/src/main/java/com/hfkj/service/meal/BsMealTableOrderProductService.java
  27. 126
      service/src/main/java/com/hfkj/service/meal/impl/BsMealShopCartServiceImpl.java
  28. 33
      service/src/main/java/com/hfkj/service/meal/impl/BsMealTableOrderChildServiceImpl.java
  29. 2
      service/src/main/resources/dev/commonConfig.properties

@ -120,6 +120,9 @@ public class AuthConfig implements WebMvcConfigurer {
.excludePathPatterns("/mealTable/startTable")
.excludePathPatterns("/mealTable/endTable")
.excludePathPatterns("/mealShopCart/*")
.excludePathPatterns("/mealTableOrder/*")
.excludePathPatterns("/storeProductCategory/getStoreProduct")
.excludePathPatterns("/storeProductCategory/search")
.excludePathPatterns("/ocr/*")
.excludePathPatterns("/openGroup/*")
;

@ -11,6 +11,7 @@ import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.BsStoreProductCategory;
import com.hfkj.model.ResponseData;
import com.hfkj.model.UserInfoModel;
import com.hfkj.service.group.BsStoreGroupService;
import com.hfkj.service.group.BsStoreProductCategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -39,6 +40,8 @@ public class BsStoreProductCategoryController {
@Resource
private BsStoreProductCategoryService storeProductCategoryService;
@Resource
private BsStoreGroupService storeGroupService;
@Resource
private UserCenter userCenter;
@RequestMapping(value="/editCategory",method = RequestMethod.POST)
@ -196,7 +199,7 @@ public class BsStoreProductCategoryController {
@RequestMapping(value="/getStoreProduct",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询门店分类及产品")
@ApiOperation(value = "【菜单】查询门店分类及产品")
public ResponseData getStoreProduct(@RequestParam(value = "storeId" , required = true) Long storeId) {
try {
@ -208,4 +211,27 @@ public class BsStoreProductCategoryController {
}
}
@RequestMapping(value="/search",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "【菜单】搜索")
public ResponseData search(@RequestParam(value = "storeId" , required = true) Long storeId,
@RequestParam(value = "name" , required = true) Long name,
@RequestParam(value = "pageNum" , required = true) Integer pageNum,
@RequestParam(value = "pageSize" , required = true) Integer pageSize) {
try {
Map<String,Object> param = new HashMap<>();
param.put("storeId", storeId);
param.put("name", name);
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(storeGroupService.getStoreProductByList(param)));
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -46,7 +46,7 @@ public class BsMealShopCartController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
mealShopCartService.addProduct(body.getString("serialNumber"),body.getLong("productId"));
mealShopCartService.addProduct(body.getString("serialNumber"),body.getLong("productId"),body.getString("userIdentity"));
return ResponseMsgUtil.success("操作成功");
@ -67,7 +67,26 @@ public class BsMealShopCartController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
mealShopCartService.reduceProduct(body.getString("serialNumber"),body.getLong("productId"));
mealShopCartService.reduceProduct(body.getString("serialNumber"),body.getLong("productId"),body.getString("userIdentity"));
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/clear",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "清除")
public ResponseData clear(@RequestBody JSONObject body) {
try {
if (body == null || StringUtils.isBlank(body.getString("serialNumber"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
mealShopCartService.clear(body.getString("serialNumber"),body.getString("userIdentity"));
return ResponseMsgUtil.success("操作成功");

@ -0,0 +1,64 @@
package com.cweb.controller.meal;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.model.ResponseData;
import com.hfkj.service.meal.BsMealShopCartService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @className: BsMealShopCartController
* @author: HuRui
* @date: 2023/11/30
**/
@Controller
@Api(value = "桌台订单管理")
@RequestMapping(value = "/mealTableOrder")
public class BsMealTableOrderController {
Logger log = LoggerFactory.getLogger(BsMealTableController.class);
@RequestMapping(value="/createOrder",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "创建订单")
public ResponseData createOrder(@RequestBody JSONObject body) {
try {
if (body == null
|| StringUtils.isBlank(body.getString("serialNumber"))
|| body.getJSONArray("productArray") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
for (Object obj : body.getJSONArray("productArray")) {
JSONObject product = (JSONObject) obj;
if (product == null
|| product.getLong("productId") == null || product.getInteger("number") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "产品参数校验未通过");
}
}
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -1,7 +1,13 @@
package com.hfkj.dao;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
/**
* mapper扩展类
*/
public interface BsMealShopCartMapperExt {
@Update("update bs_meal_shop_cart set `status` = 0 where serial_number = #{serialNumber} and `status` = 1")
void clear(@Param("serialNumber") String serialNumber);
}

@ -44,19 +44,19 @@ public interface BsMealTableOrderChildMapper extends BsMealTableOrderChildMapper
"store_id, store_name, ",
"serial_number, table_number, ",
"`table_name`, order_no, ",
"order_amount, `status`, ",
"pay_time, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"child_order_no, child_order_amount, ",
"`status`, pay_time, ",
"create_time, update_time, ",
"ext_1, ext_2, ext_3)",
"values (#{merId,jdbcType=BIGINT}, #{merNo,jdbcType=VARCHAR}, ",
"#{merName,jdbcType=VARCHAR}, #{merAbbreviate,jdbcType=VARCHAR}, ",
"#{storeId,jdbcType=BIGINT}, #{storeName,jdbcType=VARCHAR}, ",
"#{serialNumber,jdbcType=VARCHAR}, #{tableNumber,jdbcType=VARCHAR}, ",
"#{tableName,jdbcType=VARCHAR}, #{orderNo,jdbcType=VARCHAR}, ",
"#{orderAmount,jdbcType=DECIMAL}, #{status,jdbcType=INTEGER}, ",
"#{payTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"#{childOrderNo,jdbcType=VARCHAR}, #{childOrderAmount,jdbcType=DECIMAL}, ",
"#{status,jdbcType=INTEGER}, #{payTime,jdbcType=TIMESTAMP}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsMealTableOrderChild record);
@ -78,7 +78,8 @@ public interface BsMealTableOrderChildMapper extends BsMealTableOrderChildMapper
@Result(column="table_number", property="tableNumber", jdbcType=JdbcType.VARCHAR),
@Result(column="table_name", property="tableName", jdbcType=JdbcType.VARCHAR),
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="order_amount", property="orderAmount", jdbcType=JdbcType.DECIMAL),
@Result(column="child_order_no", property="childOrderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="child_order_amount", property="childOrderAmount", jdbcType=JdbcType.DECIMAL),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@ -92,8 +93,8 @@ public interface BsMealTableOrderChildMapper extends BsMealTableOrderChildMapper
@Select({
"select",
"id, mer_id, mer_no, mer_name, mer_abbreviate, store_id, store_name, serial_number, ",
"table_number, `table_name`, order_no, order_amount, `status`, pay_time, create_time, ",
"update_time, ext_1, ext_2, ext_3",
"table_number, `table_name`, order_no, child_order_no, child_order_amount, `status`, ",
"pay_time, create_time, update_time, ext_1, ext_2, ext_3",
"from bs_meal_table_order_child",
"where id = #{id,jdbcType=BIGINT}"
})
@ -109,7 +110,8 @@ public interface BsMealTableOrderChildMapper extends BsMealTableOrderChildMapper
@Result(column="table_number", property="tableNumber", jdbcType=JdbcType.VARCHAR),
@Result(column="table_name", property="tableName", jdbcType=JdbcType.VARCHAR),
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="order_amount", property="orderAmount", jdbcType=JdbcType.DECIMAL),
@Result(column="child_order_no", property="childOrderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="child_order_amount", property="childOrderAmount", jdbcType=JdbcType.DECIMAL),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@ -141,7 +143,8 @@ public interface BsMealTableOrderChildMapper extends BsMealTableOrderChildMapper
"table_number = #{tableNumber,jdbcType=VARCHAR},",
"`table_name` = #{tableName,jdbcType=VARCHAR},",
"order_no = #{orderNo,jdbcType=VARCHAR},",
"order_amount = #{orderAmount,jdbcType=DECIMAL},",
"child_order_no = #{childOrderNo,jdbcType=VARCHAR},",
"child_order_amount = #{childOrderAmount,jdbcType=DECIMAL},",
"`status` = #{status,jdbcType=INTEGER},",
"pay_time = #{payTime,jdbcType=TIMESTAMP},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",

@ -0,0 +1,159 @@
package com.hfkj.dao;
import com.hfkj.entity.BsMealTableOrderChildProduct;
import com.hfkj.entity.BsMealTableOrderChildProductExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;
import org.springframework.stereotype.Repository;
/**
*
* 代码由工具生成,请勿修改!!!
* 如果需要扩展请在其父类进行扩展
*
**/
@Repository
public interface BsMealTableOrderChildProductMapper extends BsMealTableOrderChildProductMapperExt {
@SelectProvider(type=BsMealTableOrderChildProductSqlProvider.class, method="countByExample")
long countByExample(BsMealTableOrderChildProductExample example);
@DeleteProvider(type=BsMealTableOrderChildProductSqlProvider.class, method="deleteByExample")
int deleteByExample(BsMealTableOrderChildProductExample example);
@Delete({
"delete from bs_meal_table_order_child_product",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_meal_table_order_child_product (store_id, store_name, ",
"child_order_id, child_order_no, ",
"product_category_id, product_category_name, ",
"product_id, product_img, ",
"product_name, product_spec, ",
"product_price, product_num, ",
"product_total_price, `status`, ",
"create_time, update_time, ",
"ext_1, ext_2, ext_3)",
"values (#{storeId,jdbcType=BIGINT}, #{storeName,jdbcType=VARCHAR}, ",
"#{childOrderId,jdbcType=BIGINT}, #{childOrderNo,jdbcType=VARCHAR}, ",
"#{productCategoryId,jdbcType=BIGINT}, #{productCategoryName,jdbcType=VARCHAR}, ",
"#{productId,jdbcType=BIGINT}, #{productImg,jdbcType=VARCHAR}, ",
"#{productName,jdbcType=VARCHAR}, #{productSpec,jdbcType=VARCHAR}, ",
"#{productPrice,jdbcType=DECIMAL}, #{productNum,jdbcType=INTEGER}, ",
"#{productTotalPrice,jdbcType=DECIMAL}, #{status,jdbcType=INTEGER}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsMealTableOrderChildProduct record);
@InsertProvider(type=BsMealTableOrderChildProductSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(BsMealTableOrderChildProduct record);
@SelectProvider(type=BsMealTableOrderChildProductSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="store_id", property="storeId", jdbcType=JdbcType.BIGINT),
@Result(column="store_name", property="storeName", jdbcType=JdbcType.VARCHAR),
@Result(column="child_order_id", property="childOrderId", jdbcType=JdbcType.BIGINT),
@Result(column="child_order_no", property="childOrderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="product_category_id", property="productCategoryId", jdbcType=JdbcType.BIGINT),
@Result(column="product_category_name", property="productCategoryName", jdbcType=JdbcType.VARCHAR),
@Result(column="product_id", property="productId", jdbcType=JdbcType.BIGINT),
@Result(column="product_img", property="productImg", jdbcType=JdbcType.VARCHAR),
@Result(column="product_name", property="productName", jdbcType=JdbcType.VARCHAR),
@Result(column="product_spec", property="productSpec", jdbcType=JdbcType.VARCHAR),
@Result(column="product_price", property="productPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="product_num", property="productNum", jdbcType=JdbcType.INTEGER),
@Result(column="product_total_price", property="productTotalPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
List<BsMealTableOrderChildProduct> selectByExample(BsMealTableOrderChildProductExample example);
@Select({
"select",
"id, store_id, store_name, child_order_id, child_order_no, product_category_id, ",
"product_category_name, product_id, product_img, product_name, product_spec, ",
"product_price, product_num, product_total_price, `status`, create_time, update_time, ",
"ext_1, ext_2, ext_3",
"from bs_meal_table_order_child_product",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="store_id", property="storeId", jdbcType=JdbcType.BIGINT),
@Result(column="store_name", property="storeName", jdbcType=JdbcType.VARCHAR),
@Result(column="child_order_id", property="childOrderId", jdbcType=JdbcType.BIGINT),
@Result(column="child_order_no", property="childOrderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="product_category_id", property="productCategoryId", jdbcType=JdbcType.BIGINT),
@Result(column="product_category_name", property="productCategoryName", jdbcType=JdbcType.VARCHAR),
@Result(column="product_id", property="productId", jdbcType=JdbcType.BIGINT),
@Result(column="product_img", property="productImg", jdbcType=JdbcType.VARCHAR),
@Result(column="product_name", property="productName", jdbcType=JdbcType.VARCHAR),
@Result(column="product_spec", property="productSpec", jdbcType=JdbcType.VARCHAR),
@Result(column="product_price", property="productPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="product_num", property="productNum", jdbcType=JdbcType.INTEGER),
@Result(column="product_total_price", property="productTotalPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
BsMealTableOrderChildProduct selectByPrimaryKey(Long id);
@UpdateProvider(type=BsMealTableOrderChildProductSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") BsMealTableOrderChildProduct record, @Param("example") BsMealTableOrderChildProductExample example);
@UpdateProvider(type=BsMealTableOrderChildProductSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") BsMealTableOrderChildProduct record, @Param("example") BsMealTableOrderChildProductExample example);
@UpdateProvider(type=BsMealTableOrderChildProductSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(BsMealTableOrderChildProduct record);
@Update({
"update bs_meal_table_order_child_product",
"set store_id = #{storeId,jdbcType=BIGINT},",
"store_name = #{storeName,jdbcType=VARCHAR},",
"child_order_id = #{childOrderId,jdbcType=BIGINT},",
"child_order_no = #{childOrderNo,jdbcType=VARCHAR},",
"product_category_id = #{productCategoryId,jdbcType=BIGINT},",
"product_category_name = #{productCategoryName,jdbcType=VARCHAR},",
"product_id = #{productId,jdbcType=BIGINT},",
"product_img = #{productImg,jdbcType=VARCHAR},",
"product_name = #{productName,jdbcType=VARCHAR},",
"product_spec = #{productSpec,jdbcType=VARCHAR},",
"product_price = #{productPrice,jdbcType=DECIMAL},",
"product_num = #{productNum,jdbcType=INTEGER},",
"product_total_price = #{productTotalPrice,jdbcType=DECIMAL},",
"`status` = #{status,jdbcType=INTEGER},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=TIMESTAMP},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR}",
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(BsMealTableOrderChildProduct record);
}

@ -0,0 +1,7 @@
package com.hfkj.dao;
/**
* mapper扩展类
*/
public interface BsMealTableOrderChildProductMapperExt {
}

@ -0,0 +1,444 @@
package com.hfkj.dao;
import com.hfkj.entity.BsMealTableOrderChildProduct;
import com.hfkj.entity.BsMealTableOrderChildProductExample.Criteria;
import com.hfkj.entity.BsMealTableOrderChildProductExample.Criterion;
import com.hfkj.entity.BsMealTableOrderChildProductExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class BsMealTableOrderChildProductSqlProvider {
public String countByExample(BsMealTableOrderChildProductExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("bs_meal_table_order_child_product");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(BsMealTableOrderChildProductExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("bs_meal_table_order_child_product");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(BsMealTableOrderChildProduct record) {
SQL sql = new SQL();
sql.INSERT_INTO("bs_meal_table_order_child_product");
if (record.getStoreId() != null) {
sql.VALUES("store_id", "#{storeId,jdbcType=BIGINT}");
}
if (record.getStoreName() != null) {
sql.VALUES("store_name", "#{storeName,jdbcType=VARCHAR}");
}
if (record.getChildOrderId() != null) {
sql.VALUES("child_order_id", "#{childOrderId,jdbcType=BIGINT}");
}
if (record.getChildOrderNo() != null) {
sql.VALUES("child_order_no", "#{childOrderNo,jdbcType=VARCHAR}");
}
if (record.getProductCategoryId() != null) {
sql.VALUES("product_category_id", "#{productCategoryId,jdbcType=BIGINT}");
}
if (record.getProductCategoryName() != null) {
sql.VALUES("product_category_name", "#{productCategoryName,jdbcType=VARCHAR}");
}
if (record.getProductId() != null) {
sql.VALUES("product_id", "#{productId,jdbcType=BIGINT}");
}
if (record.getProductImg() != null) {
sql.VALUES("product_img", "#{productImg,jdbcType=VARCHAR}");
}
if (record.getProductName() != null) {
sql.VALUES("product_name", "#{productName,jdbcType=VARCHAR}");
}
if (record.getProductSpec() != null) {
sql.VALUES("product_spec", "#{productSpec,jdbcType=VARCHAR}");
}
if (record.getProductPrice() != null) {
sql.VALUES("product_price", "#{productPrice,jdbcType=DECIMAL}");
}
if (record.getProductNum() != null) {
sql.VALUES("product_num", "#{productNum,jdbcType=INTEGER}");
}
if (record.getProductTotalPrice() != null) {
sql.VALUES("product_total_price", "#{productTotalPrice,jdbcType=DECIMAL}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}");
}
return sql.toString();
}
public String selectByExample(BsMealTableOrderChildProductExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("store_id");
sql.SELECT("store_name");
sql.SELECT("child_order_id");
sql.SELECT("child_order_no");
sql.SELECT("product_category_id");
sql.SELECT("product_category_name");
sql.SELECT("product_id");
sql.SELECT("product_img");
sql.SELECT("product_name");
sql.SELECT("product_spec");
sql.SELECT("product_price");
sql.SELECT("product_num");
sql.SELECT("product_total_price");
sql.SELECT("`status`");
sql.SELECT("create_time");
sql.SELECT("update_time");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
sql.FROM("bs_meal_table_order_child_product");
applyWhere(sql, example, false);
if (example != null && example.getOrderByClause() != null) {
sql.ORDER_BY(example.getOrderByClause());
}
return sql.toString();
}
public String updateByExampleSelective(Map<String, Object> parameter) {
BsMealTableOrderChildProduct record = (BsMealTableOrderChildProduct) parameter.get("record");
BsMealTableOrderChildProductExample example = (BsMealTableOrderChildProductExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("bs_meal_table_order_child_product");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getStoreId() != null) {
sql.SET("store_id = #{record.storeId,jdbcType=BIGINT}");
}
if (record.getStoreName() != null) {
sql.SET("store_name = #{record.storeName,jdbcType=VARCHAR}");
}
if (record.getChildOrderId() != null) {
sql.SET("child_order_id = #{record.childOrderId,jdbcType=BIGINT}");
}
if (record.getChildOrderNo() != null) {
sql.SET("child_order_no = #{record.childOrderNo,jdbcType=VARCHAR}");
}
if (record.getProductCategoryId() != null) {
sql.SET("product_category_id = #{record.productCategoryId,jdbcType=BIGINT}");
}
if (record.getProductCategoryName() != null) {
sql.SET("product_category_name = #{record.productCategoryName,jdbcType=VARCHAR}");
}
if (record.getProductId() != null) {
sql.SET("product_id = #{record.productId,jdbcType=BIGINT}");
}
if (record.getProductImg() != null) {
sql.SET("product_img = #{record.productImg,jdbcType=VARCHAR}");
}
if (record.getProductName() != null) {
sql.SET("product_name = #{record.productName,jdbcType=VARCHAR}");
}
if (record.getProductSpec() != null) {
sql.SET("product_spec = #{record.productSpec,jdbcType=VARCHAR}");
}
if (record.getProductPrice() != null) {
sql.SET("product_price = #{record.productPrice,jdbcType=DECIMAL}");
}
if (record.getProductNum() != null) {
sql.SET("product_num = #{record.productNum,jdbcType=INTEGER}");
}
if (record.getProductTotalPrice() != null) {
sql.SET("product_total_price = #{record.productTotalPrice,jdbcType=DECIMAL}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
}
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByExample(Map<String, Object> parameter) {
SQL sql = new SQL();
sql.UPDATE("bs_meal_table_order_child_product");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("store_id = #{record.storeId,jdbcType=BIGINT}");
sql.SET("store_name = #{record.storeName,jdbcType=VARCHAR}");
sql.SET("child_order_id = #{record.childOrderId,jdbcType=BIGINT}");
sql.SET("child_order_no = #{record.childOrderNo,jdbcType=VARCHAR}");
sql.SET("product_category_id = #{record.productCategoryId,jdbcType=BIGINT}");
sql.SET("product_category_name = #{record.productCategoryName,jdbcType=VARCHAR}");
sql.SET("product_id = #{record.productId,jdbcType=BIGINT}");
sql.SET("product_img = #{record.productImg,jdbcType=VARCHAR}");
sql.SET("product_name = #{record.productName,jdbcType=VARCHAR}");
sql.SET("product_spec = #{record.productSpec,jdbcType=VARCHAR}");
sql.SET("product_price = #{record.productPrice,jdbcType=DECIMAL}");
sql.SET("product_num = #{record.productNum,jdbcType=INTEGER}");
sql.SET("product_total_price = #{record.productTotalPrice,jdbcType=DECIMAL}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
BsMealTableOrderChildProductExample example = (BsMealTableOrderChildProductExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(BsMealTableOrderChildProduct record) {
SQL sql = new SQL();
sql.UPDATE("bs_meal_table_order_child_product");
if (record.getStoreId() != null) {
sql.SET("store_id = #{storeId,jdbcType=BIGINT}");
}
if (record.getStoreName() != null) {
sql.SET("store_name = #{storeName,jdbcType=VARCHAR}");
}
if (record.getChildOrderId() != null) {
sql.SET("child_order_id = #{childOrderId,jdbcType=BIGINT}");
}
if (record.getChildOrderNo() != null) {
sql.SET("child_order_no = #{childOrderNo,jdbcType=VARCHAR}");
}
if (record.getProductCategoryId() != null) {
sql.SET("product_category_id = #{productCategoryId,jdbcType=BIGINT}");
}
if (record.getProductCategoryName() != null) {
sql.SET("product_category_name = #{productCategoryName,jdbcType=VARCHAR}");
}
if (record.getProductId() != null) {
sql.SET("product_id = #{productId,jdbcType=BIGINT}");
}
if (record.getProductImg() != null) {
sql.SET("product_img = #{productImg,jdbcType=VARCHAR}");
}
if (record.getProductName() != null) {
sql.SET("product_name = #{productName,jdbcType=VARCHAR}");
}
if (record.getProductSpec() != null) {
sql.SET("product_spec = #{productSpec,jdbcType=VARCHAR}");
}
if (record.getProductPrice() != null) {
sql.SET("product_price = #{productPrice,jdbcType=DECIMAL}");
}
if (record.getProductNum() != null) {
sql.SET("product_num = #{productNum,jdbcType=INTEGER}");
}
if (record.getProductTotalPrice() != null) {
sql.SET("product_total_price = #{productTotalPrice,jdbcType=DECIMAL}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}");
}
sql.WHERE("id = #{id,jdbcType=BIGINT}");
return sql.toString();
}
protected void applyWhere(SQL sql, BsMealTableOrderChildProductExample example, boolean includeExamplePhrase) {
if (example == null) {
return;
}
String parmPhrase1;
String parmPhrase1_th;
String parmPhrase2;
String parmPhrase2_th;
String parmPhrase3;
String parmPhrase3_th;
if (includeExamplePhrase) {
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
} else {
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
}
StringBuilder sb = new StringBuilder();
List<Criteria> oredCriteria = example.getOredCriteria();
boolean firstCriteria = true;
for (int i = 0; i < oredCriteria.size(); i++) {
Criteria criteria = oredCriteria.get(i);
if (criteria.isValid()) {
if (firstCriteria) {
firstCriteria = false;
} else {
sb.append(" or ");
}
sb.append('(');
List<Criterion> criterions = criteria.getAllCriteria();
boolean firstCriterion = true;
for (int j = 0; j < criterions.size(); j++) {
Criterion criterion = criterions.get(j);
if (firstCriterion) {
firstCriterion = false;
} else {
sb.append(" and ");
}
if (criterion.isNoValue()) {
sb.append(criterion.getCondition());
} else if (criterion.isSingleValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j));
} else {
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler()));
}
} else if (criterion.isBetweenValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j));
} else {
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler()));
}
} else if (criterion.isListValue()) {
sb.append(criterion.getCondition());
sb.append(" (");
List<?> listItems = (List<?>) criterion.getValue();
boolean comma = false;
for (int k = 0; k < listItems.size(); k++) {
if (comma) {
sb.append(", ");
} else {
comma = true;
}
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase3, i, j, k));
} else {
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler()));
}
}
sb.append(')');
}
}
sb.append(')');
}
}
if (sb.length() > 0) {
sql.WHERE(sb.toString());
}
}
}

@ -68,8 +68,12 @@ public class BsMealTableOrderChildSqlProvider {
sql.VALUES("order_no", "#{orderNo,jdbcType=VARCHAR}");
}
if (record.getOrderAmount() != null) {
sql.VALUES("order_amount", "#{orderAmount,jdbcType=DECIMAL}");
if (record.getChildOrderNo() != null) {
sql.VALUES("child_order_no", "#{childOrderNo,jdbcType=VARCHAR}");
}
if (record.getChildOrderAmount() != null) {
sql.VALUES("child_order_amount", "#{childOrderAmount,jdbcType=DECIMAL}");
}
if (record.getStatus() != null) {
@ -120,7 +124,8 @@ public class BsMealTableOrderChildSqlProvider {
sql.SELECT("table_number");
sql.SELECT("`table_name`");
sql.SELECT("order_no");
sql.SELECT("order_amount");
sql.SELECT("child_order_no");
sql.SELECT("child_order_amount");
sql.SELECT("`status`");
sql.SELECT("pay_time");
sql.SELECT("create_time");
@ -189,8 +194,12 @@ public class BsMealTableOrderChildSqlProvider {
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}");
}
if (record.getOrderAmount() != null) {
sql.SET("order_amount = #{record.orderAmount,jdbcType=DECIMAL}");
if (record.getChildOrderNo() != null) {
sql.SET("child_order_no = #{record.childOrderNo,jdbcType=VARCHAR}");
}
if (record.getChildOrderAmount() != null) {
sql.SET("child_order_amount = #{record.childOrderAmount,jdbcType=DECIMAL}");
}
if (record.getStatus() != null) {
@ -240,7 +249,8 @@ public class BsMealTableOrderChildSqlProvider {
sql.SET("table_number = #{record.tableNumber,jdbcType=VARCHAR}");
sql.SET("`table_name` = #{record.tableName,jdbcType=VARCHAR}");
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}");
sql.SET("order_amount = #{record.orderAmount,jdbcType=DECIMAL}");
sql.SET("child_order_no = #{record.childOrderNo,jdbcType=VARCHAR}");
sql.SET("child_order_amount = #{record.childOrderAmount,jdbcType=DECIMAL}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("pay_time = #{record.payTime,jdbcType=TIMESTAMP}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
@ -298,8 +308,12 @@ public class BsMealTableOrderChildSqlProvider {
sql.SET("order_no = #{orderNo,jdbcType=VARCHAR}");
}
if (record.getOrderAmount() != null) {
sql.SET("order_amount = #{orderAmount,jdbcType=DECIMAL}");
if (record.getChildOrderNo() != null) {
sql.SET("child_order_no = #{childOrderNo,jdbcType=VARCHAR}");
}
if (record.getChildOrderAmount() != null) {
sql.SET("child_order_amount = #{childOrderAmount,jdbcType=DECIMAL}");
}
if (record.getStatus() != null) {

@ -7,7 +7,6 @@ import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
@ -39,30 +38,30 @@ public interface BsMealTableOrderMapper extends BsMealTableOrderMapperExt {
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_meal_table_order (mer_id, mer_no, ",
"mer_name, mer_abbreviate, ",
"store_id, store_name, ",
"serial_number, table_number, ",
"`table_name`, people_num, ",
"order_no, order_amount, ",
"`status`, pay_time, ",
"create_time, update_time, ",
"ext_1, ext_2, ext_3)",
"values (#{merId,jdbcType=BIGINT}, #{merNo,jdbcType=VARCHAR}, ",
"#{merName,jdbcType=VARCHAR}, #{merAbbreviate,jdbcType=VARCHAR}, ",
"#{storeId,jdbcType=BIGINT}, #{storeName,jdbcType=VARCHAR}, ",
"#{serialNumber,jdbcType=VARCHAR}, #{tableNumber,jdbcType=INTEGER}, ",
"#{tableName,jdbcType=VARCHAR}, #{peopleNum,jdbcType=INTEGER}, ",
"#{orderNo,jdbcType=VARCHAR}, #{orderAmount,jdbcType=DECIMAL}, ",
"#{status,jdbcType=INTEGER}, #{payTime,jdbcType=TIMESTAMP}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"insert into bs_meal_table_order (id, mer_id, ",
"mer_no, mer_name, ",
"mer_abbreviate, store_id, ",
"store_name, serial_number, ",
"table_number, `table_name`, ",
"people_num, order_no, ",
"order_amount, `status`, ",
"pay_time, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"values (#{id,jdbcType=BIGINT}, #{merId,jdbcType=BIGINT}, ",
"#{merNo,jdbcType=VARCHAR}, #{merName,jdbcType=VARCHAR}, ",
"#{merAbbreviate,jdbcType=VARCHAR}, #{storeId,jdbcType=BIGINT}, ",
"#{storeName,jdbcType=VARCHAR}, #{serialNumber,jdbcType=VARCHAR}, ",
"#{tableNumber,jdbcType=INTEGER}, #{tableName,jdbcType=VARCHAR}, ",
"#{peopleNum,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, ",
"#{orderAmount,jdbcType=DECIMAL}, #{status,jdbcType=INTEGER}, ",
"#{payTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsMealTableOrder record);
@InsertProvider(type=BsMealTableOrderSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(BsMealTableOrder record);
@SelectProvider(type=BsMealTableOrderSqlProvider.class, method="selectByExample")

@ -0,0 +1,150 @@
package com.hfkj.dao;
import com.hfkj.entity.BsMealTableOrderProduct;
import com.hfkj.entity.BsMealTableOrderProductExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;
import org.springframework.stereotype.Repository;
/**
*
* 代码由工具生成,请勿修改!!!
* 如果需要扩展请在其父类进行扩展
*
**/
@Repository
public interface BsMealTableOrderProductMapper extends BsMealTableOrderProductMapperExt {
@SelectProvider(type=BsMealTableOrderProductSqlProvider.class, method="countByExample")
long countByExample(BsMealTableOrderProductExample example);
@DeleteProvider(type=BsMealTableOrderProductSqlProvider.class, method="deleteByExample")
int deleteByExample(BsMealTableOrderProductExample example);
@Delete({
"delete from bs_meal_table_order_product",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_meal_table_order_product (order_id, order_no, ",
"product_category_id, product_category_name, ",
"product_id, product_img, ",
"product_name, product_spec, ",
"product_price, product_num, ",
"product_total_price, `status`, ",
"create_time, update_time, ",
"ext_1, ext_2, ext_3)",
"values (#{orderId,jdbcType=BIGINT}, #{orderNo,jdbcType=VARCHAR}, ",
"#{productCategoryId,jdbcType=BIGINT}, #{productCategoryName,jdbcType=VARCHAR}, ",
"#{productId,jdbcType=BIGINT}, #{productImg,jdbcType=VARCHAR}, ",
"#{productName,jdbcType=VARCHAR}, #{productSpec,jdbcType=VARCHAR}, ",
"#{productPrice,jdbcType=DECIMAL}, #{productNum,jdbcType=INTEGER}, ",
"#{productTotalPrice,jdbcType=DECIMAL}, #{status,jdbcType=INTEGER}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsMealTableOrderProduct record);
@InsertProvider(type=BsMealTableOrderProductSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(BsMealTableOrderProduct record);
@SelectProvider(type=BsMealTableOrderProductSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="order_id", property="orderId", jdbcType=JdbcType.BIGINT),
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="product_category_id", property="productCategoryId", jdbcType=JdbcType.BIGINT),
@Result(column="product_category_name", property="productCategoryName", jdbcType=JdbcType.VARCHAR),
@Result(column="product_id", property="productId", jdbcType=JdbcType.BIGINT),
@Result(column="product_img", property="productImg", jdbcType=JdbcType.VARCHAR),
@Result(column="product_name", property="productName", jdbcType=JdbcType.VARCHAR),
@Result(column="product_spec", property="productSpec", jdbcType=JdbcType.VARCHAR),
@Result(column="product_price", property="productPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="product_num", property="productNum", jdbcType=JdbcType.INTEGER),
@Result(column="product_total_price", property="productTotalPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
List<BsMealTableOrderProduct> selectByExample(BsMealTableOrderProductExample example);
@Select({
"select",
"id, order_id, order_no, product_category_id, product_category_name, product_id, ",
"product_img, product_name, product_spec, product_price, product_num, product_total_price, ",
"`status`, create_time, update_time, ext_1, ext_2, ext_3",
"from bs_meal_table_order_product",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="order_id", property="orderId", jdbcType=JdbcType.BIGINT),
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="product_category_id", property="productCategoryId", jdbcType=JdbcType.BIGINT),
@Result(column="product_category_name", property="productCategoryName", jdbcType=JdbcType.VARCHAR),
@Result(column="product_id", property="productId", jdbcType=JdbcType.BIGINT),
@Result(column="product_img", property="productImg", jdbcType=JdbcType.VARCHAR),
@Result(column="product_name", property="productName", jdbcType=JdbcType.VARCHAR),
@Result(column="product_spec", property="productSpec", jdbcType=JdbcType.VARCHAR),
@Result(column="product_price", property="productPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="product_num", property="productNum", jdbcType=JdbcType.INTEGER),
@Result(column="product_total_price", property="productTotalPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
BsMealTableOrderProduct selectByPrimaryKey(Long id);
@UpdateProvider(type=BsMealTableOrderProductSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") BsMealTableOrderProduct record, @Param("example") BsMealTableOrderProductExample example);
@UpdateProvider(type=BsMealTableOrderProductSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") BsMealTableOrderProduct record, @Param("example") BsMealTableOrderProductExample example);
@UpdateProvider(type=BsMealTableOrderProductSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(BsMealTableOrderProduct record);
@Update({
"update bs_meal_table_order_product",
"set order_id = #{orderId,jdbcType=BIGINT},",
"order_no = #{orderNo,jdbcType=VARCHAR},",
"product_category_id = #{productCategoryId,jdbcType=BIGINT},",
"product_category_name = #{productCategoryName,jdbcType=VARCHAR},",
"product_id = #{productId,jdbcType=BIGINT},",
"product_img = #{productImg,jdbcType=VARCHAR},",
"product_name = #{productName,jdbcType=VARCHAR},",
"product_spec = #{productSpec,jdbcType=VARCHAR},",
"product_price = #{productPrice,jdbcType=DECIMAL},",
"product_num = #{productNum,jdbcType=INTEGER},",
"product_total_price = #{productTotalPrice,jdbcType=DECIMAL},",
"`status` = #{status,jdbcType=INTEGER},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=TIMESTAMP},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR}",
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(BsMealTableOrderProduct record);
}

@ -0,0 +1,7 @@
package com.hfkj.dao;
/**
* mapper扩展类
*/
public interface BsMealTableOrderProductMapperExt {
}

@ -0,0 +1,416 @@
package com.hfkj.dao;
import com.hfkj.entity.BsMealTableOrderProduct;
import com.hfkj.entity.BsMealTableOrderProductExample.Criteria;
import com.hfkj.entity.BsMealTableOrderProductExample.Criterion;
import com.hfkj.entity.BsMealTableOrderProductExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class BsMealTableOrderProductSqlProvider {
public String countByExample(BsMealTableOrderProductExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("bs_meal_table_order_product");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(BsMealTableOrderProductExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("bs_meal_table_order_product");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(BsMealTableOrderProduct record) {
SQL sql = new SQL();
sql.INSERT_INTO("bs_meal_table_order_product");
if (record.getOrderId() != null) {
sql.VALUES("order_id", "#{orderId,jdbcType=BIGINT}");
}
if (record.getOrderNo() != null) {
sql.VALUES("order_no", "#{orderNo,jdbcType=VARCHAR}");
}
if (record.getProductCategoryId() != null) {
sql.VALUES("product_category_id", "#{productCategoryId,jdbcType=BIGINT}");
}
if (record.getProductCategoryName() != null) {
sql.VALUES("product_category_name", "#{productCategoryName,jdbcType=VARCHAR}");
}
if (record.getProductId() != null) {
sql.VALUES("product_id", "#{productId,jdbcType=BIGINT}");
}
if (record.getProductImg() != null) {
sql.VALUES("product_img", "#{productImg,jdbcType=VARCHAR}");
}
if (record.getProductName() != null) {
sql.VALUES("product_name", "#{productName,jdbcType=VARCHAR}");
}
if (record.getProductSpec() != null) {
sql.VALUES("product_spec", "#{productSpec,jdbcType=VARCHAR}");
}
if (record.getProductPrice() != null) {
sql.VALUES("product_price", "#{productPrice,jdbcType=DECIMAL}");
}
if (record.getProductNum() != null) {
sql.VALUES("product_num", "#{productNum,jdbcType=INTEGER}");
}
if (record.getProductTotalPrice() != null) {
sql.VALUES("product_total_price", "#{productTotalPrice,jdbcType=DECIMAL}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}");
}
return sql.toString();
}
public String selectByExample(BsMealTableOrderProductExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("order_id");
sql.SELECT("order_no");
sql.SELECT("product_category_id");
sql.SELECT("product_category_name");
sql.SELECT("product_id");
sql.SELECT("product_img");
sql.SELECT("product_name");
sql.SELECT("product_spec");
sql.SELECT("product_price");
sql.SELECT("product_num");
sql.SELECT("product_total_price");
sql.SELECT("`status`");
sql.SELECT("create_time");
sql.SELECT("update_time");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
sql.FROM("bs_meal_table_order_product");
applyWhere(sql, example, false);
if (example != null && example.getOrderByClause() != null) {
sql.ORDER_BY(example.getOrderByClause());
}
return sql.toString();
}
public String updateByExampleSelective(Map<String, Object> parameter) {
BsMealTableOrderProduct record = (BsMealTableOrderProduct) parameter.get("record");
BsMealTableOrderProductExample example = (BsMealTableOrderProductExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("bs_meal_table_order_product");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getOrderId() != null) {
sql.SET("order_id = #{record.orderId,jdbcType=BIGINT}");
}
if (record.getOrderNo() != null) {
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}");
}
if (record.getProductCategoryId() != null) {
sql.SET("product_category_id = #{record.productCategoryId,jdbcType=BIGINT}");
}
if (record.getProductCategoryName() != null) {
sql.SET("product_category_name = #{record.productCategoryName,jdbcType=VARCHAR}");
}
if (record.getProductId() != null) {
sql.SET("product_id = #{record.productId,jdbcType=BIGINT}");
}
if (record.getProductImg() != null) {
sql.SET("product_img = #{record.productImg,jdbcType=VARCHAR}");
}
if (record.getProductName() != null) {
sql.SET("product_name = #{record.productName,jdbcType=VARCHAR}");
}
if (record.getProductSpec() != null) {
sql.SET("product_spec = #{record.productSpec,jdbcType=VARCHAR}");
}
if (record.getProductPrice() != null) {
sql.SET("product_price = #{record.productPrice,jdbcType=DECIMAL}");
}
if (record.getProductNum() != null) {
sql.SET("product_num = #{record.productNum,jdbcType=INTEGER}");
}
if (record.getProductTotalPrice() != null) {
sql.SET("product_total_price = #{record.productTotalPrice,jdbcType=DECIMAL}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
}
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByExample(Map<String, Object> parameter) {
SQL sql = new SQL();
sql.UPDATE("bs_meal_table_order_product");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("order_id = #{record.orderId,jdbcType=BIGINT}");
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}");
sql.SET("product_category_id = #{record.productCategoryId,jdbcType=BIGINT}");
sql.SET("product_category_name = #{record.productCategoryName,jdbcType=VARCHAR}");
sql.SET("product_id = #{record.productId,jdbcType=BIGINT}");
sql.SET("product_img = #{record.productImg,jdbcType=VARCHAR}");
sql.SET("product_name = #{record.productName,jdbcType=VARCHAR}");
sql.SET("product_spec = #{record.productSpec,jdbcType=VARCHAR}");
sql.SET("product_price = #{record.productPrice,jdbcType=DECIMAL}");
sql.SET("product_num = #{record.productNum,jdbcType=INTEGER}");
sql.SET("product_total_price = #{record.productTotalPrice,jdbcType=DECIMAL}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
BsMealTableOrderProductExample example = (BsMealTableOrderProductExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(BsMealTableOrderProduct record) {
SQL sql = new SQL();
sql.UPDATE("bs_meal_table_order_product");
if (record.getOrderId() != null) {
sql.SET("order_id = #{orderId,jdbcType=BIGINT}");
}
if (record.getOrderNo() != null) {
sql.SET("order_no = #{orderNo,jdbcType=VARCHAR}");
}
if (record.getProductCategoryId() != null) {
sql.SET("product_category_id = #{productCategoryId,jdbcType=BIGINT}");
}
if (record.getProductCategoryName() != null) {
sql.SET("product_category_name = #{productCategoryName,jdbcType=VARCHAR}");
}
if (record.getProductId() != null) {
sql.SET("product_id = #{productId,jdbcType=BIGINT}");
}
if (record.getProductImg() != null) {
sql.SET("product_img = #{productImg,jdbcType=VARCHAR}");
}
if (record.getProductName() != null) {
sql.SET("product_name = #{productName,jdbcType=VARCHAR}");
}
if (record.getProductSpec() != null) {
sql.SET("product_spec = #{productSpec,jdbcType=VARCHAR}");
}
if (record.getProductPrice() != null) {
sql.SET("product_price = #{productPrice,jdbcType=DECIMAL}");
}
if (record.getProductNum() != null) {
sql.SET("product_num = #{productNum,jdbcType=INTEGER}");
}
if (record.getProductTotalPrice() != null) {
sql.SET("product_total_price = #{productTotalPrice,jdbcType=DECIMAL}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}");
}
sql.WHERE("id = #{id,jdbcType=BIGINT}");
return sql.toString();
}
protected void applyWhere(SQL sql, BsMealTableOrderProductExample example, boolean includeExamplePhrase) {
if (example == null) {
return;
}
String parmPhrase1;
String parmPhrase1_th;
String parmPhrase2;
String parmPhrase2_th;
String parmPhrase3;
String parmPhrase3_th;
if (includeExamplePhrase) {
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
} else {
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
}
StringBuilder sb = new StringBuilder();
List<Criteria> oredCriteria = example.getOredCriteria();
boolean firstCriteria = true;
for (int i = 0; i < oredCriteria.size(); i++) {
Criteria criteria = oredCriteria.get(i);
if (criteria.isValid()) {
if (firstCriteria) {
firstCriteria = false;
} else {
sb.append(" or ");
}
sb.append('(');
List<Criterion> criterions = criteria.getAllCriteria();
boolean firstCriterion = true;
for (int j = 0; j < criterions.size(); j++) {
Criterion criterion = criterions.get(j);
if (firstCriterion) {
firstCriterion = false;
} else {
sb.append(" and ");
}
if (criterion.isNoValue()) {
sb.append(criterion.getCondition());
} else if (criterion.isSingleValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j));
} else {
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler()));
}
} else if (criterion.isBetweenValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j));
} else {
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler()));
}
} else if (criterion.isListValue()) {
sb.append(criterion.getCondition());
sb.append(" (");
List<?> listItems = (List<?>) criterion.getValue();
boolean comma = false;
for (int k = 0; k < listItems.size(); k++) {
if (comma) {
sb.append(", ");
} else {
comma = true;
}
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase3, i, j, k));
} else {
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler()));
}
}
sb.append(')');
}
}
sb.append(')');
}
}
if (sb.length() > 0) {
sql.WHERE(sb.toString());
}
}
}

@ -28,6 +28,10 @@ public class BsMealTableOrderSqlProvider {
SQL sql = new SQL();
sql.INSERT_INTO("bs_meal_table_order");
if (record.getId() != null) {
sql.VALUES("id", "#{id,jdbcType=BIGINT}");
}
if (record.getMerId() != null) {
sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}");
}

@ -62,14 +62,19 @@ public class BsMealTableOrderChild implements Serializable {
private String tableName;
/**
* 单号
* 交易单号
*/
private String orderNo;
/**
* 订单金额
* 子订单号
*/
private BigDecimal orderAmount;
private String childOrderNo;
/**
* 子订单金额
*/
private BigDecimal childOrderAmount;
/**
* 状态 0不可用 1未结账 2已结账
@ -187,12 +192,20 @@ public class BsMealTableOrderChild implements Serializable {
this.orderNo = orderNo;
}
public BigDecimal getOrderAmount() {
return orderAmount;
public String getChildOrderNo() {
return childOrderNo;
}
public void setChildOrderNo(String childOrderNo) {
this.childOrderNo = childOrderNo;
}
public BigDecimal getChildOrderAmount() {
return childOrderAmount;
}
public void setOrderAmount(BigDecimal orderAmount) {
this.orderAmount = orderAmount;
public void setChildOrderAmount(BigDecimal childOrderAmount) {
this.childOrderAmount = childOrderAmount;
}
public Integer getStatus() {
@ -274,7 +287,8 @@ public class BsMealTableOrderChild implements Serializable {
&& (this.getTableNumber() == null ? other.getTableNumber() == null : this.getTableNumber().equals(other.getTableNumber()))
&& (this.getTableName() == null ? other.getTableName() == null : this.getTableName().equals(other.getTableName()))
&& (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo()))
&& (this.getOrderAmount() == null ? other.getOrderAmount() == null : this.getOrderAmount().equals(other.getOrderAmount()))
&& (this.getChildOrderNo() == null ? other.getChildOrderNo() == null : this.getChildOrderNo().equals(other.getChildOrderNo()))
&& (this.getChildOrderAmount() == null ? other.getChildOrderAmount() == null : this.getChildOrderAmount().equals(other.getChildOrderAmount()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getPayTime() == null ? other.getPayTime() == null : this.getPayTime().equals(other.getPayTime()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
@ -299,7 +313,8 @@ public class BsMealTableOrderChild implements Serializable {
result = prime * result + ((getTableNumber() == null) ? 0 : getTableNumber().hashCode());
result = prime * result + ((getTableName() == null) ? 0 : getTableName().hashCode());
result = prime * result + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode());
result = prime * result + ((getOrderAmount() == null) ? 0 : getOrderAmount().hashCode());
result = prime * result + ((getChildOrderNo() == null) ? 0 : getChildOrderNo().hashCode());
result = prime * result + ((getChildOrderAmount() == null) ? 0 : getChildOrderAmount().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getPayTime() == null) ? 0 : getPayTime().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
@ -327,7 +342,8 @@ public class BsMealTableOrderChild implements Serializable {
sb.append(", tableNumber=").append(tableNumber);
sb.append(", tableName=").append(tableName);
sb.append(", orderNo=").append(orderNo);
sb.append(", orderAmount=").append(orderAmount);
sb.append(", childOrderNo=").append(childOrderNo);
sb.append(", childOrderAmount=").append(childOrderAmount);
sb.append(", status=").append(status);
sb.append(", payTime=").append(payTime);
sb.append(", createTime=").append(createTime);

@ -866,63 +866,133 @@ public class BsMealTableOrderChildExample {
return (Criteria) this;
}
public Criteria andOrderAmountIsNull() {
addCriterion("order_amount is null");
public Criteria andChildOrderNoIsNull() {
addCriterion("child_order_no is null");
return (Criteria) this;
}
public Criteria andOrderAmountIsNotNull() {
addCriterion("order_amount is not null");
public Criteria andChildOrderNoIsNotNull() {
addCriterion("child_order_no is not null");
return (Criteria) this;
}
public Criteria andOrderAmountEqualTo(BigDecimal value) {
addCriterion("order_amount =", value, "orderAmount");
public Criteria andChildOrderNoEqualTo(String value) {
addCriterion("child_order_no =", value, "childOrderNo");
return (Criteria) this;
}
public Criteria andOrderAmountNotEqualTo(BigDecimal value) {
addCriterion("order_amount <>", value, "orderAmount");
public Criteria andChildOrderNoNotEqualTo(String value) {
addCriterion("child_order_no <>", value, "childOrderNo");
return (Criteria) this;
}
public Criteria andOrderAmountGreaterThan(BigDecimal value) {
addCriterion("order_amount >", value, "orderAmount");
public Criteria andChildOrderNoGreaterThan(String value) {
addCriterion("child_order_no >", value, "childOrderNo");
return (Criteria) this;
}
public Criteria andOrderAmountGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("order_amount >=", value, "orderAmount");
public Criteria andChildOrderNoGreaterThanOrEqualTo(String value) {
addCriterion("child_order_no >=", value, "childOrderNo");
return (Criteria) this;
}
public Criteria andOrderAmountLessThan(BigDecimal value) {
addCriterion("order_amount <", value, "orderAmount");
public Criteria andChildOrderNoLessThan(String value) {
addCriterion("child_order_no <", value, "childOrderNo");
return (Criteria) this;
}
public Criteria andOrderAmountLessThanOrEqualTo(BigDecimal value) {
addCriterion("order_amount <=", value, "orderAmount");
public Criteria andChildOrderNoLessThanOrEqualTo(String value) {
addCriterion("child_order_no <=", value, "childOrderNo");
return (Criteria) this;
}
public Criteria andOrderAmountIn(List<BigDecimal> values) {
addCriterion("order_amount in", values, "orderAmount");
public Criteria andChildOrderNoLike(String value) {
addCriterion("child_order_no like", value, "childOrderNo");
return (Criteria) this;
}
public Criteria andOrderAmountNotIn(List<BigDecimal> values) {
addCriterion("order_amount not in", values, "orderAmount");
public Criteria andChildOrderNoNotLike(String value) {
addCriterion("child_order_no not like", value, "childOrderNo");
return (Criteria) this;
}
public Criteria andOrderAmountBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("order_amount between", value1, value2, "orderAmount");
public Criteria andChildOrderNoIn(List<String> values) {
addCriterion("child_order_no in", values, "childOrderNo");
return (Criteria) this;
}
public Criteria andOrderAmountNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("order_amount not between", value1, value2, "orderAmount");
public Criteria andChildOrderNoNotIn(List<String> values) {
addCriterion("child_order_no not in", values, "childOrderNo");
return (Criteria) this;
}
public Criteria andChildOrderNoBetween(String value1, String value2) {
addCriterion("child_order_no between", value1, value2, "childOrderNo");
return (Criteria) this;
}
public Criteria andChildOrderNoNotBetween(String value1, String value2) {
addCriterion("child_order_no not between", value1, value2, "childOrderNo");
return (Criteria) this;
}
public Criteria andChildOrderAmountIsNull() {
addCriterion("child_order_amount is null");
return (Criteria) this;
}
public Criteria andChildOrderAmountIsNotNull() {
addCriterion("child_order_amount is not null");
return (Criteria) this;
}
public Criteria andChildOrderAmountEqualTo(BigDecimal value) {
addCriterion("child_order_amount =", value, "childOrderAmount");
return (Criteria) this;
}
public Criteria andChildOrderAmountNotEqualTo(BigDecimal value) {
addCriterion("child_order_amount <>", value, "childOrderAmount");
return (Criteria) this;
}
public Criteria andChildOrderAmountGreaterThan(BigDecimal value) {
addCriterion("child_order_amount >", value, "childOrderAmount");
return (Criteria) this;
}
public Criteria andChildOrderAmountGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("child_order_amount >=", value, "childOrderAmount");
return (Criteria) this;
}
public Criteria andChildOrderAmountLessThan(BigDecimal value) {
addCriterion("child_order_amount <", value, "childOrderAmount");
return (Criteria) this;
}
public Criteria andChildOrderAmountLessThanOrEqualTo(BigDecimal value) {
addCriterion("child_order_amount <=", value, "childOrderAmount");
return (Criteria) this;
}
public Criteria andChildOrderAmountIn(List<BigDecimal> values) {
addCriterion("child_order_amount in", values, "childOrderAmount");
return (Criteria) this;
}
public Criteria andChildOrderAmountNotIn(List<BigDecimal> values) {
addCriterion("child_order_amount not in", values, "childOrderAmount");
return (Criteria) this;
}
public Criteria andChildOrderAmountBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("child_order_amount between", value1, value2, "childOrderAmount");
return (Criteria) this;
}
public Criteria andChildOrderAmountNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("child_order_amount not between", value1, value2, "childOrderAmount");
return (Criteria) this;
}

@ -0,0 +1,358 @@
package com.hfkj.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* bs_meal_table_order_child_product
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class BsMealTableOrderChildProduct implements Serializable {
private Long id;
/**
* 门店id
*/
private Long storeId;
/**
* 门店名称
*/
private String storeName;
/**
* 子订单id
*/
private Long childOrderId;
/**
* 子订单号
*/
private String childOrderNo;
/**
* 产品分类id
*/
private Long productCategoryId;
/**
* 产品分类名称
*/
private String productCategoryName;
/**
* 产品id
*/
private Long productId;
/**
* 产品图片
*/
private String productImg;
/**
* 产品名称
*/
private String productName;
/**
* 产品规格
*/
private String productSpec;
/**
* 产品单价
*/
private BigDecimal productPrice;
/**
* 产品数量
*/
private Integer productNum;
/**
* 产品总价
*/
private BigDecimal productTotalPrice;
/**
* 状态 0删除 1正常
*/
private Integer status;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
private String ext1;
private String ext2;
private String ext3;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getStoreId() {
return storeId;
}
public void setStoreId(Long storeId) {
this.storeId = storeId;
}
public String getStoreName() {
return storeName;
}
public void setStoreName(String storeName) {
this.storeName = storeName;
}
public Long getChildOrderId() {
return childOrderId;
}
public void setChildOrderId(Long childOrderId) {
this.childOrderId = childOrderId;
}
public String getChildOrderNo() {
return childOrderNo;
}
public void setChildOrderNo(String childOrderNo) {
this.childOrderNo = childOrderNo;
}
public Long getProductCategoryId() {
return productCategoryId;
}
public void setProductCategoryId(Long productCategoryId) {
this.productCategoryId = productCategoryId;
}
public String getProductCategoryName() {
return productCategoryName;
}
public void setProductCategoryName(String productCategoryName) {
this.productCategoryName = productCategoryName;
}
public Long getProductId() {
return productId;
}
public void setProductId(Long productId) {
this.productId = productId;
}
public String getProductImg() {
return productImg;
}
public void setProductImg(String productImg) {
this.productImg = productImg;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getProductSpec() {
return productSpec;
}
public void setProductSpec(String productSpec) {
this.productSpec = productSpec;
}
public BigDecimal getProductPrice() {
return productPrice;
}
public void setProductPrice(BigDecimal productPrice) {
this.productPrice = productPrice;
}
public Integer getProductNum() {
return productNum;
}
public void setProductNum(Integer productNum) {
this.productNum = productNum;
}
public BigDecimal getProductTotalPrice() {
return productTotalPrice;
}
public void setProductTotalPrice(BigDecimal productTotalPrice) {
this.productTotalPrice = productTotalPrice;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
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 String getExt1() {
return ext1;
}
public void setExt1(String ext1) {
this.ext1 = ext1;
}
public String getExt2() {
return ext2;
}
public void setExt2(String ext2) {
this.ext2 = ext2;
}
public String getExt3() {
return ext3;
}
public void setExt3(String ext3) {
this.ext3 = ext3;
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
BsMealTableOrderChildProduct other = (BsMealTableOrderChildProduct) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getStoreId() == null ? other.getStoreId() == null : this.getStoreId().equals(other.getStoreId()))
&& (this.getStoreName() == null ? other.getStoreName() == null : this.getStoreName().equals(other.getStoreName()))
&& (this.getChildOrderId() == null ? other.getChildOrderId() == null : this.getChildOrderId().equals(other.getChildOrderId()))
&& (this.getChildOrderNo() == null ? other.getChildOrderNo() == null : this.getChildOrderNo().equals(other.getChildOrderNo()))
&& (this.getProductCategoryId() == null ? other.getProductCategoryId() == null : this.getProductCategoryId().equals(other.getProductCategoryId()))
&& (this.getProductCategoryName() == null ? other.getProductCategoryName() == null : this.getProductCategoryName().equals(other.getProductCategoryName()))
&& (this.getProductId() == null ? other.getProductId() == null : this.getProductId().equals(other.getProductId()))
&& (this.getProductImg() == null ? other.getProductImg() == null : this.getProductImg().equals(other.getProductImg()))
&& (this.getProductName() == null ? other.getProductName() == null : this.getProductName().equals(other.getProductName()))
&& (this.getProductSpec() == null ? other.getProductSpec() == null : this.getProductSpec().equals(other.getProductSpec()))
&& (this.getProductPrice() == null ? other.getProductPrice() == null : this.getProductPrice().equals(other.getProductPrice()))
&& (this.getProductNum() == null ? other.getProductNum() == null : this.getProductNum().equals(other.getProductNum()))
&& (this.getProductTotalPrice() == null ? other.getProductTotalPrice() == null : this.getProductTotalPrice().equals(other.getProductTotalPrice()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1()))
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2()))
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getStoreId() == null) ? 0 : getStoreId().hashCode());
result = prime * result + ((getStoreName() == null) ? 0 : getStoreName().hashCode());
result = prime * result + ((getChildOrderId() == null) ? 0 : getChildOrderId().hashCode());
result = prime * result + ((getChildOrderNo() == null) ? 0 : getChildOrderNo().hashCode());
result = prime * result + ((getProductCategoryId() == null) ? 0 : getProductCategoryId().hashCode());
result = prime * result + ((getProductCategoryName() == null) ? 0 : getProductCategoryName().hashCode());
result = prime * result + ((getProductId() == null) ? 0 : getProductId().hashCode());
result = prime * result + ((getProductImg() == null) ? 0 : getProductImg().hashCode());
result = prime * result + ((getProductName() == null) ? 0 : getProductName().hashCode());
result = prime * result + ((getProductSpec() == null) ? 0 : getProductSpec().hashCode());
result = prime * result + ((getProductPrice() == null) ? 0 : getProductPrice().hashCode());
result = prime * result + ((getProductNum() == null) ? 0 : getProductNum().hashCode());
result = prime * result + ((getProductTotalPrice() == null) ? 0 : getProductTotalPrice().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode());
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode());
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", storeId=").append(storeId);
sb.append(", storeName=").append(storeName);
sb.append(", childOrderId=").append(childOrderId);
sb.append(", childOrderNo=").append(childOrderNo);
sb.append(", productCategoryId=").append(productCategoryId);
sb.append(", productCategoryName=").append(productCategoryName);
sb.append(", productId=").append(productId);
sb.append(", productImg=").append(productImg);
sb.append(", productName=").append(productName);
sb.append(", productSpec=").append(productSpec);
sb.append(", productPrice=").append(productPrice);
sb.append(", productNum=").append(productNum);
sb.append(", productTotalPrice=").append(productTotalPrice);
sb.append(", status=").append(status);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", ext1=").append(ext1);
sb.append(", ext2=").append(ext2);
sb.append(", ext3=").append(ext3);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

@ -0,0 +1,326 @@
package com.hfkj.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* bs_meal_table_order_product
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class BsMealTableOrderProduct implements Serializable {
private Long id;
/**
* 交易单号id
*/
private Long orderId;
/**
* 交易单号
*/
private String orderNo;
/**
* 产品分类id
*/
private Long productCategoryId;
/**
* 产品分类名称
*/
private String productCategoryName;
/**
* 产品id
*/
private Long productId;
/**
* 产品图片
*/
private String productImg;
/**
* 产品名称
*/
private String productName;
/**
* 产品规格
*/
private String productSpec;
/**
* 产品单价
*/
private BigDecimal productPrice;
/**
* 产品数量
*/
private Integer productNum;
/**
* 产品总价
*/
private BigDecimal productTotalPrice;
/**
* 状态 0删除 1正常
*/
private Integer status;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
private String ext1;
private String ext2;
private String ext3;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getOrderId() {
return orderId;
}
public void setOrderId(Long orderId) {
this.orderId = orderId;
}
public String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public Long getProductCategoryId() {
return productCategoryId;
}
public void setProductCategoryId(Long productCategoryId) {
this.productCategoryId = productCategoryId;
}
public String getProductCategoryName() {
return productCategoryName;
}
public void setProductCategoryName(String productCategoryName) {
this.productCategoryName = productCategoryName;
}
public Long getProductId() {
return productId;
}
public void setProductId(Long productId) {
this.productId = productId;
}
public String getProductImg() {
return productImg;
}
public void setProductImg(String productImg) {
this.productImg = productImg;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getProductSpec() {
return productSpec;
}
public void setProductSpec(String productSpec) {
this.productSpec = productSpec;
}
public BigDecimal getProductPrice() {
return productPrice;
}
public void setProductPrice(BigDecimal productPrice) {
this.productPrice = productPrice;
}
public Integer getProductNum() {
return productNum;
}
public void setProductNum(Integer productNum) {
this.productNum = productNum;
}
public BigDecimal getProductTotalPrice() {
return productTotalPrice;
}
public void setProductTotalPrice(BigDecimal productTotalPrice) {
this.productTotalPrice = productTotalPrice;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
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 String getExt1() {
return ext1;
}
public void setExt1(String ext1) {
this.ext1 = ext1;
}
public String getExt2() {
return ext2;
}
public void setExt2(String ext2) {
this.ext2 = ext2;
}
public String getExt3() {
return ext3;
}
public void setExt3(String ext3) {
this.ext3 = ext3;
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
BsMealTableOrderProduct other = (BsMealTableOrderProduct) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId()))
&& (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo()))
&& (this.getProductCategoryId() == null ? other.getProductCategoryId() == null : this.getProductCategoryId().equals(other.getProductCategoryId()))
&& (this.getProductCategoryName() == null ? other.getProductCategoryName() == null : this.getProductCategoryName().equals(other.getProductCategoryName()))
&& (this.getProductId() == null ? other.getProductId() == null : this.getProductId().equals(other.getProductId()))
&& (this.getProductImg() == null ? other.getProductImg() == null : this.getProductImg().equals(other.getProductImg()))
&& (this.getProductName() == null ? other.getProductName() == null : this.getProductName().equals(other.getProductName()))
&& (this.getProductSpec() == null ? other.getProductSpec() == null : this.getProductSpec().equals(other.getProductSpec()))
&& (this.getProductPrice() == null ? other.getProductPrice() == null : this.getProductPrice().equals(other.getProductPrice()))
&& (this.getProductNum() == null ? other.getProductNum() == null : this.getProductNum().equals(other.getProductNum()))
&& (this.getProductTotalPrice() == null ? other.getProductTotalPrice() == null : this.getProductTotalPrice().equals(other.getProductTotalPrice()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1()))
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2()))
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
result = prime * result + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode());
result = prime * result + ((getProductCategoryId() == null) ? 0 : getProductCategoryId().hashCode());
result = prime * result + ((getProductCategoryName() == null) ? 0 : getProductCategoryName().hashCode());
result = prime * result + ((getProductId() == null) ? 0 : getProductId().hashCode());
result = prime * result + ((getProductImg() == null) ? 0 : getProductImg().hashCode());
result = prime * result + ((getProductName() == null) ? 0 : getProductName().hashCode());
result = prime * result + ((getProductSpec() == null) ? 0 : getProductSpec().hashCode());
result = prime * result + ((getProductPrice() == null) ? 0 : getProductPrice().hashCode());
result = prime * result + ((getProductNum() == null) ? 0 : getProductNum().hashCode());
result = prime * result + ((getProductTotalPrice() == null) ? 0 : getProductTotalPrice().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode());
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode());
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", orderId=").append(orderId);
sb.append(", orderNo=").append(orderNo);
sb.append(", productCategoryId=").append(productCategoryId);
sb.append(", productCategoryName=").append(productCategoryName);
sb.append(", productId=").append(productId);
sb.append(", productImg=").append(productImg);
sb.append(", productName=").append(productName);
sb.append(", productSpec=").append(productSpec);
sb.append(", productPrice=").append(productPrice);
sb.append(", productNum=").append(productNum);
sb.append(", productTotalPrice=").append(productTotalPrice);
sb.append(", status=").append(status);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", ext1=").append(ext1);
sb.append(", ext2=").append(ext2);
sb.append(", ext3=").append(ext3);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

@ -7,6 +7,7 @@ import com.hfkj.entity.*;
import com.hfkj.service.group.BsStoreGroupService;
import com.hfkj.service.group.BsStoreProductCategoryService;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -103,6 +104,10 @@ public class BsStoreGroupServiceImpl implements BsStoreGroupService {
criteria.andStoreIdEqualTo(MapUtils.getLong(map, "storeId"));
}
if (StringUtils.isNotBlank(MapUtils.getString(map, "name"))) {
criteria.andNameLike("%" + MapUtils.getLong(map, "name") + "%");
}
return storeProductMapper.selectByExample(example);
}

@ -23,14 +23,21 @@ public interface BsMealShopCartService {
* @param serialNumber
* @param productId
*/
void addProduct(String serialNumber,Long productId);
void addProduct(String serialNumber,Long productId,String userIdentity);
/**
* 减少产品
* @param serialNumber
* @param productId
*/
void reduceProduct(String serialNumber,Long productId);
void reduceProduct(String serialNumber,Long productId,String userIdentity);
/**
* 清除产品
* @param serialNumber
* @param userIdentity
*/
void clear(String serialNumber,String userIdentity);
/**
* 查询购物车产品

@ -0,0 +1,18 @@
package com.hfkj.service.meal;
import com.hfkj.entity.BsMealTableOrderChild;
/**
* @className: BsMealTableOrderChildProductService
* @author: HuRui
* @date: 2023/12/5
**/
public interface BsMealTableOrderChildProductService {
/**
* 编辑数据
* @param data
*/
void editData(BsMealTableOrderChild data);
}

@ -0,0 +1,18 @@
package com.hfkj.service.meal;
import com.hfkj.entity.BsMealTableOrderChild;
/**
* @className: BsMealTableOrderChildService
* @author: HuRui
* @date: 2023/12/5
**/
public interface BsMealTableOrderChildService {
/**
* 编辑数据
* @param data
*/
void editData(BsMealTableOrderChild data);
}

@ -0,0 +1,17 @@
package com.hfkj.service.meal;
import com.hfkj.entity.BsMealTableOrderChild;
/**
* @className: BsMealTableOrderProductService
* @author: HuRui
* @date: 2023/12/5
**/
public interface BsMealTableOrderProductService {
/**
* 编辑数据
* @param data
*/
void editData(BsMealTableOrderChild data);
}

@ -1,28 +1,20 @@
package com.hfkj.service.meal.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.common.QRCodeGenerator;
import com.hfkj.common.exception.BaseException;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.IDGenerator;
import com.hfkj.config.CommonSysConst;
import com.hfkj.config.mqtt.MqttProviderService;
import com.hfkj.dao.BsMealShopCartMapper;
import com.hfkj.dao.BsStoreProductMapper;
import com.hfkj.entity.*;
import com.hfkj.service.group.BsStoreGroupProductService;
import com.hfkj.service.group.BsStoreGroupService;
import com.hfkj.service.meal.BsMealShopCartService;
import com.hfkj.service.meal.BsMealTableOrderService;
import com.hfkj.service.meal.BsMealTableService;
import com.hfkj.sysenum.MealTableOrderStatusEnum;
import com.hfkj.sysenum.MealTableStatusEnum;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.paho.client.mqttv3.MqttClient;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
@ -73,7 +65,7 @@ public class BsMealShopCartServiceImpl implements BsMealShopCartService {
}
@Override
public void addProduct(String serialNumber, Long productId) {
public void addProduct(String serialNumber, Long productId,String userIdentity) {
String lockKey = "MEAL_SHOP_CART_" + serialNumber;
try {
Boolean lock = redisTemplate.opsForValue().setIfAbsent(lockKey, null);
@ -116,19 +108,28 @@ public class BsMealShopCartServiceImpl implements BsMealShopCartService {
shopCart.setProductTotalPrice(new BigDecimal(shopCart.getProductNum().toString()).multiply(product.getPrice()));
editData(shopCart);
}
}
// 推送MQTT
Map<String,Object> pushParam = new HashMap<>();
pushParam.put("userIdentity", userIdentity);
pushParam.put("cmdType", shopCart.getProductNum()==1?CmdTypeEnum.type1.getNumber():CmdTypeEnum.type2.getNumber());
pushParam.put("product", product);
// 产品列表
Map<String,Object> param = new HashMap<>();
param.put("serialNumber", serialNumber);
mqttProviderService.publish(2, false, "MEAL_TABLE_" + serialNumber, JSONObject.toJSONString(getShopCartProductList(param)));
pushParam.put("productList", getShopCartProductList(param));
mqttProviderService.publish(2, false, "MEAL_TABLE_" + serialNumber, JSONObject.toJSONString(pushParam));
}
redisTemplate.delete(lockKey);
} else {
System.out.println("加锁失败");
Thread.sleep(100); // 加锁失败,重试
addProduct(serialNumber, productId);
addProduct(serialNumber, productId, userIdentity);
}
} catch (BaseException baseException) {
redisTemplate.delete(lockKey);
@ -136,12 +137,12 @@ public class BsMealShopCartServiceImpl implements BsMealShopCartService {
} catch (Exception e) {
redisTemplate.delete(lockKey);
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "生成失败!未知错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知错误");
}
}
@Override
public void reduceProduct(String serialNumber, Long productId) {
public void reduceProduct(String serialNumber, Long productId,String userIdentity) {
String lockKey = "MEAL_SHOP_CART_" + serialNumber;
try {
Boolean lock = redisTemplate.opsForValue().setIfAbsent(lockKey, null);
@ -167,19 +168,28 @@ public class BsMealShopCartServiceImpl implements BsMealShopCartService {
}
editData(shopCart);
}
}
// 推送MQTT
Map<String,Object> pushParam = new HashMap<>();
pushParam.put("userIdentity", userIdentity);
pushParam.put("cmdType", shopCart.getProductNum()==0?CmdTypeEnum.type3.getNumber():CmdTypeEnum.type4.getNumber());
pushParam.put("product", product);
// 产品列表
Map<String,Object> param = new HashMap<>();
param.put("serialNumber", serialNumber);
mqttProviderService.publish(0, false, "MEAL_TABLE_" + serialNumber, JSONObject.toJSONString(getShopCartProductList(param)));
pushParam.put("productList", getShopCartProductList(param));
mqttProviderService.publish(2, false, "MEAL_TABLE_" + serialNumber, JSONObject.toJSONString(pushParam));
}
redisTemplate.delete(lockKey);
} else {
System.out.println("加锁失败");
Thread.sleep(100); // 加锁失败,重试
reduceProduct(serialNumber, productId);
reduceProduct(serialNumber, productId, userIdentity);
}
} catch (BaseException baseException) {
redisTemplate.delete(lockKey);
@ -187,7 +197,48 @@ public class BsMealShopCartServiceImpl implements BsMealShopCartService {
} catch (Exception e) {
redisTemplate.delete(lockKey);
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "生成失败!未知错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知错误");
}
}
@Override
public void clear(String serialNumber, String userIdentity) {
String lockKey = "MEAL_SHOP_CART_" + serialNumber;
try {
Boolean lock = redisTemplate.opsForValue().setIfAbsent(lockKey, null);
if(lock) {
// 加锁成功
// 查询桌台订单
BsMealTableOrder tableOrder = mealTableOrderService.getCurrentTableOrder(serialNumber);
if (tableOrder != null) {
mealShopCartMapper.clear(serialNumber);
}
// 推送MQTT
Map<String,Object> pushParam = new HashMap<>();
pushParam.put("userIdentity", userIdentity);
pushParam.put("cmdType", CmdTypeEnum.type5.getNumber());
pushParam.put("product", null);
// 产品列表
pushParam.put("productList", new JSONArray());
mqttProviderService.publish(2, false, "MEAL_TABLE_" + serialNumber, JSONObject.toJSONString(pushParam));
redisTemplate.delete(lockKey);
} else {
System.out.println("加锁失败");
Thread.sleep(100); // 加锁失败,重试
clear(serialNumber, userIdentity);
}
} catch (BaseException baseException) {
redisTemplate.delete(lockKey);
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, baseException.getErrorMsg());
} catch (Exception e) {
redisTemplate.delete(lockKey);
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知错误");
}
}
@ -218,3 +269,40 @@ public class BsMealShopCartServiceImpl implements BsMealShopCartService {
return mealShopCartMapper.selectByExample(example);
}
}
enum CmdTypeEnum {
type1(1, "增加产品"),
type2(2, "增加产品数量"),
type3(3, "删除产品"),
type4(4, "减少产品数量"),
type5(5, "清空购物车"),
;
private Integer number;
private String name;
CmdTypeEnum(int number, String name) {
this.number = number;
this.name = name;
}
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

@ -0,0 +1,33 @@
package com.hfkj.service.meal.impl;
import com.hfkj.dao.BsMealTableOrderChildMapper;
import com.hfkj.entity.BsMealTableOrderChild;
import com.hfkj.service.meal.BsMealTableOrderChildService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
/**
* @className: BsMealTableOrderChildServiceImpl
* @author: HuRui
* @date: 2023/12/5
**/
@Service("mealTableOrderChildService")
public class BsMealTableOrderChildServiceImpl implements BsMealTableOrderChildService {
@Resource
private BsMealTableOrderChildMapper mealTableOrderChildMapper;
@Override
public void editData(BsMealTableOrderChild data) {
if (data.getId() == null) {
data.setCreateTime(new Date());
data.setUpdateTime(new Date());
mealTableOrderChildMapper.insert(data);
} else {
data.setUpdateTime(new Date());
mealTableOrderChildMapper.updateByPrimaryKey(data);
}
}
}

@ -9,7 +9,7 @@ qr_code_data_url=https://gratia-pay.dctpay.com/scanPay
qr_code_url=https://gratia-pay.dctpay.com/filesystem/payQrCode/
lkl_request_url=https://test.wsmsd.cn/sit
lkl_org_code=1
lkl_org_code=
lkl_v3_appid=OP00000392
lkl_v3_serial_no=00dfba8194c41b84cf
lkl_v3_private_key=/home/project/gratia-pay/cert/lakala/v3/OP00000003_private_key.text

Loading…
Cancel
Save