diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighGasOilGunNoController.java b/hai-bweb/src/main/java/com/bweb/controller/HighGasOilGunNoController.java new file mode 100644 index 00000000..32edb3e8 --- /dev/null +++ b/hai-bweb/src/main/java/com/bweb/controller/HighGasOilGunNoController.java @@ -0,0 +1,118 @@ +package com.bweb.controller; + +import com.alibaba.fastjson.JSONObject; +import com.hai.common.exception.ErrorCode; +import com.hai.common.exception.ErrorHelp; +import com.hai.common.exception.SysCode; +import com.hai.common.utils.ResponseMsgUtil; +import com.hai.entity.HighGasOilGunNo; +import com.hai.entity.HighGasOilPrice; +import com.hai.entity.SecDictionary; +import com.hai.model.HighMerchantStoreModel; +import com.hai.model.ResponseData; +import com.hai.service.CommonService; +import com.hai.service.HighGasOilGunNoService; +import com.hai.service.HighGasOilPriceService; +import com.hai.service.HighMerchantStoreService; +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.math.BigDecimal; +import java.util.List; + +@Controller +@RequestMapping(value = "/gasOilGunNo") +@Api(value = "加油站枪号配置") +public class HighGasOilGunNoController { + + private static Logger log = LoggerFactory.getLogger(HighGasOilGunNoController.class); + + @Resource + private HighGasOilGunNoService gasOilGunNoService; + + @Resource + private HighGasOilPriceService gasOilPriceService; + + @Resource + private CommonService commonService; + + @RequestMapping(value="/addGasOilPrice",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "增加油站枪号") + public ResponseData addGasOilPrice(@RequestBody JSONObject body) { + try { + if (body.getLong("oilPriceId") == null || body.getInteger("gunNo") == null) { + log.error("HighGasDiscountOilPriceController -> editGasOilPrice() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + // 油品价格 + HighGasOilPrice oilPrice = gasOilPriceService.getGasOilPriceById(body.getLong("oilPriceId")); + if (oilPrice == null) { + log.error("HighGasDiscountOilPriceController -> editGasOilPrice() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "油品价格"); + } + HighGasOilGunNo gasOilGunNo = new HighGasOilGunNo(); + gasOilGunNo.setGasOilPriceId(body.getLong("oilPriceId")); + gasOilGunNo.setOilNo(oilPrice.getOilNo()); + gasOilGunNo.setOilNoName(oilPrice.getOilNoName()); + gasOilGunNo.setOilType(oilPrice.getOilType()); + gasOilGunNo.setOilTypeName(oilPrice.getOilTypeName()); + gasOilGunNo.setGunNo(body.getInteger("gunNo")); + gasOilGunNoService.editGunNo(gasOilGunNo); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("HighGasOilGunNoController -> editGasOilPrice() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/delGunNo",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "删除油枪号") + public ResponseData delGunNo(@RequestBody JSONObject body) { + try { + if (body.getLong("gunNoId") == null) { + log.error("HighGasDiscountOilPriceController -> editGasOilPrice() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + // 查询价格 + HighGasOilGunNo gunNo = gasOilGunNoService.getGunNoById(body.getLong("gunNoId")); + if (gunNo == null) { + log.error("HighGasDiscountOilPriceController -> editGasOilPrice() error!","未找到油品价格"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油品价格"); + } + gunNo.setStatus(0); + gasOilGunNoService.editGunNo(gunNo); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("HighGasOilGunNoController -> delGunNo() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getGunNoListByOilPrice",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询油品价格列表") + public ResponseData getGunNoListByOilPrice(@RequestParam(name = "oilPriceId", required = true) Long oilPriceId) { + try { + + return ResponseMsgUtil.success(gasOilGunNoService.getGunNoListByOilPrice(oilPriceId)); + + } catch (Exception e) { + log.error("HighGasOilGunNoController -> getGunNoListByOilPrice() error!",e); + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighGasOilPriceController.java b/hai-bweb/src/main/java/com/bweb/controller/HighGasOilPriceController.java new file mode 100644 index 00000000..5dcd3704 --- /dev/null +++ b/hai-bweb/src/main/java/com/bweb/controller/HighGasOilPriceController.java @@ -0,0 +1,144 @@ +package com.bweb.controller; + +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hai.common.exception.ErrorCode; +import com.hai.common.exception.ErrorHelp; +import com.hai.common.exception.SysCode; +import com.hai.common.utils.ResponseMsgUtil; +import com.hai.entity.HighGasDiscountOilPrice; +import com.hai.entity.HighGasOilPrice; +import com.hai.entity.HighMerchantStore; +import com.hai.entity.SecDictionary; +import com.hai.enum_type.MerchantStoreSourceType; +import com.hai.model.HighMerchantStoreModel; +import com.hai.model.ResponseData; +import com.hai.service.CommonService; +import com.hai.service.HighGasDiscountOilPriceService; +import com.hai.service.HighGasOilPriceService; +import com.hai.service.HighMerchantStoreService; +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.math.BigDecimal; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +@Controller +@RequestMapping(value = "/gasOilPrice") +@Api(value = "油品价格配置") +public class HighGasOilPriceController { + + private static Logger log = LoggerFactory.getLogger(HighGasOilPriceController.class); + + @Resource + private HighGasOilPriceService gasOilPriceService; + + @Resource + private HighMerchantStoreService merchantStoreService; + + @Resource + private CommonService commonService; + + @RequestMapping(value="/editGasOilPrice",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "编辑油品价格") + public ResponseData editGasOilPrice(@RequestBody JSONObject body) { + try { + if (body.getLong("storeId") == null + || StringUtils.isBlank(body.getString("oilNo")) + || body.getBigDecimal("priceGun") == null + || body.getBigDecimal("priceVip") == null + ) { + log.error("HighGasDiscountOilPriceController -> editGasOilPrice() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + // 查询门店详情 + HighMerchantStoreModel store = merchantStoreService.getMerchantStoreById(body.getLong("storeId")); + if (store == null) { + log.error("HighGasDiscountOilPriceController -> editGasOilPrice() error!","未找到门店"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到门店"); + } + if (!store.getType().equals(1)) { + log.error("HighGasDiscountOilPriceController -> editGasOilPrice() error!","门店不是加油站"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "门店不是加油站"); + } + SecDictionary oilNo = commonService.mappingSysCode("GAS_OIL_TYPE", body.getString("oilNo")); + if (oilNo == null) { + log.error("HighGasDiscountOilPriceController -> editGasOilPrice() error!","未找到油品"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油品"); + } + // 查询价格 + HighGasOilPrice price = gasOilPriceService.getGasOilPriceByStoreAndOilNo(body.getLong("storeId"), Integer.valueOf(body.getString("oilNo"))); + if (price == null) { + price = new HighGasOilPrice(); + } + price.setMerchantStoreId(body.getLong("storeId")); + price.setOilNo(Integer.parseInt(oilNo.getCodeValue())); + price.setOilNoName(oilNo.getCodeName()); + price.setPriceVip(body.getBigDecimal("priceVip")); + price.setPriceGun(body.getBigDecimal("priceGun")); + price.setPriceOfficial(new BigDecimal("8")); + price.setOilType(Integer.parseInt(oilNo.getExt1())); + price.setOilTypeName(oilNo.getExt2()); + gasOilPriceService.editGasOilPrice(price); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("HighGasDiscountOilPriceController -> getGasDetailByStoreKey() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/delOilPrice",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "删除油品价格") + public ResponseData delOilPrice(@RequestBody JSONObject body) { + try { + if (body.getLong("storeId") == null || StringUtils.isBlank(body.getString("oilNo")) ) { + log.error("HighGasDiscountOilPriceController -> editGasOilPrice() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + // 查询价格 + HighGasOilPrice price = gasOilPriceService.getGasOilPriceByStoreAndOilNo(body.getLong("storeId"), Integer.valueOf(body.getString("oilNo"))); + if (price == null) { + log.error("HighGasDiscountOilPriceController -> editGasOilPrice() error!","未找到油品价格"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油品价格"); + } + price.setStatus(0); + gasOilPriceService.editGasOilPrice(price); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("HighGasDiscountOilPriceController -> getGasDetailByStoreKey() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getOilPriceListByStore",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询油品价格列表") + public ResponseData getOilPriceListByStore(@RequestParam(name = "storeId", required = true) Long storeId) { + try { + + return ResponseMsgUtil.success(gasOilPriceService.getGasOilPriceByStore(storeId)); + + } catch (Exception e) { + log.error("HighGasDiscountOilPriceController -> getOilPriceListByStore() error!",e); + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/hai-service/src/main/java/com/hai/dao/HighGasOilGunNoMapper.java b/hai-service/src/main/java/com/hai/dao/HighGasOilGunNoMapper.java new file mode 100644 index 00000000..f877ac72 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighGasOilGunNoMapper.java @@ -0,0 +1,125 @@ +package com.hai.dao; + +import com.hai.entity.HighGasOilGunNo; +import com.hai.entity.HighGasOilGunNoExample; +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 HighGasOilGunNoMapper extends HighGasOilGunNoMapperExt { + @SelectProvider(type=HighGasOilGunNoSqlProvider.class, method="countByExample") + long countByExample(HighGasOilGunNoExample example); + + @DeleteProvider(type=HighGasOilGunNoSqlProvider.class, method="deleteByExample") + int deleteByExample(HighGasOilGunNoExample example); + + @Delete({ + "delete from high_gas_oil_gun_no", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into high_gas_oil_gun_no (gas_oil_price_id, oil_no, ", + "oil_no_name, oil_type, ", + "oil_type_name, gun_no, ", + "`status`, create_time, ", + "ext_1, ext_2, ext_3)", + "values (#{gasOilPriceId,jdbcType=BIGINT}, #{oilNo,jdbcType=INTEGER}, ", + "#{oilNoName,jdbcType=VARCHAR}, #{oilType,jdbcType=INTEGER}, ", + "#{oilTypeName,jdbcType=VARCHAR}, #{gunNo,jdbcType=INTEGER}, ", + "#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(HighGasOilGunNo record); + + @InsertProvider(type=HighGasOilGunNoSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(HighGasOilGunNo record); + + @SelectProvider(type=HighGasOilGunNoSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="gas_oil_price_id", property="gasOilPriceId", jdbcType=JdbcType.BIGINT), + @Result(column="oil_no", property="oilNo", jdbcType=JdbcType.INTEGER), + @Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_type", property="oilType", jdbcType=JdbcType.INTEGER), + @Result(column="oil_type_name", property="oilTypeName", jdbcType=JdbcType.VARCHAR), + @Result(column="gun_no", property="gunNo", jdbcType=JdbcType.INTEGER), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="create_time", property="createTime", 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(HighGasOilGunNoExample example); + + @Select({ + "select", + "id, gas_oil_price_id, oil_no, oil_no_name, oil_type, oil_type_name, gun_no, ", + "`status`, create_time, ext_1, ext_2, ext_3", + "from high_gas_oil_gun_no", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="gas_oil_price_id", property="gasOilPriceId", jdbcType=JdbcType.BIGINT), + @Result(column="oil_no", property="oilNo", jdbcType=JdbcType.INTEGER), + @Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_type", property="oilType", jdbcType=JdbcType.INTEGER), + @Result(column="oil_type_name", property="oilTypeName", jdbcType=JdbcType.VARCHAR), + @Result(column="gun_no", property="gunNo", jdbcType=JdbcType.INTEGER), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="create_time", property="createTime", 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) + }) + HighGasOilGunNo selectByPrimaryKey(Long id); + + @UpdateProvider(type=HighGasOilGunNoSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") HighGasOilGunNo record, @Param("example") HighGasOilGunNoExample example); + + @UpdateProvider(type=HighGasOilGunNoSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") HighGasOilGunNo record, @Param("example") HighGasOilGunNoExample example); + + @UpdateProvider(type=HighGasOilGunNoSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(HighGasOilGunNo record); + + @Update({ + "update high_gas_oil_gun_no", + "set gas_oil_price_id = #{gasOilPriceId,jdbcType=BIGINT},", + "oil_no = #{oilNo,jdbcType=INTEGER},", + "oil_no_name = #{oilNoName,jdbcType=VARCHAR},", + "oil_type = #{oilType,jdbcType=INTEGER},", + "oil_type_name = #{oilTypeName,jdbcType=VARCHAR},", + "gun_no = #{gunNo,jdbcType=INTEGER},", + "`status` = #{status,jdbcType=INTEGER},", + "create_time = #{createTime,jdbcType=TIMESTAMP},", + "ext_1 = #{ext1,jdbcType=VARCHAR},", + "ext_2 = #{ext2,jdbcType=VARCHAR},", + "ext_3 = #{ext3,jdbcType=VARCHAR}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(HighGasOilGunNo record); +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighGasOilGunNoMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighGasOilGunNoMapperExt.java new file mode 100644 index 00000000..e610e353 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighGasOilGunNoMapperExt.java @@ -0,0 +1,7 @@ +package com.hai.dao; + +/** + * mapper扩展类 + */ +public interface HighGasOilGunNoMapperExt { +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighGasOilGunNoSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighGasOilGunNoSqlProvider.java new file mode 100644 index 00000000..63c3a19d --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighGasOilGunNoSqlProvider.java @@ -0,0 +1,332 @@ +package com.hai.dao; + +import com.hai.entity.HighGasOilGunNo; +import com.hai.entity.HighGasOilGunNoExample.Criteria; +import com.hai.entity.HighGasOilGunNoExample.Criterion; +import com.hai.entity.HighGasOilGunNoExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class HighGasOilGunNoSqlProvider { + + public String countByExample(HighGasOilGunNoExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("high_gas_oil_gun_no"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(HighGasOilGunNoExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("high_gas_oil_gun_no"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(HighGasOilGunNo record) { + SQL sql = new SQL(); + sql.INSERT_INTO("high_gas_oil_gun_no"); + + if (record.getGasOilPriceId() != null) { + sql.VALUES("gas_oil_price_id", "#{gasOilPriceId,jdbcType=BIGINT}"); + } + + if (record.getOilNo() != null) { + sql.VALUES("oil_no", "#{oilNo,jdbcType=INTEGER}"); + } + + if (record.getOilNoName() != null) { + sql.VALUES("oil_no_name", "#{oilNoName,jdbcType=VARCHAR}"); + } + + if (record.getOilType() != null) { + sql.VALUES("oil_type", "#{oilType,jdbcType=INTEGER}"); + } + + if (record.getOilTypeName() != null) { + sql.VALUES("oil_type_name", "#{oilTypeName,jdbcType=VARCHAR}"); + } + + if (record.getGunNo() != null) { + sql.VALUES("gun_no", "#{gunNo,jdbcType=INTEGER}"); + } + + if (record.getStatus() != null) { + sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.VALUES("create_time", "#{createTime,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(HighGasOilGunNoExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("gas_oil_price_id"); + sql.SELECT("oil_no"); + sql.SELECT("oil_no_name"); + sql.SELECT("oil_type"); + sql.SELECT("oil_type_name"); + sql.SELECT("gun_no"); + sql.SELECT("`status`"); + sql.SELECT("create_time"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("high_gas_oil_gun_no"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + HighGasOilGunNo record = (HighGasOilGunNo) parameter.get("record"); + HighGasOilGunNoExample example = (HighGasOilGunNoExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("high_gas_oil_gun_no"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getGasOilPriceId() != null) { + sql.SET("gas_oil_price_id = #{record.gasOilPriceId,jdbcType=BIGINT}"); + } + + if (record.getOilNo() != null) { + sql.SET("oil_no = #{record.oilNo,jdbcType=INTEGER}"); + } + + if (record.getOilNoName() != null) { + sql.SET("oil_no_name = #{record.oilNoName,jdbcType=VARCHAR}"); + } + + if (record.getOilType() != null) { + sql.SET("oil_type = #{record.oilType,jdbcType=INTEGER}"); + } + + if (record.getOilTypeName() != null) { + sql.SET("oil_type_name = #{record.oilTypeName,jdbcType=VARCHAR}"); + } + + if (record.getGunNo() != null) { + sql.SET("gun_no = #{record.gunNo,jdbcType=INTEGER}"); + } + + 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.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("high_gas_oil_gun_no"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("gas_oil_price_id = #{record.gasOilPriceId,jdbcType=BIGINT}"); + sql.SET("oil_no = #{record.oilNo,jdbcType=INTEGER}"); + sql.SET("oil_no_name = #{record.oilNoName,jdbcType=VARCHAR}"); + sql.SET("oil_type = #{record.oilType,jdbcType=INTEGER}"); + sql.SET("oil_type_name = #{record.oilTypeName,jdbcType=VARCHAR}"); + sql.SET("gun_no = #{record.gunNo,jdbcType=INTEGER}"); + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + sql.SET("create_time = #{record.createTime,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}"); + + HighGasOilGunNoExample example = (HighGasOilGunNoExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(HighGasOilGunNo record) { + SQL sql = new SQL(); + sql.UPDATE("high_gas_oil_gun_no"); + + if (record.getGasOilPriceId() != null) { + sql.SET("gas_oil_price_id = #{gasOilPriceId,jdbcType=BIGINT}"); + } + + if (record.getOilNo() != null) { + sql.SET("oil_no = #{oilNo,jdbcType=INTEGER}"); + } + + if (record.getOilNoName() != null) { + sql.SET("oil_no_name = #{oilNoName,jdbcType=VARCHAR}"); + } + + if (record.getOilType() != null) { + sql.SET("oil_type = #{oilType,jdbcType=INTEGER}"); + } + + if (record.getOilTypeName() != null) { + sql.SET("oil_type_name = #{oilTypeName,jdbcType=VARCHAR}"); + } + + if (record.getGunNo() != null) { + sql.SET("gun_no = #{gunNo,jdbcType=INTEGER}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{status,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{createTime,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, HighGasOilGunNoExample 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/hai-service/src/main/java/com/hai/entity/HighGasOilGunNo.java b/hai-service/src/main/java/com/hai/entity/HighGasOilGunNo.java new file mode 100644 index 00000000..68e3b5d6 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighGasOilGunNo.java @@ -0,0 +1,232 @@ +package com.hai.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * high_gas_oil_gun_no + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class HighGasOilGunNo implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 油品价格id + */ + private Long gasOilPriceId; + + /** + * 油号 + */ + private Integer oilNo; + + /** + * 油品名称 + */ + private String oilNoName; + + /** + * 油品类型 1:汽油:2:柴油;3:天然气 + */ + private Integer oilType; + + /** + * 燃油类型名 1:汽油:2:柴油;3:天然气 + */ + private String oilTypeName; + + /** + * 枪号 + */ + private Integer gunNo; + + /** + * 状态 0:删除 1:正常 + */ + private Integer status; + + /** + * 创建时间 + */ + private Date createTime; + + 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 getGasOilPriceId() { + return gasOilPriceId; + } + + public void setGasOilPriceId(Long gasOilPriceId) { + this.gasOilPriceId = gasOilPriceId; + } + + public Integer getOilNo() { + return oilNo; + } + + public void setOilNo(Integer oilNo) { + this.oilNo = oilNo; + } + + public String getOilNoName() { + return oilNoName; + } + + public void setOilNoName(String oilNoName) { + this.oilNoName = oilNoName; + } + + public Integer getOilType() { + return oilType; + } + + public void setOilType(Integer oilType) { + this.oilType = oilType; + } + + public String getOilTypeName() { + return oilTypeName; + } + + public void setOilTypeName(String oilTypeName) { + this.oilTypeName = oilTypeName; + } + + public Integer getGunNo() { + return gunNo; + } + + public void setGunNo(Integer gunNo) { + this.gunNo = gunNo; + } + + 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 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; + } + HighGasOilGunNo other = (HighGasOilGunNo) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getGasOilPriceId() == null ? other.getGasOilPriceId() == null : this.getGasOilPriceId().equals(other.getGasOilPriceId())) + && (this.getOilNo() == null ? other.getOilNo() == null : this.getOilNo().equals(other.getOilNo())) + && (this.getOilNoName() == null ? other.getOilNoName() == null : this.getOilNoName().equals(other.getOilNoName())) + && (this.getOilType() == null ? other.getOilType() == null : this.getOilType().equals(other.getOilType())) + && (this.getOilTypeName() == null ? other.getOilTypeName() == null : this.getOilTypeName().equals(other.getOilTypeName())) + && (this.getGunNo() == null ? other.getGunNo() == null : this.getGunNo().equals(other.getGunNo())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (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 + ((getGasOilPriceId() == null) ? 0 : getGasOilPriceId().hashCode()); + result = prime * result + ((getOilNo() == null) ? 0 : getOilNo().hashCode()); + result = prime * result + ((getOilNoName() == null) ? 0 : getOilNoName().hashCode()); + result = prime * result + ((getOilType() == null) ? 0 : getOilType().hashCode()); + result = prime * result + ((getOilTypeName() == null) ? 0 : getOilTypeName().hashCode()); + result = prime * result + ((getGunNo() == null) ? 0 : getGunNo().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().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(", gasOilPriceId=").append(gasOilPriceId); + sb.append(", oilNo=").append(oilNo); + sb.append(", oilNoName=").append(oilNoName); + sb.append(", oilType=").append(oilType); + sb.append(", oilTypeName=").append(oilTypeName); + sb.append(", gunNo=").append(gunNo); + sb.append(", status=").append(status); + sb.append(", createTime=").append(createTime); + 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/hai-service/src/main/java/com/hai/entity/HighGasOilGunNoExample.java b/hai-service/src/main/java/com/hai/entity/HighGasOilGunNoExample.java new file mode 100644 index 00000000..d6c2731b --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighGasOilGunNoExample.java @@ -0,0 +1,993 @@ +package com.hai.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class HighGasOilGunNoExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public HighGasOilGunNoExample() { + 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 andGasOilPriceIdIsNull() { + addCriterion("gas_oil_price_id is null"); + return (Criteria) this; + } + + public Criteria andGasOilPriceIdIsNotNull() { + addCriterion("gas_oil_price_id is not null"); + return (Criteria) this; + } + + public Criteria andGasOilPriceIdEqualTo(Long value) { + addCriterion("gas_oil_price_id =", value, "gasOilPriceId"); + return (Criteria) this; + } + + public Criteria andGasOilPriceIdNotEqualTo(Long value) { + addCriterion("gas_oil_price_id <>", value, "gasOilPriceId"); + return (Criteria) this; + } + + public Criteria andGasOilPriceIdGreaterThan(Long value) { + addCriterion("gas_oil_price_id >", value, "gasOilPriceId"); + return (Criteria) this; + } + + public Criteria andGasOilPriceIdGreaterThanOrEqualTo(Long value) { + addCriterion("gas_oil_price_id >=", value, "gasOilPriceId"); + return (Criteria) this; + } + + public Criteria andGasOilPriceIdLessThan(Long value) { + addCriterion("gas_oil_price_id <", value, "gasOilPriceId"); + return (Criteria) this; + } + + public Criteria andGasOilPriceIdLessThanOrEqualTo(Long value) { + addCriterion("gas_oil_price_id <=", value, "gasOilPriceId"); + return (Criteria) this; + } + + public Criteria andGasOilPriceIdIn(List values) { + addCriterion("gas_oil_price_id in", values, "gasOilPriceId"); + return (Criteria) this; + } + + public Criteria andGasOilPriceIdNotIn(List values) { + addCriterion("gas_oil_price_id not in", values, "gasOilPriceId"); + return (Criteria) this; + } + + public Criteria andGasOilPriceIdBetween(Long value1, Long value2) { + addCriterion("gas_oil_price_id between", value1, value2, "gasOilPriceId"); + return (Criteria) this; + } + + public Criteria andGasOilPriceIdNotBetween(Long value1, Long value2) { + addCriterion("gas_oil_price_id not between", value1, value2, "gasOilPriceId"); + return (Criteria) this; + } + + public Criteria andOilNoIsNull() { + addCriterion("oil_no is null"); + return (Criteria) this; + } + + public Criteria andOilNoIsNotNull() { + addCriterion("oil_no is not null"); + return (Criteria) this; + } + + public Criteria andOilNoEqualTo(Integer value) { + addCriterion("oil_no =", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoNotEqualTo(Integer value) { + addCriterion("oil_no <>", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoGreaterThan(Integer value) { + addCriterion("oil_no >", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoGreaterThanOrEqualTo(Integer value) { + addCriterion("oil_no >=", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoLessThan(Integer value) { + addCriterion("oil_no <", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoLessThanOrEqualTo(Integer value) { + addCriterion("oil_no <=", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoIn(List values) { + addCriterion("oil_no in", values, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoNotIn(List values) { + addCriterion("oil_no not in", values, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoBetween(Integer value1, Integer value2) { + addCriterion("oil_no between", value1, value2, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoNotBetween(Integer value1, Integer value2) { + addCriterion("oil_no not between", value1, value2, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoNameIsNull() { + addCriterion("oil_no_name is null"); + return (Criteria) this; + } + + public Criteria andOilNoNameIsNotNull() { + addCriterion("oil_no_name is not null"); + return (Criteria) this; + } + + public Criteria andOilNoNameEqualTo(String value) { + addCriterion("oil_no_name =", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameNotEqualTo(String value) { + addCriterion("oil_no_name <>", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameGreaterThan(String value) { + addCriterion("oil_no_name >", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameGreaterThanOrEqualTo(String value) { + addCriterion("oil_no_name >=", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameLessThan(String value) { + addCriterion("oil_no_name <", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameLessThanOrEqualTo(String value) { + addCriterion("oil_no_name <=", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameLike(String value) { + addCriterion("oil_no_name like", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameNotLike(String value) { + addCriterion("oil_no_name not like", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameIn(List values) { + addCriterion("oil_no_name in", values, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameNotIn(List values) { + addCriterion("oil_no_name not in", values, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameBetween(String value1, String value2) { + addCriterion("oil_no_name between", value1, value2, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameNotBetween(String value1, String value2) { + addCriterion("oil_no_name not between", value1, value2, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilTypeIsNull() { + addCriterion("oil_type is null"); + return (Criteria) this; + } + + public Criteria andOilTypeIsNotNull() { + addCriterion("oil_type is not null"); + return (Criteria) this; + } + + public Criteria andOilTypeEqualTo(Integer value) { + addCriterion("oil_type =", value, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeNotEqualTo(Integer value) { + addCriterion("oil_type <>", value, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeGreaterThan(Integer value) { + addCriterion("oil_type >", value, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("oil_type >=", value, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeLessThan(Integer value) { + addCriterion("oil_type <", value, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeLessThanOrEqualTo(Integer value) { + addCriterion("oil_type <=", value, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeIn(List values) { + addCriterion("oil_type in", values, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeNotIn(List values) { + addCriterion("oil_type not in", values, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeBetween(Integer value1, Integer value2) { + addCriterion("oil_type between", value1, value2, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeNotBetween(Integer value1, Integer value2) { + addCriterion("oil_type not between", value1, value2, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeNameIsNull() { + addCriterion("oil_type_name is null"); + return (Criteria) this; + } + + public Criteria andOilTypeNameIsNotNull() { + addCriterion("oil_type_name is not null"); + return (Criteria) this; + } + + public Criteria andOilTypeNameEqualTo(String value) { + addCriterion("oil_type_name =", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameNotEqualTo(String value) { + addCriterion("oil_type_name <>", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameGreaterThan(String value) { + addCriterion("oil_type_name >", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameGreaterThanOrEqualTo(String value) { + addCriterion("oil_type_name >=", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameLessThan(String value) { + addCriterion("oil_type_name <", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameLessThanOrEqualTo(String value) { + addCriterion("oil_type_name <=", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameLike(String value) { + addCriterion("oil_type_name like", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameNotLike(String value) { + addCriterion("oil_type_name not like", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameIn(List values) { + addCriterion("oil_type_name in", values, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameNotIn(List values) { + addCriterion("oil_type_name not in", values, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameBetween(String value1, String value2) { + addCriterion("oil_type_name between", value1, value2, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameNotBetween(String value1, String value2) { + addCriterion("oil_type_name not between", value1, value2, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andGunNoIsNull() { + addCriterion("gun_no is null"); + return (Criteria) this; + } + + public Criteria andGunNoIsNotNull() { + addCriterion("gun_no is not null"); + return (Criteria) this; + } + + public Criteria andGunNoEqualTo(Integer value) { + addCriterion("gun_no =", value, "gunNo"); + return (Criteria) this; + } + + public Criteria andGunNoNotEqualTo(Integer value) { + addCriterion("gun_no <>", value, "gunNo"); + return (Criteria) this; + } + + public Criteria andGunNoGreaterThan(Integer value) { + addCriterion("gun_no >", value, "gunNo"); + return (Criteria) this; + } + + public Criteria andGunNoGreaterThanOrEqualTo(Integer value) { + addCriterion("gun_no >=", value, "gunNo"); + return (Criteria) this; + } + + public Criteria andGunNoLessThan(Integer value) { + addCriterion("gun_no <", value, "gunNo"); + return (Criteria) this; + } + + public Criteria andGunNoLessThanOrEqualTo(Integer value) { + addCriterion("gun_no <=", value, "gunNo"); + return (Criteria) this; + } + + public Criteria andGunNoIn(List values) { + addCriterion("gun_no in", values, "gunNo"); + return (Criteria) this; + } + + public Criteria andGunNoNotIn(List values) { + addCriterion("gun_no not in", values, "gunNo"); + return (Criteria) this; + } + + public Criteria andGunNoBetween(Integer value1, Integer value2) { + addCriterion("gun_no between", value1, value2, "gunNo"); + return (Criteria) this; + } + + public Criteria andGunNoNotBetween(Integer value1, Integer value2) { + addCriterion("gun_no not between", value1, value2, "gunNo"); + 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 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/hai-service/src/main/java/com/hai/service/HighGasOilGunNoService.java b/hai-service/src/main/java/com/hai/service/HighGasOilGunNoService.java new file mode 100644 index 00000000..58c31905 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/HighGasOilGunNoService.java @@ -0,0 +1,31 @@ +package com.hai.service; + +import com.hai.entity.HighGasOilGunNo; + +import java.util.List; + +/** + * 油站枪号 + * @author hurui + */ +public interface HighGasOilGunNoService { + + /** + * 编辑抢号 + * @param gasOilGunNo + */ + void editGunNo(HighGasOilGunNo gasOilGunNo); + + /** + * 删除抢号 + * @param id + */ + HighGasOilGunNo getGunNoById(Long id); + + /** + * 查询抢号列表 + * @param oilPriceId + * @return + */ + List getGunNoListByOilPrice(Long oilPriceId); +} diff --git a/hai-service/src/main/java/com/hai/service/HighGasOilPriceService.java b/hai-service/src/main/java/com/hai/service/HighGasOilPriceService.java index 10749587..fe801660 100644 --- a/hai-service/src/main/java/com/hai/service/HighGasOilPriceService.java +++ b/hai-service/src/main/java/com/hai/service/HighGasOilPriceService.java @@ -13,6 +13,13 @@ public interface HighGasOilPriceService { */ void editGasOilPrice(HighGasOilPrice highGasOilPrice); + /** + * 根据id查询 + * @param id + * @return + */ + HighGasOilPrice getGasOilPriceById(Long id); + /** * 根据门店和油号查询 * @param storeId diff --git a/hai-service/src/main/java/com/hai/service/impl/HighGasOilGunNoServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighGasOilGunNoServiceImpl.java new file mode 100644 index 00000000..6f5118e7 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/impl/HighGasOilGunNoServiceImpl.java @@ -0,0 +1,41 @@ +package com.hai.service.impl; + +import com.hai.dao.HighGasOilGunNoMapper; +import com.hai.entity.HighGasOilGunNo; +import com.hai.entity.HighGasOilGunNoExample; +import com.hai.service.HighGasOilGunNoService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +@Service("gasOilPriceService") +public class HighGasOilGunNoServiceImpl implements HighGasOilGunNoService { + + @Resource + private HighGasOilGunNoMapper gasOilGunNoMapper; + + @Override + public void editGunNo(HighGasOilGunNo gasOilGunNo) { + if (gasOilGunNo.getId() == null) { + gasOilGunNo.setCreateTime(new Date()); + gasOilGunNo.setStatus(1); + gasOilGunNoMapper.insert(gasOilGunNo); + } else { + gasOilGunNoMapper.updateByPrimaryKey(gasOilGunNo); + } + } + + @Override + public HighGasOilGunNo getGunNoById(Long id) { + return gasOilGunNoMapper.selectByPrimaryKey(id); + } + + @Override + public List getGunNoListByOilPrice(Long oilPriceId) { + HighGasOilGunNoExample example = new HighGasOilGunNoExample(); + example.createCriteria().andGasOilPriceIdEqualTo(oilPriceId); + return gasOilGunNoMapper.selectByExample(example); + } +} diff --git a/hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceServiceImpl.java index 56ed3aba..01575079 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceServiceImpl.java @@ -27,6 +27,11 @@ public class HighGasOilPriceServiceImpl implements HighGasOilPriceService { } } + @Override + public HighGasOilPrice getGasOilPriceById(Long id) { + return highGasOilPriceMapper.selectByPrimaryKey(id); + } + @Override public HighGasOilPrice getGasOilPriceByStoreAndOilNo(Long storeId, Integer oilNo) { HighGasOilPriceExample example = new HighGasOilPriceExample();