diff --git a/cweb/src/main/java/com/cweb/controller/Meal/BsMealTableController.java b/cweb/src/main/java/com/cweb/controller/Meal/BsMealTableController.java new file mode 100644 index 0000000..294b8e4 --- /dev/null +++ b/cweb/src/main/java/com/cweb/controller/Meal/BsMealTableController.java @@ -0,0 +1,143 @@ +package com.cweb.controller.Meal; + +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +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.entity.BsMealTable; +import com.hfkj.model.ResponseData; +import com.hfkj.service.meal.BsMealTableService; +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.HashMap; +import java.util.Map; + +/** + * 扫码点餐 桌台管理 + * @className: BsMealTableController + * @author: HuRui + * @date: 2023/11/29 + **/ +@Controller +@Api(value = "桌台管理") +@RequestMapping(value = "/mealTable") +public class BsMealTableController { + + Logger log = LoggerFactory.getLogger(BsMealTableController.class); + + @Resource + private BsMealTableService mealTableService; + + @RequestMapping(value="/generateTable",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "生成桌台") + public ResponseData generateTable(@RequestBody JSONObject body) { + try { + if (body == null || body.getLong("storeId") == null || body.getInteger("generateNum") == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + mealTableService.generateTable(body.getLong("storeId"),body.getInteger("generateNum")); + + return ResponseMsgUtil.success("生成成功"); + + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/editTable",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "编辑桌台") + public ResponseData editTable(@RequestBody JSONObject body) { + try { + if (body == null + || StringUtils.isBlank(body.getString("serialNumber")) + || body.getInteger("tableNumber") == null + || StringUtils.isBlank(body.getString("tableName")) + ) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + // 查询桌台 + BsMealTable mealTable = mealTableService.getTableBySerialNumber(body.getString("serialNumber")); + if (mealTable == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的桌台"); + } + mealTable.setTableNumber(body.getInteger("tableNumber")); + mealTable.setTableName(body.getString("tableName")); + mealTableService.editData(mealTable); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/delTable",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "删除桌台") + public ResponseData delTable(@RequestBody JSONObject body) { + try { + if (body == null || StringUtils.isBlank(body.getString("serialNumber"))) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + mealTableService.delTable(body.getString("serialNumber")); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getTable",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "获取桌台详情") + public ResponseData getTable(@RequestParam(value = "serialNumber" , required = true) String serialNumber) { + try { + + return ResponseMsgUtil.success(mealTableService.getTableBySerialNumber(serialNumber)); + + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getTableList",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "商户查询门店列表") + public ResponseData getTableList(@RequestParam(value = "storeId" , required = true) Long storeId, + @RequestParam(value = "tableName" , required = false) String tableName, + @RequestParam(value = "pageNum" , required = true) Integer pageNum, + @RequestParam(value = "pageSize" , required = true) Integer pageSize) { + try { + + Map param = new HashMap<>(); + param.put("storeId", storeId); + param.put("tableName", tableName); + + PageHelper.startPage(pageNum,pageSize); + return ResponseMsgUtil.success(new PageInfo<>(mealTableService.getTableList(param))); + + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + } +} diff --git a/cweb/src/main/java/com/cweb/controller/group/BsStoreProductController.java b/cweb/src/main/java/com/cweb/controller/group/BsStoreProductController.java index 4d3adab..e70cf9c 100644 --- a/cweb/src/main/java/com/cweb/controller/group/BsStoreProductController.java +++ b/cweb/src/main/java/com/cweb/controller/group/BsStoreProductController.java @@ -168,6 +168,8 @@ public class BsStoreProductController { if (category == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的分类"); } + bsStoreProduct.setProductCategoryId(category.getId()); + bsStoreProduct.setProductCategoryName(category.getName()); bsStoreProduct.setUpdateTime(new Date()); bsStoreProduct.setOpId(userInfoModel.getSalesman().getId()); bsStoreProduct.setOpName(userInfoModel.getSalesman().getName()); diff --git a/service/src/main/java/com/hfkj/dao/BsMealTableMapper.java b/service/src/main/java/com/hfkj/dao/BsMealTableMapper.java new file mode 100644 index 0000000..e0afe0b --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsMealTableMapper.java @@ -0,0 +1,150 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsMealTable; +import com.hfkj.entity.BsMealTableExample; +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 BsMealTableMapper extends BsMealTableMapperExt { + @SelectProvider(type=BsMealTableSqlProvider.class, method="countByExample") + long countByExample(BsMealTableExample example); + + @DeleteProvider(type=BsMealTableSqlProvider.class, method="deleteByExample") + int deleteByExample(BsMealTableExample example); + + @Delete({ + "delete from bs_meal_table", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into bs_meal_table (mer_id, mer_no, ", + "mer_name, mer_abbreviate, ", + "store_id, store_name, ", + "serial_number, table_number, ", + "`table_name`, qr_code_content, ", + "qr_code_img_url, `status`, ", + "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}, #{qrCodeContent,jdbcType=VARCHAR}, ", + "#{qrCodeImgUrl,jdbcType=VARCHAR}, #{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(BsMealTable record); + + @InsertProvider(type=BsMealTableSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(BsMealTable record); + + @SelectProvider(type=BsMealTableSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_abbreviate", property="merAbbreviate", jdbcType=JdbcType.VARCHAR), + @Result(column="store_id", property="storeId", jdbcType=JdbcType.BIGINT), + @Result(column="store_name", property="storeName", jdbcType=JdbcType.VARCHAR), + @Result(column="serial_number", property="serialNumber", jdbcType=JdbcType.VARCHAR), + @Result(column="table_number", property="tableNumber", jdbcType=JdbcType.INTEGER), + @Result(column="table_name", property="tableName", jdbcType=JdbcType.VARCHAR), + @Result(column="qr_code_content", property="qrCodeContent", jdbcType=JdbcType.VARCHAR), + @Result(column="qr_code_img_url", property="qrCodeImgUrl", jdbcType=JdbcType.VARCHAR), + @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 selectByExample(BsMealTableExample example); + + @Select({ + "select", + "id, mer_id, mer_no, mer_name, mer_abbreviate, store_id, store_name, serial_number, ", + "table_number, `table_name`, qr_code_content, qr_code_img_url, `status`, create_time, ", + "update_time, ext_1, ext_2, ext_3", + "from bs_meal_table", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_abbreviate", property="merAbbreviate", jdbcType=JdbcType.VARCHAR), + @Result(column="store_id", property="storeId", jdbcType=JdbcType.BIGINT), + @Result(column="store_name", property="storeName", jdbcType=JdbcType.VARCHAR), + @Result(column="serial_number", property="serialNumber", jdbcType=JdbcType.VARCHAR), + @Result(column="table_number", property="tableNumber", jdbcType=JdbcType.INTEGER), + @Result(column="table_name", property="tableName", jdbcType=JdbcType.VARCHAR), + @Result(column="qr_code_content", property="qrCodeContent", jdbcType=JdbcType.VARCHAR), + @Result(column="qr_code_img_url", property="qrCodeImgUrl", jdbcType=JdbcType.VARCHAR), + @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) + }) + BsMealTable selectByPrimaryKey(Long id); + + @UpdateProvider(type=BsMealTableSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") BsMealTable record, @Param("example") BsMealTableExample example); + + @UpdateProvider(type=BsMealTableSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") BsMealTable record, @Param("example") BsMealTableExample example); + + @UpdateProvider(type=BsMealTableSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(BsMealTable record); + + @Update({ + "update bs_meal_table", + "set mer_id = #{merId,jdbcType=BIGINT},", + "mer_no = #{merNo,jdbcType=VARCHAR},", + "mer_name = #{merName,jdbcType=VARCHAR},", + "mer_abbreviate = #{merAbbreviate,jdbcType=VARCHAR},", + "store_id = #{storeId,jdbcType=BIGINT},", + "store_name = #{storeName,jdbcType=VARCHAR},", + "serial_number = #{serialNumber,jdbcType=VARCHAR},", + "table_number = #{tableNumber,jdbcType=INTEGER},", + "`table_name` = #{tableName,jdbcType=VARCHAR},", + "qr_code_content = #{qrCodeContent,jdbcType=VARCHAR},", + "qr_code_img_url = #{qrCodeImgUrl,jdbcType=VARCHAR},", + "`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(BsMealTable record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsMealTableMapperExt.java b/service/src/main/java/com/hfkj/dao/BsMealTableMapperExt.java new file mode 100644 index 0000000..824bbae --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsMealTableMapperExt.java @@ -0,0 +1,13 @@ +package com.hfkj.dao; + +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +/** + * mapper扩展类 + */ +public interface BsMealTableMapperExt { + + @Select("") + Integer getMaxTableNum(@Param("storeId") Long storeId); +} diff --git a/service/src/main/java/com/hfkj/dao/BsMealTableSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsMealTableSqlProvider.java new file mode 100644 index 0000000..493883c --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsMealTableSqlProvider.java @@ -0,0 +1,416 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsMealTable; +import com.hfkj.entity.BsMealTableExample.Criteria; +import com.hfkj.entity.BsMealTableExample.Criterion; +import com.hfkj.entity.BsMealTableExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class BsMealTableSqlProvider { + + public String countByExample(BsMealTableExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("bs_meal_table"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(BsMealTableExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("bs_meal_table"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(BsMealTable record) { + SQL sql = new SQL(); + sql.INSERT_INTO("bs_meal_table"); + + if (record.getMerId() != null) { + sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}"); + } + + if (record.getMerNo() != null) { + sql.VALUES("mer_no", "#{merNo,jdbcType=VARCHAR}"); + } + + if (record.getMerName() != null) { + sql.VALUES("mer_name", "#{merName,jdbcType=VARCHAR}"); + } + + if (record.getMerAbbreviate() != null) { + sql.VALUES("mer_abbreviate", "#{merAbbreviate,jdbcType=VARCHAR}"); + } + + if (record.getStoreId() != null) { + sql.VALUES("store_id", "#{storeId,jdbcType=BIGINT}"); + } + + if (record.getStoreName() != null) { + sql.VALUES("store_name", "#{storeName,jdbcType=VARCHAR}"); + } + + if (record.getSerialNumber() != null) { + sql.VALUES("serial_number", "#{serialNumber,jdbcType=VARCHAR}"); + } + + if (record.getTableNumber() != null) { + sql.VALUES("table_number", "#{tableNumber,jdbcType=INTEGER}"); + } + + if (record.getTableName() != null) { + sql.VALUES("`table_name`", "#{tableName,jdbcType=VARCHAR}"); + } + + if (record.getQrCodeContent() != null) { + sql.VALUES("qr_code_content", "#{qrCodeContent,jdbcType=VARCHAR}"); + } + + if (record.getQrCodeImgUrl() != null) { + sql.VALUES("qr_code_img_url", "#{qrCodeImgUrl,jdbcType=VARCHAR}"); + } + + 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(BsMealTableExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("mer_id"); + sql.SELECT("mer_no"); + sql.SELECT("mer_name"); + sql.SELECT("mer_abbreviate"); + sql.SELECT("store_id"); + sql.SELECT("store_name"); + sql.SELECT("serial_number"); + sql.SELECT("table_number"); + sql.SELECT("`table_name`"); + sql.SELECT("qr_code_content"); + sql.SELECT("qr_code_img_url"); + 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"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + BsMealTable record = (BsMealTable) parameter.get("record"); + BsMealTableExample example = (BsMealTableExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("bs_meal_table"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getMerId() != null) { + sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); + } + + if (record.getMerNo() != null) { + sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}"); + } + + if (record.getMerName() != null) { + sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); + } + + if (record.getMerAbbreviate() != null) { + sql.SET("mer_abbreviate = #{record.merAbbreviate,jdbcType=VARCHAR}"); + } + + 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.getSerialNumber() != null) { + sql.SET("serial_number = #{record.serialNumber,jdbcType=VARCHAR}"); + } + + if (record.getTableNumber() != null) { + sql.SET("table_number = #{record.tableNumber,jdbcType=INTEGER}"); + } + + if (record.getTableName() != null) { + sql.SET("`table_name` = #{record.tableName,jdbcType=VARCHAR}"); + } + + if (record.getQrCodeContent() != null) { + sql.SET("qr_code_content = #{record.qrCodeContent,jdbcType=VARCHAR}"); + } + + if (record.getQrCodeImgUrl() != null) { + sql.SET("qr_code_img_url = #{record.qrCodeImgUrl,jdbcType=VARCHAR}"); + } + + 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 parameter) { + SQL sql = new SQL(); + sql.UPDATE("bs_meal_table"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); + sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}"); + sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); + sql.SET("mer_abbreviate = #{record.merAbbreviate,jdbcType=VARCHAR}"); + sql.SET("store_id = #{record.storeId,jdbcType=BIGINT}"); + sql.SET("store_name = #{record.storeName,jdbcType=VARCHAR}"); + sql.SET("serial_number = #{record.serialNumber,jdbcType=VARCHAR}"); + sql.SET("table_number = #{record.tableNumber,jdbcType=INTEGER}"); + sql.SET("`table_name` = #{record.tableName,jdbcType=VARCHAR}"); + sql.SET("qr_code_content = #{record.qrCodeContent,jdbcType=VARCHAR}"); + sql.SET("qr_code_img_url = #{record.qrCodeImgUrl,jdbcType=VARCHAR}"); + 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}"); + + BsMealTableExample example = (BsMealTableExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(BsMealTable record) { + SQL sql = new SQL(); + sql.UPDATE("bs_meal_table"); + + if (record.getMerId() != null) { + sql.SET("mer_id = #{merId,jdbcType=BIGINT}"); + } + + if (record.getMerNo() != null) { + sql.SET("mer_no = #{merNo,jdbcType=VARCHAR}"); + } + + if (record.getMerName() != null) { + sql.SET("mer_name = #{merName,jdbcType=VARCHAR}"); + } + + if (record.getMerAbbreviate() != null) { + sql.SET("mer_abbreviate = #{merAbbreviate,jdbcType=VARCHAR}"); + } + + if (record.getStoreId() != null) { + sql.SET("store_id = #{storeId,jdbcType=BIGINT}"); + } + + if (record.getStoreName() != null) { + sql.SET("store_name = #{storeName,jdbcType=VARCHAR}"); + } + + if (record.getSerialNumber() != null) { + sql.SET("serial_number = #{serialNumber,jdbcType=VARCHAR}"); + } + + if (record.getTableNumber() != null) { + sql.SET("table_number = #{tableNumber,jdbcType=INTEGER}"); + } + + if (record.getTableName() != null) { + sql.SET("`table_name` = #{tableName,jdbcType=VARCHAR}"); + } + + if (record.getQrCodeContent() != null) { + sql.SET("qr_code_content = #{qrCodeContent,jdbcType=VARCHAR}"); + } + + if (record.getQrCodeImgUrl() != null) { + sql.SET("qr_code_img_url = #{qrCodeImgUrl,jdbcType=VARCHAR}"); + } + + 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, BsMealTableExample 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 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 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()); + } + } +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/entity/BsMealTable.java b/service/src/main/java/com/hfkj/entity/BsMealTable.java new file mode 100644 index 0000000..ee11290 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsMealTable.java @@ -0,0 +1,325 @@ +package com.hfkj.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * bs_meal_table + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class BsMealTable implements Serializable { + private Long id; + + /** + * 商户id + */ + private Long merId; + + /** + * 商户号 + */ + private String merNo; + + /** + * 商户名称 + */ + private String merName; + + /** + * 商户简称 + */ + private String merAbbreviate; + + /** + * 门店id + */ + private Long storeId; + + /** + * 门店名称 + */ + private String storeName; + + /** + * 序列号(系统唯一) + */ + private String serialNumber; + + /** + * 桌子编号 + */ + private Integer tableNumber; + + /** + * 桌子名称 + */ + private String tableName; + + /** + * 二维码内容 + */ + private String qrCodeContent; + + /** + * 二维码图片地址 + */ + private String qrCodeImgUrl; + + /** + * 状态 0:不可用 1:未开台 2:已开台 + */ + 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 getMerId() { + return merId; + } + + public void setMerId(Long merId) { + this.merId = merId; + } + + public String getMerNo() { + return merNo; + } + + public void setMerNo(String merNo) { + this.merNo = merNo; + } + + public String getMerName() { + return merName; + } + + public void setMerName(String merName) { + this.merName = merName; + } + + public String getMerAbbreviate() { + return merAbbreviate; + } + + public void setMerAbbreviate(String merAbbreviate) { + this.merAbbreviate = merAbbreviate; + } + + 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 String getSerialNumber() { + return serialNumber; + } + + public void setSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + } + + public Integer getTableNumber() { + return tableNumber; + } + + public void setTableNumber(Integer tableNumber) { + this.tableNumber = tableNumber; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public String getQrCodeContent() { + return qrCodeContent; + } + + public void setQrCodeContent(String qrCodeContent) { + this.qrCodeContent = qrCodeContent; + } + + public String getQrCodeImgUrl() { + return qrCodeImgUrl; + } + + public void setQrCodeImgUrl(String qrCodeImgUrl) { + this.qrCodeImgUrl = qrCodeImgUrl; + } + + 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; + } + BsMealTable other = (BsMealTable) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId())) + && (this.getMerNo() == null ? other.getMerNo() == null : this.getMerNo().equals(other.getMerNo())) + && (this.getMerName() == null ? other.getMerName() == null : this.getMerName().equals(other.getMerName())) + && (this.getMerAbbreviate() == null ? other.getMerAbbreviate() == null : this.getMerAbbreviate().equals(other.getMerAbbreviate())) + && (this.getStoreId() == null ? other.getStoreId() == null : this.getStoreId().equals(other.getStoreId())) + && (this.getStoreName() == null ? other.getStoreName() == null : this.getStoreName().equals(other.getStoreName())) + && (this.getSerialNumber() == null ? other.getSerialNumber() == null : this.getSerialNumber().equals(other.getSerialNumber())) + && (this.getTableNumber() == null ? other.getTableNumber() == null : this.getTableNumber().equals(other.getTableNumber())) + && (this.getTableName() == null ? other.getTableName() == null : this.getTableName().equals(other.getTableName())) + && (this.getQrCodeContent() == null ? other.getQrCodeContent() == null : this.getQrCodeContent().equals(other.getQrCodeContent())) + && (this.getQrCodeImgUrl() == null ? other.getQrCodeImgUrl() == null : this.getQrCodeImgUrl().equals(other.getQrCodeImgUrl())) + && (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 + ((getMerId() == null) ? 0 : getMerId().hashCode()); + result = prime * result + ((getMerNo() == null) ? 0 : getMerNo().hashCode()); + result = prime * result + ((getMerName() == null) ? 0 : getMerName().hashCode()); + result = prime * result + ((getMerAbbreviate() == null) ? 0 : getMerAbbreviate().hashCode()); + result = prime * result + ((getStoreId() == null) ? 0 : getStoreId().hashCode()); + result = prime * result + ((getStoreName() == null) ? 0 : getStoreName().hashCode()); + result = prime * result + ((getSerialNumber() == null) ? 0 : getSerialNumber().hashCode()); + result = prime * result + ((getTableNumber() == null) ? 0 : getTableNumber().hashCode()); + result = prime * result + ((getTableName() == null) ? 0 : getTableName().hashCode()); + result = prime * result + ((getQrCodeContent() == null) ? 0 : getQrCodeContent().hashCode()); + result = prime * result + ((getQrCodeImgUrl() == null) ? 0 : getQrCodeImgUrl().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(", merId=").append(merId); + sb.append(", merNo=").append(merNo); + sb.append(", merName=").append(merName); + sb.append(", merAbbreviate=").append(merAbbreviate); + sb.append(", storeId=").append(storeId); + sb.append(", storeName=").append(storeName); + sb.append(", serialNumber=").append(serialNumber); + sb.append(", tableNumber=").append(tableNumber); + sb.append(", tableName=").append(tableName); + sb.append(", qrCodeContent=").append(qrCodeContent); + sb.append(", qrCodeImgUrl=").append(qrCodeImgUrl); + 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(); + } +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/entity/BsMealTableExample.java b/service/src/main/java/com/hfkj/entity/BsMealTableExample.java new file mode 100644 index 0000000..161fc89 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsMealTableExample.java @@ -0,0 +1,1413 @@ +package com.hfkj.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class BsMealTableExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public BsMealTableExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getLimit() { + return limit; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public Long getOffset() { + return offset; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andMerIdIsNull() { + addCriterion("mer_id is null"); + return (Criteria) this; + } + + public Criteria andMerIdIsNotNull() { + addCriterion("mer_id is not null"); + return (Criteria) this; + } + + public Criteria andMerIdEqualTo(Long value) { + addCriterion("mer_id =", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotEqualTo(Long value) { + addCriterion("mer_id <>", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdGreaterThan(Long value) { + addCriterion("mer_id >", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdGreaterThanOrEqualTo(Long value) { + addCriterion("mer_id >=", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdLessThan(Long value) { + addCriterion("mer_id <", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdLessThanOrEqualTo(Long value) { + addCriterion("mer_id <=", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdIn(List values) { + addCriterion("mer_id in", values, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotIn(List values) { + addCriterion("mer_id not in", values, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdBetween(Long value1, Long value2) { + addCriterion("mer_id between", value1, value2, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotBetween(Long value1, Long value2) { + addCriterion("mer_id not between", value1, value2, "merId"); + return (Criteria) this; + } + + public Criteria andMerNoIsNull() { + addCriterion("mer_no is null"); + return (Criteria) this; + } + + public Criteria andMerNoIsNotNull() { + addCriterion("mer_no is not null"); + return (Criteria) this; + } + + public Criteria andMerNoEqualTo(String value) { + addCriterion("mer_no =", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotEqualTo(String value) { + addCriterion("mer_no <>", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoGreaterThan(String value) { + addCriterion("mer_no >", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoGreaterThanOrEqualTo(String value) { + addCriterion("mer_no >=", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLessThan(String value) { + addCriterion("mer_no <", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLessThanOrEqualTo(String value) { + addCriterion("mer_no <=", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLike(String value) { + addCriterion("mer_no like", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotLike(String value) { + addCriterion("mer_no not like", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoIn(List values) { + addCriterion("mer_no in", values, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotIn(List values) { + addCriterion("mer_no not in", values, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoBetween(String value1, String value2) { + addCriterion("mer_no between", value1, value2, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotBetween(String value1, String value2) { + addCriterion("mer_no not between", value1, value2, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNameIsNull() { + addCriterion("mer_name is null"); + return (Criteria) this; + } + + public Criteria andMerNameIsNotNull() { + addCriterion("mer_name is not null"); + return (Criteria) this; + } + + public Criteria andMerNameEqualTo(String value) { + addCriterion("mer_name =", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotEqualTo(String value) { + addCriterion("mer_name <>", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameGreaterThan(String value) { + addCriterion("mer_name >", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameGreaterThanOrEqualTo(String value) { + addCriterion("mer_name >=", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLessThan(String value) { + addCriterion("mer_name <", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLessThanOrEqualTo(String value) { + addCriterion("mer_name <=", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLike(String value) { + addCriterion("mer_name like", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotLike(String value) { + addCriterion("mer_name not like", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameIn(List values) { + addCriterion("mer_name in", values, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotIn(List values) { + addCriterion("mer_name not in", values, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameBetween(String value1, String value2) { + addCriterion("mer_name between", value1, value2, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotBetween(String value1, String value2) { + addCriterion("mer_name not between", value1, value2, "merName"); + return (Criteria) this; + } + + public Criteria andMerAbbreviateIsNull() { + addCriterion("mer_abbreviate is null"); + return (Criteria) this; + } + + public Criteria andMerAbbreviateIsNotNull() { + addCriterion("mer_abbreviate is not null"); + return (Criteria) this; + } + + public Criteria andMerAbbreviateEqualTo(String value) { + addCriterion("mer_abbreviate =", value, "merAbbreviate"); + return (Criteria) this; + } + + public Criteria andMerAbbreviateNotEqualTo(String value) { + addCriterion("mer_abbreviate <>", value, "merAbbreviate"); + return (Criteria) this; + } + + public Criteria andMerAbbreviateGreaterThan(String value) { + addCriterion("mer_abbreviate >", value, "merAbbreviate"); + return (Criteria) this; + } + + public Criteria andMerAbbreviateGreaterThanOrEqualTo(String value) { + addCriterion("mer_abbreviate >=", value, "merAbbreviate"); + return (Criteria) this; + } + + public Criteria andMerAbbreviateLessThan(String value) { + addCriterion("mer_abbreviate <", value, "merAbbreviate"); + return (Criteria) this; + } + + public Criteria andMerAbbreviateLessThanOrEqualTo(String value) { + addCriterion("mer_abbreviate <=", value, "merAbbreviate"); + return (Criteria) this; + } + + public Criteria andMerAbbreviateLike(String value) { + addCriterion("mer_abbreviate like", value, "merAbbreviate"); + return (Criteria) this; + } + + public Criteria andMerAbbreviateNotLike(String value) { + addCriterion("mer_abbreviate not like", value, "merAbbreviate"); + return (Criteria) this; + } + + public Criteria andMerAbbreviateIn(List values) { + addCriterion("mer_abbreviate in", values, "merAbbreviate"); + return (Criteria) this; + } + + public Criteria andMerAbbreviateNotIn(List values) { + addCriterion("mer_abbreviate not in", values, "merAbbreviate"); + return (Criteria) this; + } + + public Criteria andMerAbbreviateBetween(String value1, String value2) { + addCriterion("mer_abbreviate between", value1, value2, "merAbbreviate"); + return (Criteria) this; + } + + public Criteria andMerAbbreviateNotBetween(String value1, String value2) { + addCriterion("mer_abbreviate not between", value1, value2, "merAbbreviate"); + return (Criteria) this; + } + + public Criteria andStoreIdIsNull() { + addCriterion("store_id is null"); + return (Criteria) this; + } + + public Criteria andStoreIdIsNotNull() { + addCriterion("store_id is not null"); + return (Criteria) this; + } + + public Criteria andStoreIdEqualTo(Long value) { + addCriterion("store_id =", value, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdNotEqualTo(Long value) { + addCriterion("store_id <>", value, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdGreaterThan(Long value) { + addCriterion("store_id >", value, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdGreaterThanOrEqualTo(Long value) { + addCriterion("store_id >=", value, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdLessThan(Long value) { + addCriterion("store_id <", value, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdLessThanOrEqualTo(Long value) { + addCriterion("store_id <=", value, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdIn(List values) { + addCriterion("store_id in", values, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdNotIn(List values) { + addCriterion("store_id not in", values, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdBetween(Long value1, Long value2) { + addCriterion("store_id between", value1, value2, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdNotBetween(Long value1, Long value2) { + addCriterion("store_id not between", value1, value2, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreNameIsNull() { + addCriterion("store_name is null"); + return (Criteria) this; + } + + public Criteria andStoreNameIsNotNull() { + addCriterion("store_name is not null"); + return (Criteria) this; + } + + public Criteria andStoreNameEqualTo(String value) { + addCriterion("store_name =", value, "storeName"); + return (Criteria) this; + } + + public Criteria andStoreNameNotEqualTo(String value) { + addCriterion("store_name <>", value, "storeName"); + return (Criteria) this; + } + + public Criteria andStoreNameGreaterThan(String value) { + addCriterion("store_name >", value, "storeName"); + return (Criteria) this; + } + + public Criteria andStoreNameGreaterThanOrEqualTo(String value) { + addCriterion("store_name >=", value, "storeName"); + return (Criteria) this; + } + + public Criteria andStoreNameLessThan(String value) { + addCriterion("store_name <", value, "storeName"); + return (Criteria) this; + } + + public Criteria andStoreNameLessThanOrEqualTo(String value) { + addCriterion("store_name <=", value, "storeName"); + return (Criteria) this; + } + + public Criteria andStoreNameLike(String value) { + addCriterion("store_name like", value, "storeName"); + return (Criteria) this; + } + + public Criteria andStoreNameNotLike(String value) { + addCriterion("store_name not like", value, "storeName"); + return (Criteria) this; + } + + public Criteria andStoreNameIn(List values) { + addCriterion("store_name in", values, "storeName"); + return (Criteria) this; + } + + public Criteria andStoreNameNotIn(List values) { + addCriterion("store_name not in", values, "storeName"); + return (Criteria) this; + } + + public Criteria andStoreNameBetween(String value1, String value2) { + addCriterion("store_name between", value1, value2, "storeName"); + return (Criteria) this; + } + + public Criteria andStoreNameNotBetween(String value1, String value2) { + addCriterion("store_name not between", value1, value2, "storeName"); + return (Criteria) this; + } + + public Criteria andSerialNumberIsNull() { + addCriterion("serial_number is null"); + return (Criteria) this; + } + + public Criteria andSerialNumberIsNotNull() { + addCriterion("serial_number is not null"); + return (Criteria) this; + } + + public Criteria andSerialNumberEqualTo(String value) { + addCriterion("serial_number =", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberNotEqualTo(String value) { + addCriterion("serial_number <>", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberGreaterThan(String value) { + addCriterion("serial_number >", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberGreaterThanOrEqualTo(String value) { + addCriterion("serial_number >=", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberLessThan(String value) { + addCriterion("serial_number <", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberLessThanOrEqualTo(String value) { + addCriterion("serial_number <=", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberLike(String value) { + addCriterion("serial_number like", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberNotLike(String value) { + addCriterion("serial_number not like", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberIn(List values) { + addCriterion("serial_number in", values, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberNotIn(List values) { + addCriterion("serial_number not in", values, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberBetween(String value1, String value2) { + addCriterion("serial_number between", value1, value2, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberNotBetween(String value1, String value2) { + addCriterion("serial_number not between", value1, value2, "serialNumber"); + return (Criteria) this; + } + + public Criteria andTableNumberIsNull() { + addCriterion("table_number is null"); + return (Criteria) this; + } + + public Criteria andTableNumberIsNotNull() { + addCriterion("table_number is not null"); + return (Criteria) this; + } + + public Criteria andTableNumberEqualTo(Integer value) { + addCriterion("table_number =", value, "tableNumber"); + return (Criteria) this; + } + + public Criteria andTableNumberNotEqualTo(Integer value) { + addCriterion("table_number <>", value, "tableNumber"); + return (Criteria) this; + } + + public Criteria andTableNumberGreaterThan(Integer value) { + addCriterion("table_number >", value, "tableNumber"); + return (Criteria) this; + } + + public Criteria andTableNumberGreaterThanOrEqualTo(Integer value) { + addCriterion("table_number >=", value, "tableNumber"); + return (Criteria) this; + } + + public Criteria andTableNumberLessThan(Integer value) { + addCriterion("table_number <", value, "tableNumber"); + return (Criteria) this; + } + + public Criteria andTableNumberLessThanOrEqualTo(Integer value) { + addCriterion("table_number <=", value, "tableNumber"); + return (Criteria) this; + } + + public Criteria andTableNumberIn(List values) { + addCriterion("table_number in", values, "tableNumber"); + return (Criteria) this; + } + + public Criteria andTableNumberNotIn(List values) { + addCriterion("table_number not in", values, "tableNumber"); + return (Criteria) this; + } + + public Criteria andTableNumberBetween(Integer value1, Integer value2) { + addCriterion("table_number between", value1, value2, "tableNumber"); + return (Criteria) this; + } + + public Criteria andTableNumberNotBetween(Integer value1, Integer value2) { + addCriterion("table_number not between", value1, value2, "tableNumber"); + return (Criteria) this; + } + + public Criteria andTableNameIsNull() { + addCriterion("`table_name` is null"); + return (Criteria) this; + } + + public Criteria andTableNameIsNotNull() { + addCriterion("`table_name` is not null"); + return (Criteria) this; + } + + public Criteria andTableNameEqualTo(String value) { + addCriterion("`table_name` =", value, "tableName"); + return (Criteria) this; + } + + public Criteria andTableNameNotEqualTo(String value) { + addCriterion("`table_name` <>", value, "tableName"); + return (Criteria) this; + } + + public Criteria andTableNameGreaterThan(String value) { + addCriterion("`table_name` >", value, "tableName"); + return (Criteria) this; + } + + public Criteria andTableNameGreaterThanOrEqualTo(String value) { + addCriterion("`table_name` >=", value, "tableName"); + return (Criteria) this; + } + + public Criteria andTableNameLessThan(String value) { + addCriterion("`table_name` <", value, "tableName"); + return (Criteria) this; + } + + public Criteria andTableNameLessThanOrEqualTo(String value) { + addCriterion("`table_name` <=", value, "tableName"); + return (Criteria) this; + } + + public Criteria andTableNameLike(String value) { + addCriterion("`table_name` like", value, "tableName"); + return (Criteria) this; + } + + public Criteria andTableNameNotLike(String value) { + addCriterion("`table_name` not like", value, "tableName"); + return (Criteria) this; + } + + public Criteria andTableNameIn(List values) { + addCriterion("`table_name` in", values, "tableName"); + return (Criteria) this; + } + + public Criteria andTableNameNotIn(List values) { + addCriterion("`table_name` not in", values, "tableName"); + return (Criteria) this; + } + + public Criteria andTableNameBetween(String value1, String value2) { + addCriterion("`table_name` between", value1, value2, "tableName"); + return (Criteria) this; + } + + public Criteria andTableNameNotBetween(String value1, String value2) { + addCriterion("`table_name` not between", value1, value2, "tableName"); + return (Criteria) this; + } + + public Criteria andQrCodeContentIsNull() { + addCriterion("qr_code_content is null"); + return (Criteria) this; + } + + public Criteria andQrCodeContentIsNotNull() { + addCriterion("qr_code_content is not null"); + return (Criteria) this; + } + + public Criteria andQrCodeContentEqualTo(String value) { + addCriterion("qr_code_content =", value, "qrCodeContent"); + return (Criteria) this; + } + + public Criteria andQrCodeContentNotEqualTo(String value) { + addCriterion("qr_code_content <>", value, "qrCodeContent"); + return (Criteria) this; + } + + public Criteria andQrCodeContentGreaterThan(String value) { + addCriterion("qr_code_content >", value, "qrCodeContent"); + return (Criteria) this; + } + + public Criteria andQrCodeContentGreaterThanOrEqualTo(String value) { + addCriterion("qr_code_content >=", value, "qrCodeContent"); + return (Criteria) this; + } + + public Criteria andQrCodeContentLessThan(String value) { + addCriterion("qr_code_content <", value, "qrCodeContent"); + return (Criteria) this; + } + + public Criteria andQrCodeContentLessThanOrEqualTo(String value) { + addCriterion("qr_code_content <=", value, "qrCodeContent"); + return (Criteria) this; + } + + public Criteria andQrCodeContentLike(String value) { + addCriterion("qr_code_content like", value, "qrCodeContent"); + return (Criteria) this; + } + + public Criteria andQrCodeContentNotLike(String value) { + addCriterion("qr_code_content not like", value, "qrCodeContent"); + return (Criteria) this; + } + + public Criteria andQrCodeContentIn(List values) { + addCriterion("qr_code_content in", values, "qrCodeContent"); + return (Criteria) this; + } + + public Criteria andQrCodeContentNotIn(List values) { + addCriterion("qr_code_content not in", values, "qrCodeContent"); + return (Criteria) this; + } + + public Criteria andQrCodeContentBetween(String value1, String value2) { + addCriterion("qr_code_content between", value1, value2, "qrCodeContent"); + return (Criteria) this; + } + + public Criteria andQrCodeContentNotBetween(String value1, String value2) { + addCriterion("qr_code_content not between", value1, value2, "qrCodeContent"); + return (Criteria) this; + } + + public Criteria andQrCodeImgUrlIsNull() { + addCriterion("qr_code_img_url is null"); + return (Criteria) this; + } + + public Criteria andQrCodeImgUrlIsNotNull() { + addCriterion("qr_code_img_url is not null"); + return (Criteria) this; + } + + public Criteria andQrCodeImgUrlEqualTo(String value) { + addCriterion("qr_code_img_url =", value, "qrCodeImgUrl"); + return (Criteria) this; + } + + public Criteria andQrCodeImgUrlNotEqualTo(String value) { + addCriterion("qr_code_img_url <>", value, "qrCodeImgUrl"); + return (Criteria) this; + } + + public Criteria andQrCodeImgUrlGreaterThan(String value) { + addCriterion("qr_code_img_url >", value, "qrCodeImgUrl"); + return (Criteria) this; + } + + public Criteria andQrCodeImgUrlGreaterThanOrEqualTo(String value) { + addCriterion("qr_code_img_url >=", value, "qrCodeImgUrl"); + return (Criteria) this; + } + + public Criteria andQrCodeImgUrlLessThan(String value) { + addCriterion("qr_code_img_url <", value, "qrCodeImgUrl"); + return (Criteria) this; + } + + public Criteria andQrCodeImgUrlLessThanOrEqualTo(String value) { + addCriterion("qr_code_img_url <=", value, "qrCodeImgUrl"); + return (Criteria) this; + } + + public Criteria andQrCodeImgUrlLike(String value) { + addCriterion("qr_code_img_url like", value, "qrCodeImgUrl"); + return (Criteria) this; + } + + public Criteria andQrCodeImgUrlNotLike(String value) { + addCriterion("qr_code_img_url not like", value, "qrCodeImgUrl"); + return (Criteria) this; + } + + public Criteria andQrCodeImgUrlIn(List values) { + addCriterion("qr_code_img_url in", values, "qrCodeImgUrl"); + return (Criteria) this; + } + + public Criteria andQrCodeImgUrlNotIn(List values) { + addCriterion("qr_code_img_url not in", values, "qrCodeImgUrl"); + return (Criteria) this; + } + + public Criteria andQrCodeImgUrlBetween(String value1, String value2) { + addCriterion("qr_code_img_url between", value1, value2, "qrCodeImgUrl"); + return (Criteria) this; + } + + public Criteria andQrCodeImgUrlNotBetween(String value1, String value2) { + addCriterion("qr_code_img_url not between", value1, value2, "qrCodeImgUrl"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("`status` is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("`status` is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Integer value) { + addCriterion("`status` =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Integer value) { + addCriterion("`status` <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Integer value) { + addCriterion("`status` >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("`status` >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Integer value) { + addCriterion("`status` <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Integer value) { + addCriterion("`status` <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("`status` not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Integer value1, Integer value2) { + addCriterion("`status` between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Integer value1, Integer value2) { + addCriterion("`status` not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andExt1IsNull() { + addCriterion("ext_1 is null"); + return (Criteria) this; + } + + public Criteria andExt1IsNotNull() { + addCriterion("ext_1 is not null"); + return (Criteria) this; + } + + public Criteria andExt1EqualTo(String value) { + addCriterion("ext_1 =", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotEqualTo(String value) { + addCriterion("ext_1 <>", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThan(String value) { + addCriterion("ext_1 >", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThanOrEqualTo(String value) { + addCriterion("ext_1 >=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThan(String value) { + addCriterion("ext_1 <", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThanOrEqualTo(String value) { + addCriterion("ext_1 <=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Like(String value) { + addCriterion("ext_1 like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotLike(String value) { + addCriterion("ext_1 not like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1In(List values) { + addCriterion("ext_1 in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotIn(List values) { + addCriterion("ext_1 not in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Between(String value1, String value2) { + addCriterion("ext_1 between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotBetween(String value1, String value2) { + addCriterion("ext_1 not between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt2IsNull() { + addCriterion("ext_2 is null"); + return (Criteria) this; + } + + public Criteria andExt2IsNotNull() { + addCriterion("ext_2 is not null"); + return (Criteria) this; + } + + public Criteria andExt2EqualTo(String value) { + addCriterion("ext_2 =", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotEqualTo(String value) { + addCriterion("ext_2 <>", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThan(String value) { + addCriterion("ext_2 >", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThanOrEqualTo(String value) { + addCriterion("ext_2 >=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThan(String value) { + addCriterion("ext_2 <", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThanOrEqualTo(String value) { + addCriterion("ext_2 <=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Like(String value) { + addCriterion("ext_2 like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotLike(String value) { + addCriterion("ext_2 not like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2In(List values) { + addCriterion("ext_2 in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotIn(List values) { + addCriterion("ext_2 not in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Between(String value1, String value2) { + addCriterion("ext_2 between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotBetween(String value1, String value2) { + addCriterion("ext_2 not between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt3IsNull() { + addCriterion("ext_3 is null"); + return (Criteria) this; + } + + public Criteria andExt3IsNotNull() { + addCriterion("ext_3 is not null"); + return (Criteria) this; + } + + public Criteria andExt3EqualTo(String value) { + addCriterion("ext_3 =", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotEqualTo(String value) { + addCriterion("ext_3 <>", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThan(String value) { + addCriterion("ext_3 >", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThanOrEqualTo(String value) { + addCriterion("ext_3 >=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThan(String value) { + addCriterion("ext_3 <", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThanOrEqualTo(String value) { + addCriterion("ext_3 <=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Like(String value) { + addCriterion("ext_3 like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotLike(String value) { + addCriterion("ext_3 not like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3In(List values) { + addCriterion("ext_3 in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotIn(List values) { + addCriterion("ext_3 not in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Between(String value1, String value2) { + addCriterion("ext_3 between", value1, value2, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotBetween(String value1, String value2) { + addCriterion("ext_3 not between", value1, value2, "ext3"); + return (Criteria) this; + } + } + + /** + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/service/group/impl/BsStoreProductCategoryServiceImpl.java b/service/src/main/java/com/hfkj/service/group/impl/BsStoreProductCategoryServiceImpl.java index 5bf9ffc..7c77299 100644 --- a/service/src/main/java/com/hfkj/service/group/impl/BsStoreProductCategoryServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/group/impl/BsStoreProductCategoryServiceImpl.java @@ -174,7 +174,7 @@ public class BsStoreProductCategoryServiceImpl implements BsStoreProductCategory List storeProductData = storeGroupService.getStoreProductByList(param); for (BsStoreProductCategory category : categoryData) { - category.setProductList(storeProductData.stream().filter(o -> o.getProductCategoryId().equals(category.getId())).collect(Collectors.toList())); + category.setProductList(storeProductData.stream().filter(o -> o.getProductCategoryId() != null && o.getProductCategoryId().equals(category.getId())).collect(Collectors.toList())); categoryList.add(category); } diff --git a/service/src/main/java/com/hfkj/service/meal/BsMealTableService.java b/service/src/main/java/com/hfkj/service/meal/BsMealTableService.java new file mode 100644 index 0000000..50beaa8 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/meal/BsMealTableService.java @@ -0,0 +1,49 @@ +package com.hfkj.service.meal; + +import com.hfkj.entity.BsMealTable; + +import java.util.List; +import java.util.Map; + +/** + * 扫码点餐【桌台、桌码】 + * @className: BsMealTableService + * @author: HuRui + * @date: 2023/11/29 + **/ +public interface BsMealTableService { + + /** + * 编辑数据 + * @param data + */ + void editData(BsMealTable data); + + /** + * 生成桌台 + * @param storeId 门店 + * @param generateNum 数量 + */ + void generateTable(Long storeId, Integer generateNum); + + /** + * 删除桌台 + * @param serialNumber + */ + void delTable(String serialNumber); + + /** + * 查询桌台 + * @param serialNumber + * @return + */ + BsMealTable getTableBySerialNumber(String serialNumber); + + /** + * 查询桌台列表 + * @param param + * @return + */ + List getTableList(Map param); + +} diff --git a/service/src/main/java/com/hfkj/service/meal/BsMealTableServiceImpl.java b/service/src/main/java/com/hfkj/service/meal/BsMealTableServiceImpl.java new file mode 100644 index 0000000..8b6851e --- /dev/null +++ b/service/src/main/java/com/hfkj/service/meal/BsMealTableServiceImpl.java @@ -0,0 +1,174 @@ +package com.hfkj.service.meal; + +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.GenerateUtil; +import com.hfkj.common.utils.IDGenerator; +import com.hfkj.config.CommonSysConst; +import com.hfkj.dao.BsMealTableMapper; +import com.hfkj.entity.BsMealTable; +import com.hfkj.entity.BsMealTableExample; +import com.hfkj.entity.BsMer; +import com.hfkj.entity.BsStore; +import com.hfkj.model.MerBasisModel; +import com.hfkj.service.BsMerService; +import com.hfkj.service.BsStoreService; +import com.hfkj.sysenum.*; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.Random; + +/** + * @className: BsMealTableServiceImpl + * @author: HuRui + * @date: 2023/11/29 + **/ +@Service("mealTableService") +public class BsMealTableServiceImpl implements BsMealTableService { + + @Resource + private BsMealTableMapper mealTableMapper; + + @Resource + private BsStoreService storeService; + + @Resource + private BsMerService merService; + + @Resource + private RedisTemplate redisTemplate; + + @Override + public void editData(BsMealTable data) { + if (data.getId() == null) { + data.setCreateTime(new Date()); + data.setUpdateTime(new Date()); + mealTableMapper.insert(data); + } else { + data.setUpdateTime(new Date()); + mealTableMapper.updateByPrimaryKey(data); + } + } + + @Override + public void generateTable(Long storeId, Integer generateNum) { + String lockKey = "GENERATE_TABLE_"+storeId; + try { + Boolean lock = redisTemplate.opsForValue().setIfAbsent(lockKey, null); + if(lock) { + // 加锁成功 + + // 查询门店 + BsStore store = storeService.getStoreById(storeId); + if (store == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的门店"); + } + // 查询商户 + BsMer mer = merService.getMer(store.getMerId()); + if (mer == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户"); + } + Integer tableNumber = mealTableMapper.getMaxTableNum(store.getId()); + if (tableNumber == null) { + tableNumber = 0; + } + + for (int i = 0; i < generateNum; i++) { + BsMealTable mealTable = new BsMealTable(); + mealTable.setMerId(mer.getId()); + mealTable.setMerNo(mer.getMerNo()); + mealTable.setMerName(mer.getMerName()); + mealTable.setMerAbbreviate(mer.getMerAbbreviate()); + mealTable.setStoreId(store.getId()); + mealTable.setStoreName(store.getName()); + // 桌码唯一编号 13位时间戳 + 1位线程生成数 + mealTable.setSerialNumber(System.currentTimeMillis()+IDGenerator.nextId(1)); + mealTable.setTableNumber(tableNumber + 1); + mealTable.setTableName(mealTable.getTableNumber() + "号桌"); + mealTable.setStatus(MealTableStatusEnum.status1.getNumber()); + + // 生成二维码 + String file = "/mealTableQrCode/" + storeId + "/" + mealTable.getSerialNumber() + ".png"; + mealTable.setQrCodeContent("www.baidu.com"); + QRCodeGenerator.generateQRCodeImage( + mealTable.getQrCodeContent(), + 350, + 350, + CommonSysConst.getSysConfig().getFilesystem() + file + ); + mealTable.setQrCodeImgUrl(CommonSysConst.getSysConfig().getDomainName() + "/filesystem" + file); + editData(mealTable); + } + redisTemplate.delete(lockKey); + + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请勿频繁生成,正在生成中..."); + } + } 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, "生成失败!未知错误"); + } + } + + @Override + public void delTable(String serialNumber) { + // 查询桌台 + BsMealTable mealTable = getTableBySerialNumber(serialNumber); + if (mealTable == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的桌台"); + } + if (!mealTable.getStatus().equals(MealTableStatusEnum.status1.getNumber())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "桌台正在使用中..."); + } + mealTable.setStatus(MealTableStatusEnum.status0.getNumber()); + editData(mealTable); + } + + @Override + public BsMealTable getTableBySerialNumber(String serialNumber) { + BsMealTableExample example = new BsMealTableExample(); + example.createCriteria().andSerialNumberEqualTo(serialNumber) + .andStatusNotEqualTo(MealTableStatusEnum.status0.getNumber()); + List list = mealTableMapper.selectByExample(example); + if (!list.isEmpty()) { + return list.get(0); + } + return null; + } + + @Override + public List getTableList(Map param) { + BsMealTableExample example = new BsMealTableExample(); + BsMealTableExample.Criteria criteria = example.createCriteria() + .andStatusNotEqualTo(MealTableStatusEnum.status0.getNumber()); + + if (MapUtils.getLong(param, "storeId") != null) { + criteria.andStoreIdEqualTo(MapUtils.getLong(param, "storeId")); + } + + if (StringUtils.isNotBlank(MapUtils.getString(param, "tableName"))) { + criteria.andTableNameLike("%"+MapUtils.getString(param, "tableName")+"%"); + } + + if (MapUtils.getInteger(param, "status") != null) { + criteria.andStatusEqualTo(MapUtils.getInteger(param, "status")); + } + + example.setOrderByClause("table_number"); + return mealTableMapper.selectByExample(example); + } +} diff --git a/service/src/main/java/com/hfkj/sysenum/MealTableStatusEnum.java b/service/src/main/java/com/hfkj/sysenum/MealTableStatusEnum.java new file mode 100644 index 0000000..07d41e1 --- /dev/null +++ b/service/src/main/java/com/hfkj/sysenum/MealTableStatusEnum.java @@ -0,0 +1,51 @@ +package com.hfkj.sysenum; + +import java.util.Objects; + +/** + * @className: MealTableStatusEnum + * @author: HuRui + * @date: 2023/11/29 + **/ +public enum MealTableStatusEnum { + + status0(0, "不可用"), + status1(1, "未开台"), + status2(2, "已开台"), + ; + + private Integer number; + + private String name; + + MealTableStatusEnum(int number, String name) { + this.number = number; + this.name = name; + } + + public static MealTableStatusEnum getDataByNumber(Integer number) { + for (MealTableStatusEnum ele : values()) { + if (Objects.equals(number,ele.getNumber())) { + return ele; + } + } + return null; + } + + + 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; + } +}