diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighGasOilPriceOfficialController.java b/hai-bweb/src/main/java/com/bweb/controller/HighGasOilPriceOfficialController.java new file mode 100644 index 00000000..351e4aaa --- /dev/null +++ b/hai-bweb/src/main/java/com/bweb/controller/HighGasOilPriceOfficialController.java @@ -0,0 +1,113 @@ +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.HighGasOilPrice; +import com.hai.entity.HighGasOilPriceOfficial; +import com.hai.model.ResponseData; +import com.hai.service.HighGasOilPriceOfficialService; +import com.hai.service.HighGasOilPriceService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +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.List; +import java.util.Map; + +@Controller +@RequestMapping(value = "/gasOilPriceOfficial") +@Api(value = "油品价格配置") +public class HighGasOilPriceOfficialController { + + private static Logger log = LoggerFactory.getLogger(HighGasOilPriceOfficialController.class); + + @Resource + private HighGasOilPriceOfficialService gasOilPriceOfficialService; + + private HighGasOilPriceService highGasOilPriceService; + + @RequestMapping(value="/updateOilPriceOfficial",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "修改油品国标价价格") + public ResponseData updateOilPriceOfficial(@RequestBody JSONObject body) { + try { + if (body.getLong("regionId") == null + || body.getInteger("oilNo") == null + || body.getBigDecimal("price") == null + ) { + log.error("HighGasDiscountOilPriceController -> updateOilPriceOfficial() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + HighGasOilPriceOfficial price = gasOilPriceOfficialService.getPrice(body.getLong("regionId"), body.getInteger("oilNo")); + if (price == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到价格"); + } + price.setPriceOfficial(body.getBigDecimal("price")); + gasOilPriceOfficialService.editPrice(body.getLong("regionId"), body.getInteger("oilNo"), body.getBigDecimal("price")); + + new Thread(() -> { + // 查询区域下的油品 + List list = highGasOilPriceService.getPriceListByRegionAndOilNo(body.getLong("regionId"), body.getInteger("oilNo")); + for (HighGasOilPrice gasOilPrice : list) { + gasOilPrice.setPriceOfficial(body.getBigDecimal("price")); + highGasOilPriceService.editGasOilPrice(gasOilPrice); + } + }).start(); + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("HighGasOilPriceOfficialController -> updateOilPriceOfficial() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getOilPriceOfficialDetail",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询油品国标价详情") + public ResponseData getOilPriceOfficialDetail(@RequestParam(name = "regionId", required = true) Long regionId, + @RequestParam(name = "oilNo", required = true) Integer oilNo) { + try { + + return ResponseMsgUtil.success(gasOilPriceOfficialService.getPrice(regionId,oilNo)); + + } catch (Exception e) { + log.error("HighGasOilPriceOfficialController -> getOilPriceOfficialDetail() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getOilPriceOfficialList",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询油品国标价列表") + public ResponseData getOilPriceOfficialList(@RequestParam(name = "regionName", required = false) String regionName, + @RequestParam(name = "oilNo", required = false) Integer oilNo, + @RequestParam(name = "oilType", required = false) Integer oilType, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize) { + try { + + Map param = new HashMap<>(); + param.put("regionName", regionName); + param.put("oilNo", oilNo); + param.put("oilType", oilType); + + PageHelper.startPage(pageNum,pageSize); + return ResponseMsgUtil.success(new PageInfo<>(gasOilPriceOfficialService.getPriceList(param))); + + } catch (Exception e) { + log.error("HighGasOilPriceOfficialController -> getOilPriceOfficialList() error!",e); + return ResponseMsgUtil.exception(e); + } + } +} diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighGasOilPriceTaskController.java b/hai-bweb/src/main/java/com/bweb/controller/HighGasOilPriceTaskController.java new file mode 100644 index 00000000..f0c2a0e3 --- /dev/null +++ b/hai-bweb/src/main/java/com/bweb/controller/HighGasOilPriceTaskController.java @@ -0,0 +1,118 @@ +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.model.ResponseData; +import com.hai.service.HighGasOilPriceTaskService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +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; + +@Controller +@RequestMapping(value = "/gasOilPriceTask") +@Api(value = "油品价格配置") +public class HighGasOilPriceTaskController { + + private static Logger log = LoggerFactory.getLogger(HighGasOilPriceTaskController.class); + + @Resource + private HighGasOilPriceTaskService gasOilPriceTaskService; + + @RequestMapping(value="/addTask",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "增加任务") + public ResponseData addTask(@RequestBody JSONObject body) { + try { + if (body.getLong("regionId") == null + || body.getInteger("oilNo") == null + || body.getBigDecimal("price") == null + ) { + log.error("HighGasDiscountOilPriceController -> updateOilPriceOfficial() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("HighGasOilPriceTaskController -> addTask() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/delTask",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "删除任务") + public ResponseData delTask(@RequestBody JSONObject body) { + try { + if (body.getLong("taskId") == null) { + log.error("HighGasOilPriceTaskController -> delTask() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + gasOilPriceTaskService.delTask(body.getLong("taskId")); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("HighGasOilPriceTaskController -> delTask() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getTaskDetail",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询任务详情") + public ResponseData getTaskDetail(@RequestParam(name = "taskId", required = true) Long taskId) { + try { + + return ResponseMsgUtil.success(gasOilPriceTaskService.getDetailById(taskId)); + + } catch (Exception e) { + log.error("HighGasOilPriceTaskController -> getTaskDetail() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getTaskList",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询任务列表") + public ResponseData getTaskList(@RequestParam(name = "regionId", required = false) Integer regionId, + @RequestParam(name = "regionName", required = false) String regionName, + @RequestParam(name = "merStoreId", required = false) Integer merStoreId, + @RequestParam(name = "merStoreName", required = false) String merStoreName, + @RequestParam(name = "oilType", required = false) Integer oilType, + @RequestParam(name = "oilNo", required = false) Integer oilNo, + @RequestParam(name = "priceType", required = false) Integer priceType, + @RequestParam(name = "executionType", required = false) Integer executionType, + @RequestParam(name = "status", required = false) Integer status, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize) { + try { + Map param = new HashMap<>(); + param.put("regionId", regionId); + param.put("regionName", regionName); + param.put("status", status); + param.put("status", status); + + PageHelper.startPage(pageNum,pageSize); + return ResponseMsgUtil.success(new PageInfo<>(gasOilPriceTaskService.getTaskList(param))); + + } catch (Exception e) { + log.error("HighGasOilPriceTaskController -> getTaskList() error!",e); + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java b/hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java index 3be2c75a..5896070e 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java @@ -11,15 +11,13 @@ import com.hai.common.exception.SysCode; import com.hai.common.security.SessionObject; import com.hai.common.security.UserCenter; import com.hai.common.utils.ResponseMsgUtil; +import com.hai.entity.BsCompany; import com.hai.entity.HighMerchant; import com.hai.entity.HighMerchantStore; import com.hai.entity.SecRegion; import com.hai.enum_type.MerchantStoreSourceType; import com.hai.model.*; -import com.hai.service.CommonService; -import com.hai.service.HighMerchantService; -import com.hai.service.HighMerchantStoreService; -import com.hai.service.SecUserService; +import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; @@ -57,6 +55,9 @@ public class HighMerchantStoreController { @Resource private HighMerchantStoreService highMerchantStoreService; + @Resource + private BsCompanyService bsCompanyService; + @Resource private HighMerchantService highMerchantService; @@ -95,12 +96,17 @@ public class HighMerchantStoreController { log.error("HighMerchantStoreController -> insertMerchantStore() error!","未找到商户"); throw ErrorHelp.genException(SysCode.System, ErrorCode.MERCHANT_NOF_FOUND, ""); } + BsCompany company = bsCompanyService.getCompanyById(merchant.getCompanyId()); + if (company == null) { + log.error("HighMerchantStoreController -> insertMerchantStore() error!","未找到分公司"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.MERCHANT_NOF_FOUND, ""); + } Map regionMap = commonService.getParentInfoByRegionId(highMerchantStore.getRegionId()); if (highMerchantStore.getType() != null && highMerchantStore.getType().equals(1)) { - highMerchantStore.setRegionId(regionMap.get("region").getParentId()); - highMerchantStore.setRegionName(commonService.getRegionName(regionMap.get("region").getParentId())); + highMerchantStore.setRegionId(Long.parseLong(company.getRegionId())); + highMerchantStore.setRegionName(commonService.getRegionName(Long.parseLong(company.getRegionId()))); } else { // 如果是重庆市的区县,使用重庆市的区域代码 if (regionMap.get("region").getRegionId().intValue() == 500100) { diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java b/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java index 24b2c8f5..c2d28294 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java @@ -232,6 +232,7 @@ public class HighGasController { param.put("cityName", null); param.put("countyCode", null); param.put("countyName", null); + param.put("goodsId", store.getId()); param.put("gasId", store.getStoreKey()); param.put("gasName", store.getStoreName()); param.put("gasAddress", store.getAddress()); @@ -280,6 +281,7 @@ public class HighGasController { JSONObject jsonObject = TuanYouConfig.queryGasInfoByGasId(storeKey); if (jsonObject != null && jsonObject.getString("code").equals("200")) { JSONObject result = jsonObject.getJSONObject("result"); + result.put("goodsId", store.getId()); // 原始油品价格 JSONArray originalOilPriceList = result.getJSONArray("oilPriceList"); @@ -350,6 +352,9 @@ public class HighGasController { @RequestParam(name = "latitude", required = true) String latitude, @RequestParam(name = "isTyAgent", required = false) Boolean isTyAgent) { try { + if (StringUtils.isBlank(latitude) || StringUtils.isBlank(latitude)) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } Map station = gasOilPriceService.recentGasStation(longitude, latitude); if (station == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "附近没有加油站哦"); @@ -374,6 +379,7 @@ public class HighGasController { param.put("cityName", null); param.put("countyCode", null); param.put("countyName", null); + param.put("goodsId", store.getId()); param.put("gasId", store.getStoreKey()); param.put("gasName", store.getStoreName()); param.put("gasAddress", store.getAddress()); @@ -422,6 +428,7 @@ public class HighGasController { JSONObject jsonObject = TuanYouConfig.queryGasInfoByGasId(MapUtils.getString(station, "storeKey")); if (jsonObject != null && jsonObject.getString("code").equals("200")) { JSONObject result = jsonObject.getJSONObject("result"); + result.put("goodsId", store.getId()); // 原始油品价格 JSONArray originalOilPriceList = result.getJSONArray("oilPriceList"); diff --git a/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java b/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java index 8d5f7a4f..42e6a085 100644 --- a/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java +++ b/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java @@ -7,10 +7,12 @@ import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.config.TuanYouConfig; import com.hai.entity.HighGasOilPrice; +import com.hai.entity.HighGasOilPriceOfficial; import com.hai.entity.HighMerchantStore; import com.hai.enum_type.GasOilPriceStatusEnum; import com.hai.model.HighMerchantModel; import com.hai.model.HighMerchantStoreModel; +import com.hai.service.HighGasOilPriceOfficialService; import com.hai.service.HighGasOilPriceService; import com.hai.service.HighMerchantService; import com.hai.service.HighMerchantStoreService; @@ -37,6 +39,9 @@ public class HighGasSchedule { @Resource private HighGasOilPriceService highGasOilPriceService; + @Resource + private HighGasOilPriceOfficialService gasOilPriceOfficialService; + @Scheduled(cron = "0 0 1 * * ?") //每日凌晨1点执行一次 public void certification() throws Exception { HighMerchantModel merchant = highMerchantService.getMerchantById(39L); @@ -145,4 +150,12 @@ public class HighGasSchedule { } } } + + @Scheduled(cron = "0 1 7 * * ?") //每日7点1分执行一次 + public void refreshPriceOfficial() throws Exception { + gasOilPriceOfficialService.refreshPriceOfficial(); + + + gasOilPriceOfficialService.refreshGasPriceOfficial(null, null); + } } diff --git a/hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapperExt.java index 010ebc21..e4cd226c 100644 --- a/hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapperExt.java @@ -1,7 +1,11 @@ package com.hai.dao; +import com.hai.entity.HighGasOilPrice; 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.type.JdbcType; import java.util.List; import java.util.Map; @@ -37,4 +41,27 @@ public interface HighGasOilPriceMapperExt { " FROM high_merchant_store a,high_gas_oil_price b where a.type = 1 and a.`status` = 1 and a.id = b.merchant_store_id and b.`status` = 1 GROUP BY a.id" + " ORDER BY distance asc LIMIT 1 "}) Map recentGasStation(@Param("longitude") String longitude,@Param("latitude") String latitude); + + @Select({" select b.* from high_merchant_store a, high_gas_oil_price b " + + " where a.id = b.merchant_store_id " + + " and a.`status` = 1 " + + " and a.region_id = #{regionId} " + + " and b.oil_no = #{oilNo} "}) + @Results({ + @Result(column="id", property="id", jdbcType= JdbcType.BIGINT, id=true), + @Result(column="merchant_store_id", property="merchantStoreId", jdbcType=JdbcType.BIGINT), + @Result(column="oil_no", property="oilNo", jdbcType=JdbcType.INTEGER), + @Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR), + @Result(column="preferential_margin", property="preferentialMargin", jdbcType=JdbcType.DECIMAL), + @Result(column="price_vip", property="priceVip", jdbcType=JdbcType.DECIMAL), + @Result(column="price_gun", property="priceGun", jdbcType=JdbcType.DECIMAL), + @Result(column="price_official", property="priceOfficial", jdbcType=JdbcType.DECIMAL), + @Result(column="oil_type", property="oilType", jdbcType=JdbcType.INTEGER), + @Result(column="oil_type_name", property="oilTypeName", jdbcType=JdbcType.VARCHAR), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @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 selectPriceListByRegionAndOilNo(@Param("regionId") Long regionId, @Param("oilNo") Integer oilNo); } diff --git a/hai-service/src/main/java/com/hai/dao/HighGasOilPriceTaskMapper.java b/hai-service/src/main/java/com/hai/dao/HighGasOilPriceTaskMapper.java new file mode 100644 index 00000000..3db09123 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighGasOilPriceTaskMapper.java @@ -0,0 +1,167 @@ +package com.hai.dao; + +import com.hai.entity.HighGasOilPriceTask; +import com.hai.entity.HighGasOilPriceTaskExample; +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 HighGasOilPriceTaskMapper extends HighGasOilPriceTaskMapperExt { + @SelectProvider(type=HighGasOilPriceTaskSqlProvider.class, method="countByExample") + long countByExample(HighGasOilPriceTaskExample example); + + @DeleteProvider(type=HighGasOilPriceTaskSqlProvider.class, method="deleteByExample") + int deleteByExample(HighGasOilPriceTaskExample example); + + @Delete({ + "delete from high_gas_oil_price_task", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into high_gas_oil_price_task (region_id, region_name, ", + "mer_store_id, mer_store_name, ", + "mer_store_address, oil_type, ", + "oil_type_name, oil_no, ", + "oil_no_name, price_type, ", + "price, execution_type, ", + "start_time, `status`, ", + "create_time, update_time, ", + "op_user_id, op_user_name, ", + "ext_1, ext_2, ext_3)", + "values (#{regionId,jdbcType=BIGINT}, #{regionName,jdbcType=VARCHAR}, ", + "#{merStoreId,jdbcType=BIGINT}, #{merStoreName,jdbcType=VARCHAR}, ", + "#{merStoreAddress,jdbcType=VARCHAR}, #{oilType,jdbcType=INTEGER}, ", + "#{oilTypeName,jdbcType=VARCHAR}, #{oilNo,jdbcType=INTEGER}, ", + "#{oilNoName,jdbcType=VARCHAR}, #{priceType,jdbcType=INTEGER}, ", + "#{price,jdbcType=DECIMAL}, #{executionType,jdbcType=INTEGER}, ", + "#{startTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ", + "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", + "#{opUserId,jdbcType=BIGINT}, #{opUserName,jdbcType=VARCHAR}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(HighGasOilPriceTask record); + + @InsertProvider(type=HighGasOilPriceTaskSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(HighGasOilPriceTask record); + + @SelectProvider(type=HighGasOilPriceTaskSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="region_id", property="regionId", jdbcType=JdbcType.BIGINT), + @Result(column="region_name", property="regionName", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_store_id", property="merStoreId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_store_name", property="merStoreName", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_store_address", property="merStoreAddress", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_type", property="oilType", jdbcType=JdbcType.INTEGER), + @Result(column="oil_type_name", property="oilTypeName", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_no", property="oilNo", jdbcType=JdbcType.INTEGER), + @Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR), + @Result(column="price_type", property="priceType", jdbcType=JdbcType.INTEGER), + @Result(column="price", property="price", jdbcType=JdbcType.DECIMAL), + @Result(column="execution_type", property="executionType", jdbcType=JdbcType.INTEGER), + @Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP), + @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="op_user_id", property="opUserId", jdbcType=JdbcType.BIGINT), + @Result(column="op_user_name", property="opUserName", jdbcType=JdbcType.VARCHAR), + @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(HighGasOilPriceTaskExample example); + + @Select({ + "select", + "id, region_id, region_name, mer_store_id, mer_store_name, mer_store_address, ", + "oil_type, oil_type_name, oil_no, oil_no_name, price_type, price, execution_type, ", + "start_time, `status`, create_time, update_time, op_user_id, op_user_name, ext_1, ", + "ext_2, ext_3", + "from high_gas_oil_price_task", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="region_id", property="regionId", jdbcType=JdbcType.BIGINT), + @Result(column="region_name", property="regionName", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_store_id", property="merStoreId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_store_name", property="merStoreName", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_store_address", property="merStoreAddress", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_type", property="oilType", jdbcType=JdbcType.INTEGER), + @Result(column="oil_type_name", property="oilTypeName", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_no", property="oilNo", jdbcType=JdbcType.INTEGER), + @Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR), + @Result(column="price_type", property="priceType", jdbcType=JdbcType.INTEGER), + @Result(column="price", property="price", jdbcType=JdbcType.DECIMAL), + @Result(column="execution_type", property="executionType", jdbcType=JdbcType.INTEGER), + @Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP), + @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="op_user_id", property="opUserId", jdbcType=JdbcType.BIGINT), + @Result(column="op_user_name", property="opUserName", jdbcType=JdbcType.VARCHAR), + @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) + }) + HighGasOilPriceTask selectByPrimaryKey(Long id); + + @UpdateProvider(type=HighGasOilPriceTaskSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") HighGasOilPriceTask record, @Param("example") HighGasOilPriceTaskExample example); + + @UpdateProvider(type=HighGasOilPriceTaskSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") HighGasOilPriceTask record, @Param("example") HighGasOilPriceTaskExample example); + + @UpdateProvider(type=HighGasOilPriceTaskSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(HighGasOilPriceTask record); + + @Update({ + "update high_gas_oil_price_task", + "set region_id = #{regionId,jdbcType=BIGINT},", + "region_name = #{regionName,jdbcType=VARCHAR},", + "mer_store_id = #{merStoreId,jdbcType=BIGINT},", + "mer_store_name = #{merStoreName,jdbcType=VARCHAR},", + "mer_store_address = #{merStoreAddress,jdbcType=VARCHAR},", + "oil_type = #{oilType,jdbcType=INTEGER},", + "oil_type_name = #{oilTypeName,jdbcType=VARCHAR},", + "oil_no = #{oilNo,jdbcType=INTEGER},", + "oil_no_name = #{oilNoName,jdbcType=VARCHAR},", + "price_type = #{priceType,jdbcType=INTEGER},", + "price = #{price,jdbcType=DECIMAL},", + "execution_type = #{executionType,jdbcType=INTEGER},", + "start_time = #{startTime,jdbcType=TIMESTAMP},", + "`status` = #{status,jdbcType=INTEGER},", + "create_time = #{createTime,jdbcType=TIMESTAMP},", + "update_time = #{updateTime,jdbcType=TIMESTAMP},", + "op_user_id = #{opUserId,jdbcType=BIGINT},", + "op_user_name = #{opUserName,jdbcType=VARCHAR},", + "ext_1 = #{ext1,jdbcType=VARCHAR},", + "ext_2 = #{ext2,jdbcType=VARCHAR},", + "ext_3 = #{ext3,jdbcType=VARCHAR}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(HighGasOilPriceTask record); +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighGasOilPriceTaskMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighGasOilPriceTaskMapperExt.java new file mode 100644 index 00000000..8fa60ab4 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighGasOilPriceTaskMapperExt.java @@ -0,0 +1,7 @@ +package com.hai.dao; + +/** + * mapper扩展类 + */ +public interface HighGasOilPriceTaskMapperExt { +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighGasOilPriceTaskSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighGasOilPriceTaskSqlProvider.java new file mode 100644 index 00000000..fa514857 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighGasOilPriceTaskSqlProvider.java @@ -0,0 +1,472 @@ +package com.hai.dao; + +import com.hai.entity.HighGasOilPriceTask; +import com.hai.entity.HighGasOilPriceTaskExample.Criteria; +import com.hai.entity.HighGasOilPriceTaskExample.Criterion; +import com.hai.entity.HighGasOilPriceTaskExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class HighGasOilPriceTaskSqlProvider { + + public String countByExample(HighGasOilPriceTaskExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("high_gas_oil_price_task"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(HighGasOilPriceTaskExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("high_gas_oil_price_task"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(HighGasOilPriceTask record) { + SQL sql = new SQL(); + sql.INSERT_INTO("high_gas_oil_price_task"); + + if (record.getRegionId() != null) { + sql.VALUES("region_id", "#{regionId,jdbcType=BIGINT}"); + } + + if (record.getRegionName() != null) { + sql.VALUES("region_name", "#{regionName,jdbcType=VARCHAR}"); + } + + if (record.getMerStoreId() != null) { + sql.VALUES("mer_store_id", "#{merStoreId,jdbcType=BIGINT}"); + } + + if (record.getMerStoreName() != null) { + sql.VALUES("mer_store_name", "#{merStoreName,jdbcType=VARCHAR}"); + } + + if (record.getMerStoreAddress() != null) { + sql.VALUES("mer_store_address", "#{merStoreAddress,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.getOilNo() != null) { + sql.VALUES("oil_no", "#{oilNo,jdbcType=INTEGER}"); + } + + if (record.getOilNoName() != null) { + sql.VALUES("oil_no_name", "#{oilNoName,jdbcType=VARCHAR}"); + } + + if (record.getPriceType() != null) { + sql.VALUES("price_type", "#{priceType,jdbcType=INTEGER}"); + } + + if (record.getPrice() != null) { + sql.VALUES("price", "#{price,jdbcType=DECIMAL}"); + } + + if (record.getExecutionType() != null) { + sql.VALUES("execution_type", "#{executionType,jdbcType=INTEGER}"); + } + + if (record.getStartTime() != null) { + sql.VALUES("start_time", "#{startTime,jdbcType=TIMESTAMP}"); + } + + 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.getOpUserId() != null) { + sql.VALUES("op_user_id", "#{opUserId,jdbcType=BIGINT}"); + } + + if (record.getOpUserName() != null) { + sql.VALUES("op_user_name", "#{opUserName,jdbcType=VARCHAR}"); + } + + 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(HighGasOilPriceTaskExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("region_id"); + sql.SELECT("region_name"); + sql.SELECT("mer_store_id"); + sql.SELECT("mer_store_name"); + sql.SELECT("mer_store_address"); + sql.SELECT("oil_type"); + sql.SELECT("oil_type_name"); + sql.SELECT("oil_no"); + sql.SELECT("oil_no_name"); + sql.SELECT("price_type"); + sql.SELECT("price"); + sql.SELECT("execution_type"); + sql.SELECT("start_time"); + sql.SELECT("`status`"); + sql.SELECT("create_time"); + sql.SELECT("update_time"); + sql.SELECT("op_user_id"); + sql.SELECT("op_user_name"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("high_gas_oil_price_task"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + HighGasOilPriceTask record = (HighGasOilPriceTask) parameter.get("record"); + HighGasOilPriceTaskExample example = (HighGasOilPriceTaskExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("high_gas_oil_price_task"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getRegionId() != null) { + sql.SET("region_id = #{record.regionId,jdbcType=BIGINT}"); + } + + if (record.getRegionName() != null) { + sql.SET("region_name = #{record.regionName,jdbcType=VARCHAR}"); + } + + if (record.getMerStoreId() != null) { + sql.SET("mer_store_id = #{record.merStoreId,jdbcType=BIGINT}"); + } + + if (record.getMerStoreName() != null) { + sql.SET("mer_store_name = #{record.merStoreName,jdbcType=VARCHAR}"); + } + + if (record.getMerStoreAddress() != null) { + sql.SET("mer_store_address = #{record.merStoreAddress,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.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.getPriceType() != null) { + sql.SET("price_type = #{record.priceType,jdbcType=INTEGER}"); + } + + if (record.getPrice() != null) { + sql.SET("price = #{record.price,jdbcType=DECIMAL}"); + } + + if (record.getExecutionType() != null) { + sql.SET("execution_type = #{record.executionType,jdbcType=INTEGER}"); + } + + if (record.getStartTime() != null) { + sql.SET("start_time = #{record.startTime,jdbcType=TIMESTAMP}"); + } + + 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.getOpUserId() != null) { + sql.SET("op_user_id = #{record.opUserId,jdbcType=BIGINT}"); + } + + if (record.getOpUserName() != null) { + sql.SET("op_user_name = #{record.opUserName,jdbcType=VARCHAR}"); + } + + 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_price_task"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("region_id = #{record.regionId,jdbcType=BIGINT}"); + sql.SET("region_name = #{record.regionName,jdbcType=VARCHAR}"); + sql.SET("mer_store_id = #{record.merStoreId,jdbcType=BIGINT}"); + sql.SET("mer_store_name = #{record.merStoreName,jdbcType=VARCHAR}"); + sql.SET("mer_store_address = #{record.merStoreAddress,jdbcType=VARCHAR}"); + sql.SET("oil_type = #{record.oilType,jdbcType=INTEGER}"); + sql.SET("oil_type_name = #{record.oilTypeName,jdbcType=VARCHAR}"); + sql.SET("oil_no = #{record.oilNo,jdbcType=INTEGER}"); + sql.SET("oil_no_name = #{record.oilNoName,jdbcType=VARCHAR}"); + sql.SET("price_type = #{record.priceType,jdbcType=INTEGER}"); + sql.SET("price = #{record.price,jdbcType=DECIMAL}"); + sql.SET("execution_type = #{record.executionType,jdbcType=INTEGER}"); + sql.SET("start_time = #{record.startTime,jdbcType=TIMESTAMP}"); + 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("op_user_id = #{record.opUserId,jdbcType=BIGINT}"); + sql.SET("op_user_name = #{record.opUserName,jdbcType=VARCHAR}"); + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + + HighGasOilPriceTaskExample example = (HighGasOilPriceTaskExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(HighGasOilPriceTask record) { + SQL sql = new SQL(); + sql.UPDATE("high_gas_oil_price_task"); + + if (record.getRegionId() != null) { + sql.SET("region_id = #{regionId,jdbcType=BIGINT}"); + } + + if (record.getRegionName() != null) { + sql.SET("region_name = #{regionName,jdbcType=VARCHAR}"); + } + + if (record.getMerStoreId() != null) { + sql.SET("mer_store_id = #{merStoreId,jdbcType=BIGINT}"); + } + + if (record.getMerStoreName() != null) { + sql.SET("mer_store_name = #{merStoreName,jdbcType=VARCHAR}"); + } + + if (record.getMerStoreAddress() != null) { + sql.SET("mer_store_address = #{merStoreAddress,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.getOilNo() != null) { + sql.SET("oil_no = #{oilNo,jdbcType=INTEGER}"); + } + + if (record.getOilNoName() != null) { + sql.SET("oil_no_name = #{oilNoName,jdbcType=VARCHAR}"); + } + + if (record.getPriceType() != null) { + sql.SET("price_type = #{priceType,jdbcType=INTEGER}"); + } + + if (record.getPrice() != null) { + sql.SET("price = #{price,jdbcType=DECIMAL}"); + } + + if (record.getExecutionType() != null) { + sql.SET("execution_type = #{executionType,jdbcType=INTEGER}"); + } + + if (record.getStartTime() != null) { + sql.SET("start_time = #{startTime,jdbcType=TIMESTAMP}"); + } + + 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.getOpUserId() != null) { + sql.SET("op_user_id = #{opUserId,jdbcType=BIGINT}"); + } + + if (record.getOpUserName() != null) { + sql.SET("op_user_name = #{opUserName,jdbcType=VARCHAR}"); + } + + 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, HighGasOilPriceTaskExample 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/HighGasOilPriceTask.java b/hai-service/src/main/java/com/hai/entity/HighGasOilPriceTask.java new file mode 100644 index 00000000..b4a50850 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighGasOilPriceTask.java @@ -0,0 +1,393 @@ +package com.hai.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * high_gas_oil_price_task + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class HighGasOilPriceTask implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 区域id + */ + private Long regionId; + + /** + * 区域名称 + */ + private String regionName; + + /** + * 加油站id + */ + private Long merStoreId; + + /** + * 加油站名称 + */ + private String merStoreName; + + /** + * 加油站地址 + */ + private String merStoreAddress; + + /** + * 油品类型 1:汽油:2:柴油;3:天然气 + */ + private Integer oilType; + + /** + * 油品类型名 1:汽油:2:柴油;3:天然气 + */ + private String oilTypeName; + + /** + * 油号 + */ + private Integer oilNo; + + /** + * 油品名称 + */ + private String oilNoName; + + /** + * 价格类型 1. 国标价 2. 油站价 3. 优惠幅度 + */ + private Integer priceType; + + /** + * 价格 + */ + private BigDecimal price; + + /** + * 执行类型 1. 立刻执行 2. 定时执行 + */ + private Integer executionType; + + /** + * 执行时间 + */ + private Date startTime; + + /** + * 状态 0:删除 1:等待中 2:已执行 + */ + private Integer status; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 修改时间 + */ + private Date updateTime; + + /** + * 操作人id + */ + private Long opUserId; + + /** + * 操作人名称 + */ + private String opUserName; + + 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 getRegionId() { + return regionId; + } + + public void setRegionId(Long regionId) { + this.regionId = regionId; + } + + public String getRegionName() { + return regionName; + } + + public void setRegionName(String regionName) { + this.regionName = regionName; + } + + public Long getMerStoreId() { + return merStoreId; + } + + public void setMerStoreId(Long merStoreId) { + this.merStoreId = merStoreId; + } + + public String getMerStoreName() { + return merStoreName; + } + + public void setMerStoreName(String merStoreName) { + this.merStoreName = merStoreName; + } + + public String getMerStoreAddress() { + return merStoreAddress; + } + + public void setMerStoreAddress(String merStoreAddress) { + this.merStoreAddress = merStoreAddress; + } + + 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 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 getPriceType() { + return priceType; + } + + public void setPriceType(Integer priceType) { + this.priceType = priceType; + } + + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + public Integer getExecutionType() { + return executionType; + } + + public void setExecutionType(Integer executionType) { + this.executionType = executionType; + } + + public Date getStartTime() { + return startTime; + } + + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + + 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 Long getOpUserId() { + return opUserId; + } + + public void setOpUserId(Long opUserId) { + this.opUserId = opUserId; + } + + public String getOpUserName() { + return opUserName; + } + + public void setOpUserName(String opUserName) { + this.opUserName = opUserName; + } + + 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; + } + HighGasOilPriceTask other = (HighGasOilPriceTask) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getRegionId() == null ? other.getRegionId() == null : this.getRegionId().equals(other.getRegionId())) + && (this.getRegionName() == null ? other.getRegionName() == null : this.getRegionName().equals(other.getRegionName())) + && (this.getMerStoreId() == null ? other.getMerStoreId() == null : this.getMerStoreId().equals(other.getMerStoreId())) + && (this.getMerStoreName() == null ? other.getMerStoreName() == null : this.getMerStoreName().equals(other.getMerStoreName())) + && (this.getMerStoreAddress() == null ? other.getMerStoreAddress() == null : this.getMerStoreAddress().equals(other.getMerStoreAddress())) + && (this.getOilType() == null ? other.getOilType() == null : this.getOilType().equals(other.getOilType())) + && (this.getOilTypeName() == null ? other.getOilTypeName() == null : this.getOilTypeName().equals(other.getOilTypeName())) + && (this.getOilNo() == null ? other.getOilNo() == null : this.getOilNo().equals(other.getOilNo())) + && (this.getOilNoName() == null ? other.getOilNoName() == null : this.getOilNoName().equals(other.getOilNoName())) + && (this.getPriceType() == null ? other.getPriceType() == null : this.getPriceType().equals(other.getPriceType())) + && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice())) + && (this.getExecutionType() == null ? other.getExecutionType() == null : this.getExecutionType().equals(other.getExecutionType())) + && (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime())) + && (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.getOpUserId() == null ? other.getOpUserId() == null : this.getOpUserId().equals(other.getOpUserId())) + && (this.getOpUserName() == null ? other.getOpUserName() == null : this.getOpUserName().equals(other.getOpUserName())) + && (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 + ((getRegionId() == null) ? 0 : getRegionId().hashCode()); + result = prime * result + ((getRegionName() == null) ? 0 : getRegionName().hashCode()); + result = prime * result + ((getMerStoreId() == null) ? 0 : getMerStoreId().hashCode()); + result = prime * result + ((getMerStoreName() == null) ? 0 : getMerStoreName().hashCode()); + result = prime * result + ((getMerStoreAddress() == null) ? 0 : getMerStoreAddress().hashCode()); + result = prime * result + ((getOilType() == null) ? 0 : getOilType().hashCode()); + result = prime * result + ((getOilTypeName() == null) ? 0 : getOilTypeName().hashCode()); + result = prime * result + ((getOilNo() == null) ? 0 : getOilNo().hashCode()); + result = prime * result + ((getOilNoName() == null) ? 0 : getOilNoName().hashCode()); + result = prime * result + ((getPriceType() == null) ? 0 : getPriceType().hashCode()); + result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode()); + result = prime * result + ((getExecutionType() == null) ? 0 : getExecutionType().hashCode()); + result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().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 + ((getOpUserId() == null) ? 0 : getOpUserId().hashCode()); + result = prime * result + ((getOpUserName() == null) ? 0 : getOpUserName().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(", regionId=").append(regionId); + sb.append(", regionName=").append(regionName); + sb.append(", merStoreId=").append(merStoreId); + sb.append(", merStoreName=").append(merStoreName); + sb.append(", merStoreAddress=").append(merStoreAddress); + sb.append(", oilType=").append(oilType); + sb.append(", oilTypeName=").append(oilTypeName); + sb.append(", oilNo=").append(oilNo); + sb.append(", oilNoName=").append(oilNoName); + sb.append(", priceType=").append(priceType); + sb.append(", price=").append(price); + sb.append(", executionType=").append(executionType); + sb.append(", startTime=").append(startTime); + sb.append(", status=").append(status); + sb.append(", createTime=").append(createTime); + sb.append(", updateTime=").append(updateTime); + sb.append(", opUserId=").append(opUserId); + sb.append(", opUserName=").append(opUserName); + 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/HighGasOilPriceTaskExample.java b/hai-service/src/main/java/com/hai/entity/HighGasOilPriceTaskExample.java new file mode 100644 index 00000000..601a1183 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighGasOilPriceTaskExample.java @@ -0,0 +1,1634 @@ +package com.hai.entity; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class HighGasOilPriceTaskExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public HighGasOilPriceTaskExample() { + 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 andRegionIdIsNull() { + addCriterion("region_id is null"); + return (Criteria) this; + } + + public Criteria andRegionIdIsNotNull() { + addCriterion("region_id is not null"); + return (Criteria) this; + } + + public Criteria andRegionIdEqualTo(Long value) { + addCriterion("region_id =", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdNotEqualTo(Long value) { + addCriterion("region_id <>", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdGreaterThan(Long value) { + addCriterion("region_id >", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdGreaterThanOrEqualTo(Long value) { + addCriterion("region_id >=", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdLessThan(Long value) { + addCriterion("region_id <", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdLessThanOrEqualTo(Long value) { + addCriterion("region_id <=", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdIn(List values) { + addCriterion("region_id in", values, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdNotIn(List values) { + addCriterion("region_id not in", values, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdBetween(Long value1, Long value2) { + addCriterion("region_id between", value1, value2, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdNotBetween(Long value1, Long value2) { + addCriterion("region_id not between", value1, value2, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionNameIsNull() { + addCriterion("region_name is null"); + return (Criteria) this; + } + + public Criteria andRegionNameIsNotNull() { + addCriterion("region_name is not null"); + return (Criteria) this; + } + + public Criteria andRegionNameEqualTo(String value) { + addCriterion("region_name =", value, "regionName"); + return (Criteria) this; + } + + public Criteria andRegionNameNotEqualTo(String value) { + addCriterion("region_name <>", value, "regionName"); + return (Criteria) this; + } + + public Criteria andRegionNameGreaterThan(String value) { + addCriterion("region_name >", value, "regionName"); + return (Criteria) this; + } + + public Criteria andRegionNameGreaterThanOrEqualTo(String value) { + addCriterion("region_name >=", value, "regionName"); + return (Criteria) this; + } + + public Criteria andRegionNameLessThan(String value) { + addCriterion("region_name <", value, "regionName"); + return (Criteria) this; + } + + public Criteria andRegionNameLessThanOrEqualTo(String value) { + addCriterion("region_name <=", value, "regionName"); + return (Criteria) this; + } + + public Criteria andRegionNameLike(String value) { + addCriterion("region_name like", value, "regionName"); + return (Criteria) this; + } + + public Criteria andRegionNameNotLike(String value) { + addCriterion("region_name not like", value, "regionName"); + return (Criteria) this; + } + + public Criteria andRegionNameIn(List values) { + addCriterion("region_name in", values, "regionName"); + return (Criteria) this; + } + + public Criteria andRegionNameNotIn(List values) { + addCriterion("region_name not in", values, "regionName"); + return (Criteria) this; + } + + public Criteria andRegionNameBetween(String value1, String value2) { + addCriterion("region_name between", value1, value2, "regionName"); + return (Criteria) this; + } + + public Criteria andRegionNameNotBetween(String value1, String value2) { + addCriterion("region_name not between", value1, value2, "regionName"); + return (Criteria) this; + } + + public Criteria andMerStoreIdIsNull() { + addCriterion("mer_store_id is null"); + return (Criteria) this; + } + + public Criteria andMerStoreIdIsNotNull() { + addCriterion("mer_store_id is not null"); + return (Criteria) this; + } + + public Criteria andMerStoreIdEqualTo(Long value) { + addCriterion("mer_store_id =", value, "merStoreId"); + return (Criteria) this; + } + + public Criteria andMerStoreIdNotEqualTo(Long value) { + addCriterion("mer_store_id <>", value, "merStoreId"); + return (Criteria) this; + } + + public Criteria andMerStoreIdGreaterThan(Long value) { + addCriterion("mer_store_id >", value, "merStoreId"); + return (Criteria) this; + } + + public Criteria andMerStoreIdGreaterThanOrEqualTo(Long value) { + addCriterion("mer_store_id >=", value, "merStoreId"); + return (Criteria) this; + } + + public Criteria andMerStoreIdLessThan(Long value) { + addCriterion("mer_store_id <", value, "merStoreId"); + return (Criteria) this; + } + + public Criteria andMerStoreIdLessThanOrEqualTo(Long value) { + addCriterion("mer_store_id <=", value, "merStoreId"); + return (Criteria) this; + } + + public Criteria andMerStoreIdIn(List values) { + addCriterion("mer_store_id in", values, "merStoreId"); + return (Criteria) this; + } + + public Criteria andMerStoreIdNotIn(List values) { + addCriterion("mer_store_id not in", values, "merStoreId"); + return (Criteria) this; + } + + public Criteria andMerStoreIdBetween(Long value1, Long value2) { + addCriterion("mer_store_id between", value1, value2, "merStoreId"); + return (Criteria) this; + } + + public Criteria andMerStoreIdNotBetween(Long value1, Long value2) { + addCriterion("mer_store_id not between", value1, value2, "merStoreId"); + return (Criteria) this; + } + + public Criteria andMerStoreNameIsNull() { + addCriterion("mer_store_name is null"); + return (Criteria) this; + } + + public Criteria andMerStoreNameIsNotNull() { + addCriterion("mer_store_name is not null"); + return (Criteria) this; + } + + public Criteria andMerStoreNameEqualTo(String value) { + addCriterion("mer_store_name =", value, "merStoreName"); + return (Criteria) this; + } + + public Criteria andMerStoreNameNotEqualTo(String value) { + addCriterion("mer_store_name <>", value, "merStoreName"); + return (Criteria) this; + } + + public Criteria andMerStoreNameGreaterThan(String value) { + addCriterion("mer_store_name >", value, "merStoreName"); + return (Criteria) this; + } + + public Criteria andMerStoreNameGreaterThanOrEqualTo(String value) { + addCriterion("mer_store_name >=", value, "merStoreName"); + return (Criteria) this; + } + + public Criteria andMerStoreNameLessThan(String value) { + addCriterion("mer_store_name <", value, "merStoreName"); + return (Criteria) this; + } + + public Criteria andMerStoreNameLessThanOrEqualTo(String value) { + addCriterion("mer_store_name <=", value, "merStoreName"); + return (Criteria) this; + } + + public Criteria andMerStoreNameLike(String value) { + addCriterion("mer_store_name like", value, "merStoreName"); + return (Criteria) this; + } + + public Criteria andMerStoreNameNotLike(String value) { + addCriterion("mer_store_name not like", value, "merStoreName"); + return (Criteria) this; + } + + public Criteria andMerStoreNameIn(List values) { + addCriterion("mer_store_name in", values, "merStoreName"); + return (Criteria) this; + } + + public Criteria andMerStoreNameNotIn(List values) { + addCriterion("mer_store_name not in", values, "merStoreName"); + return (Criteria) this; + } + + public Criteria andMerStoreNameBetween(String value1, String value2) { + addCriterion("mer_store_name between", value1, value2, "merStoreName"); + return (Criteria) this; + } + + public Criteria andMerStoreNameNotBetween(String value1, String value2) { + addCriterion("mer_store_name not between", value1, value2, "merStoreName"); + return (Criteria) this; + } + + public Criteria andMerStoreAddressIsNull() { + addCriterion("mer_store_address is null"); + return (Criteria) this; + } + + public Criteria andMerStoreAddressIsNotNull() { + addCriterion("mer_store_address is not null"); + return (Criteria) this; + } + + public Criteria andMerStoreAddressEqualTo(String value) { + addCriterion("mer_store_address =", value, "merStoreAddress"); + return (Criteria) this; + } + + public Criteria andMerStoreAddressNotEqualTo(String value) { + addCriterion("mer_store_address <>", value, "merStoreAddress"); + return (Criteria) this; + } + + public Criteria andMerStoreAddressGreaterThan(String value) { + addCriterion("mer_store_address >", value, "merStoreAddress"); + return (Criteria) this; + } + + public Criteria andMerStoreAddressGreaterThanOrEqualTo(String value) { + addCriterion("mer_store_address >=", value, "merStoreAddress"); + return (Criteria) this; + } + + public Criteria andMerStoreAddressLessThan(String value) { + addCriterion("mer_store_address <", value, "merStoreAddress"); + return (Criteria) this; + } + + public Criteria andMerStoreAddressLessThanOrEqualTo(String value) { + addCriterion("mer_store_address <=", value, "merStoreAddress"); + return (Criteria) this; + } + + public Criteria andMerStoreAddressLike(String value) { + addCriterion("mer_store_address like", value, "merStoreAddress"); + return (Criteria) this; + } + + public Criteria andMerStoreAddressNotLike(String value) { + addCriterion("mer_store_address not like", value, "merStoreAddress"); + return (Criteria) this; + } + + public Criteria andMerStoreAddressIn(List values) { + addCriterion("mer_store_address in", values, "merStoreAddress"); + return (Criteria) this; + } + + public Criteria andMerStoreAddressNotIn(List values) { + addCriterion("mer_store_address not in", values, "merStoreAddress"); + return (Criteria) this; + } + + public Criteria andMerStoreAddressBetween(String value1, String value2) { + addCriterion("mer_store_address between", value1, value2, "merStoreAddress"); + return (Criteria) this; + } + + public Criteria andMerStoreAddressNotBetween(String value1, String value2) { + addCriterion("mer_store_address not between", value1, value2, "merStoreAddress"); + 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 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 andPriceTypeIsNull() { + addCriterion("price_type is null"); + return (Criteria) this; + } + + public Criteria andPriceTypeIsNotNull() { + addCriterion("price_type is not null"); + return (Criteria) this; + } + + public Criteria andPriceTypeEqualTo(Integer value) { + addCriterion("price_type =", value, "priceType"); + return (Criteria) this; + } + + public Criteria andPriceTypeNotEqualTo(Integer value) { + addCriterion("price_type <>", value, "priceType"); + return (Criteria) this; + } + + public Criteria andPriceTypeGreaterThan(Integer value) { + addCriterion("price_type >", value, "priceType"); + return (Criteria) this; + } + + public Criteria andPriceTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("price_type >=", value, "priceType"); + return (Criteria) this; + } + + public Criteria andPriceTypeLessThan(Integer value) { + addCriterion("price_type <", value, "priceType"); + return (Criteria) this; + } + + public Criteria andPriceTypeLessThanOrEqualTo(Integer value) { + addCriterion("price_type <=", value, "priceType"); + return (Criteria) this; + } + + public Criteria andPriceTypeIn(List values) { + addCriterion("price_type in", values, "priceType"); + return (Criteria) this; + } + + public Criteria andPriceTypeNotIn(List values) { + addCriterion("price_type not in", values, "priceType"); + return (Criteria) this; + } + + public Criteria andPriceTypeBetween(Integer value1, Integer value2) { + addCriterion("price_type between", value1, value2, "priceType"); + return (Criteria) this; + } + + public Criteria andPriceTypeNotBetween(Integer value1, Integer value2) { + addCriterion("price_type not between", value1, value2, "priceType"); + return (Criteria) this; + } + + public Criteria andPriceIsNull() { + addCriterion("price is null"); + return (Criteria) this; + } + + public Criteria andPriceIsNotNull() { + addCriterion("price is not null"); + return (Criteria) this; + } + + public Criteria andPriceEqualTo(BigDecimal value) { + addCriterion("price =", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceNotEqualTo(BigDecimal value) { + addCriterion("price <>", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceGreaterThan(BigDecimal value) { + addCriterion("price >", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("price >=", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceLessThan(BigDecimal value) { + addCriterion("price <", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("price <=", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceIn(List values) { + addCriterion("price in", values, "price"); + return (Criteria) this; + } + + public Criteria andPriceNotIn(List values) { + addCriterion("price not in", values, "price"); + return (Criteria) this; + } + + public Criteria andPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("price between", value1, value2, "price"); + return (Criteria) this; + } + + public Criteria andPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("price not between", value1, value2, "price"); + return (Criteria) this; + } + + public Criteria andExecutionTypeIsNull() { + addCriterion("execution_type is null"); + return (Criteria) this; + } + + public Criteria andExecutionTypeIsNotNull() { + addCriterion("execution_type is not null"); + return (Criteria) this; + } + + public Criteria andExecutionTypeEqualTo(Integer value) { + addCriterion("execution_type =", value, "executionType"); + return (Criteria) this; + } + + public Criteria andExecutionTypeNotEqualTo(Integer value) { + addCriterion("execution_type <>", value, "executionType"); + return (Criteria) this; + } + + public Criteria andExecutionTypeGreaterThan(Integer value) { + addCriterion("execution_type >", value, "executionType"); + return (Criteria) this; + } + + public Criteria andExecutionTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("execution_type >=", value, "executionType"); + return (Criteria) this; + } + + public Criteria andExecutionTypeLessThan(Integer value) { + addCriterion("execution_type <", value, "executionType"); + return (Criteria) this; + } + + public Criteria andExecutionTypeLessThanOrEqualTo(Integer value) { + addCriterion("execution_type <=", value, "executionType"); + return (Criteria) this; + } + + public Criteria andExecutionTypeIn(List values) { + addCriterion("execution_type in", values, "executionType"); + return (Criteria) this; + } + + public Criteria andExecutionTypeNotIn(List values) { + addCriterion("execution_type not in", values, "executionType"); + return (Criteria) this; + } + + public Criteria andExecutionTypeBetween(Integer value1, Integer value2) { + addCriterion("execution_type between", value1, value2, "executionType"); + return (Criteria) this; + } + + public Criteria andExecutionTypeNotBetween(Integer value1, Integer value2) { + addCriterion("execution_type not between", value1, value2, "executionType"); + return (Criteria) this; + } + + public Criteria andStartTimeIsNull() { + addCriterion("start_time is null"); + return (Criteria) this; + } + + public Criteria andStartTimeIsNotNull() { + addCriterion("start_time is not null"); + return (Criteria) this; + } + + public Criteria andStartTimeEqualTo(Date value) { + addCriterion("start_time =", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotEqualTo(Date value) { + addCriterion("start_time <>", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeGreaterThan(Date value) { + addCriterion("start_time >", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeGreaterThanOrEqualTo(Date value) { + addCriterion("start_time >=", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeLessThan(Date value) { + addCriterion("start_time <", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeLessThanOrEqualTo(Date value) { + addCriterion("start_time <=", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeIn(List values) { + addCriterion("start_time in", values, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotIn(List values) { + addCriterion("start_time not in", values, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeBetween(Date value1, Date value2) { + addCriterion("start_time between", value1, value2, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotBetween(Date value1, Date value2) { + addCriterion("start_time not between", value1, value2, "startTime"); + 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 andOpUserIdIsNull() { + addCriterion("op_user_id is null"); + return (Criteria) this; + } + + public Criteria andOpUserIdIsNotNull() { + addCriterion("op_user_id is not null"); + return (Criteria) this; + } + + public Criteria andOpUserIdEqualTo(Long value) { + addCriterion("op_user_id =", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdNotEqualTo(Long value) { + addCriterion("op_user_id <>", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdGreaterThan(Long value) { + addCriterion("op_user_id >", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("op_user_id >=", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdLessThan(Long value) { + addCriterion("op_user_id <", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdLessThanOrEqualTo(Long value) { + addCriterion("op_user_id <=", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdIn(List values) { + addCriterion("op_user_id in", values, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdNotIn(List values) { + addCriterion("op_user_id not in", values, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdBetween(Long value1, Long value2) { + addCriterion("op_user_id between", value1, value2, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdNotBetween(Long value1, Long value2) { + addCriterion("op_user_id not between", value1, value2, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserNameIsNull() { + addCriterion("op_user_name is null"); + return (Criteria) this; + } + + public Criteria andOpUserNameIsNotNull() { + addCriterion("op_user_name is not null"); + return (Criteria) this; + } + + public Criteria andOpUserNameEqualTo(String value) { + addCriterion("op_user_name =", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameNotEqualTo(String value) { + addCriterion("op_user_name <>", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameGreaterThan(String value) { + addCriterion("op_user_name >", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameGreaterThanOrEqualTo(String value) { + addCriterion("op_user_name >=", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameLessThan(String value) { + addCriterion("op_user_name <", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameLessThanOrEqualTo(String value) { + addCriterion("op_user_name <=", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameLike(String value) { + addCriterion("op_user_name like", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameNotLike(String value) { + addCriterion("op_user_name not like", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameIn(List values) { + addCriterion("op_user_name in", values, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameNotIn(List values) { + addCriterion("op_user_name not in", values, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameBetween(String value1, String value2) { + addCriterion("op_user_name between", value1, value2, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameNotBetween(String value1, String value2) { + addCriterion("op_user_name not between", value1, value2, "opUserName"); + 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/enum_type/GasTaskExecutionTypeEnum.java b/hai-service/src/main/java/com/hai/enum_type/GasTaskExecutionTypeEnum.java new file mode 100644 index 00000000..03ad4606 --- /dev/null +++ b/hai-service/src/main/java/com/hai/enum_type/GasTaskExecutionTypeEnum.java @@ -0,0 +1,35 @@ +package com.hai.enum_type; + +/** + * 加油站价格任务 + * @author hurui + */ +public enum GasTaskExecutionTypeEnum { + type1(1 , "立刻执行"), + type2(2 , "定时执行"), + ; + + private Integer status; + private String name; + + GasTaskExecutionTypeEnum(int status , String name) { + this.status = status; + this.name = name; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/hai-service/src/main/java/com/hai/enum_type/GasTaskPriceTypeEnum.java b/hai-service/src/main/java/com/hai/enum_type/GasTaskPriceTypeEnum.java new file mode 100644 index 00000000..50a9e1da --- /dev/null +++ b/hai-service/src/main/java/com/hai/enum_type/GasTaskPriceTypeEnum.java @@ -0,0 +1,36 @@ +package com.hai.enum_type; + +/** + * 加油站价格任务 + * @author hurui + */ +public enum GasTaskPriceTypeEnum { + type1(1 , "国标价"), + type2(2 , "油站价"), + type3(3 , "优惠幅度"), + ; + + private Integer status; + private String name; + + GasTaskPriceTypeEnum(int status , String name) { + this.status = status; + this.name = name; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/hai-service/src/main/java/com/hai/enum_type/GasTaskStatusEnum.java b/hai-service/src/main/java/com/hai/enum_type/GasTaskStatusEnum.java new file mode 100644 index 00000000..0c507407 --- /dev/null +++ b/hai-service/src/main/java/com/hai/enum_type/GasTaskStatusEnum.java @@ -0,0 +1,36 @@ +package com.hai.enum_type; + +/** + * 加油站价格任务 + * @author hurui + */ +public enum GasTaskStatusEnum { + status0(0 , "删除"), + status1(1 , "等待中"), + status2(2 , "已执行"), + ; + + private Integer status; + private String name; + + GasTaskStatusEnum(int status , String name) { + this.status = status; + this.name = name; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/hai-service/src/main/java/com/hai/service/HighGasOilPriceOfficialService.java b/hai-service/src/main/java/com/hai/service/HighGasOilPriceOfficialService.java index 1cf9d282..48821757 100644 --- a/hai-service/src/main/java/com/hai/service/HighGasOilPriceOfficialService.java +++ b/hai-service/src/main/java/com/hai/service/HighGasOilPriceOfficialService.java @@ -3,6 +3,8 @@ package com.hai.service; import com.hai.entity.HighGasOilPriceOfficial; import java.math.BigDecimal; +import java.util.List; +import java.util.Map; /** * 油品国标价 @@ -25,8 +27,22 @@ public interface HighGasOilPriceOfficialService { */ HighGasOilPriceOfficial getPrice(Long regionId, Integer oilNo); + /** + * 查询价格列表 + * @param param + * @return + */ + List getPriceList(Map param); + /** * 刷新获取最新的国标价 */ void refreshPriceOfficial(); + + /** + * 刷新油站的国标价【全部】 + * @param regionId 区域 + * @param oilNo 油品 + */ + void refreshGasPriceOfficial(Long regionId, Integer oilNo); } 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 74d7f1df..62af2ade 100644 --- a/hai-service/src/main/java/com/hai/service/HighGasOilPriceService.java +++ b/hai-service/src/main/java/com/hai/service/HighGasOilPriceService.java @@ -35,6 +35,14 @@ public interface HighGasOilPriceService { */ List getGasOilPriceByStore(Long storeId); + /** + * 根据区域和油品 查询数据列表 + * @param regionId + * @param oilNo + * @return + */ + List getPriceListByRegionAndOilNo(Long regionId, Integer oilNo); + /** * 根据区域和油号查询门店 * @param regionId diff --git a/hai-service/src/main/java/com/hai/service/HighGasOilPriceTaskService.java b/hai-service/src/main/java/com/hai/service/HighGasOilPriceTaskService.java new file mode 100644 index 00000000..dd528cb1 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/HighGasOilPriceTaskService.java @@ -0,0 +1,52 @@ +package com.hai.service; + +import com.hai.entity.HighGasOilPriceTask; + +import java.util.List; +import java.util.Map; + +/** + * 加油站价格任务 + * @author hurui + */ +public interface HighGasOilPriceTaskService { + + /** + * 编辑数据 + * @param gasOilPriceTask + */ + void editData(HighGasOilPriceTask gasOilPriceTask); + + /** + * 增加价格任务 + * @param gasOilPriceTask + */ + void addTask(HighGasOilPriceTask gasOilPriceTask); + + /** + * 业务处理 + * @param gasOilPriceTask + */ + void businessHandle(HighGasOilPriceTask gasOilPriceTask); + + /** + * 根据id 查询详情 + * @param taskId + * @return + */ + HighGasOilPriceTask getDetailById(Long taskId); + + /** + * 删除任务 + * @param taskId + */ + void delTask(Long taskId); + + /** + * 查询任务列表 + * @param param + * @return + */ + List getTaskList(Map param); + +} diff --git a/hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceOfficialServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceOfficialServiceImpl.java index 0a18956a..ab8306a0 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceOfficialServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceOfficialServiceImpl.java @@ -4,12 +4,13 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.hai.common.utils.HttpsUtils; import com.hai.dao.HighGasOilPriceOfficialMapper; -import com.hai.entity.HighGasOilPriceOfficial; -import com.hai.entity.HighGasOilPriceOfficialExample; -import com.hai.entity.SecDictionary; -import com.hai.entity.SecRegion; +import com.hai.entity.*; import com.hai.service.CommonService; import com.hai.service.HighGasOilPriceOfficialService; +import com.hai.service.HighGasOilPriceService; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.util.StringUtil; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -24,6 +25,9 @@ public class HighGasOilPriceOfficialServiceImpl implements HighGasOilPriceOffici @Resource private HighGasOilPriceOfficialMapper gasOilPriceOfficialMapper; + @Resource + private HighGasOilPriceService highGasOilPriceService; + @Resource private CommonService commonService; @@ -61,6 +65,30 @@ public class HighGasOilPriceOfficialServiceImpl implements HighGasOilPriceOffici return null; } + @Override + public List getPriceList(Map param) { + HighGasOilPriceOfficialExample example = new HighGasOilPriceOfficialExample(); + HighGasOilPriceOfficialExample.Criteria criteria = example.createCriteria().andStatusEqualTo(1); + + if (StringUtils.isNotBlank(MapUtils.getString(param, "regionName"))) { + criteria.andRegionNameLike("%" + MapUtils.getString(param, "regionName") + "%"); + } + + if (MapUtils.getLong(param, "regionId") != null) { + criteria.andRegionIdEqualTo(MapUtils.getLong(param, "regionId")); + } + + if (MapUtils.getInteger(param, "oilNo") != null) { + criteria.andOilNoEqualTo(MapUtils.getInteger(param, "oilNo")); + } + + if (MapUtils.getInteger(param, "oilType") != null) { + criteria.andOilTypeEqualTo(MapUtils.getInteger(param, "oilType")); + } + + return gasOilPriceOfficialMapper.selectByExample(example); + } + @Override public void refreshPriceOfficial() { Map heardParam = new HashMap<>(); @@ -102,4 +130,21 @@ public class HighGasOilPriceOfficialServiceImpl implements HighGasOilPriceOffici } } + @Override + public void refreshGasPriceOfficial(Long regionId, Integer oilNo) { + Map param = new HashMap<>(); + param.put("regionId", regionId); + param.put("oilNo", oilNo); + + List priceList = getPriceList(param); + for (HighGasOilPriceOfficial priceOfficial : priceList) { + // 查询区域下的油品 + List list = highGasOilPriceService.getPriceListByRegionAndOilNo(priceOfficial.getRegionId(), priceOfficial.getOilNo()); + for (HighGasOilPrice gasOilPrice : list) { + gasOilPrice.setPriceOfficial(priceOfficial.getPriceOfficial()); + highGasOilPriceService.editGasOilPrice(gasOilPrice); + } + } + } + } 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 bd658e82..cc68ce89 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 @@ -50,6 +50,11 @@ public class HighGasOilPriceServiceImpl implements HighGasOilPriceService { return highGasOilPriceMapper.selectByExample(example); } + @Override + public List getPriceListByRegionAndOilNo(Long regionId, Integer oilNo) { + return highGasOilPriceMapper.selectPriceListByRegionAndOilNo(regionId,oilNo); + } + @Override public List> getStoreListByOilNo(String storeName,Long regionId, String oilNoName) { return highGasOilPriceMapper.selectStoreListByOilNo(storeName,regionId,oilNoName); diff --git a/hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceTaskServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceTaskServiceImpl.java new file mode 100644 index 00000000..e01f6f1b --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceTaskServiceImpl.java @@ -0,0 +1,171 @@ +package com.hai.service.impl; + +import com.hai.common.exception.ErrorCode; +import com.hai.common.exception.ErrorHelp; +import com.hai.common.exception.SysCode; +import com.hai.dao.HighGasOilPriceTaskMapper; +import com.hai.entity.HighGasOilPrice; +import com.hai.entity.HighGasOilPriceOfficial; +import com.hai.entity.HighGasOilPriceTask; +import com.hai.entity.HighGasOilPriceTaskExample; +import com.hai.enum_type.GasTaskExecutionTypeEnum; +import com.hai.enum_type.GasTaskPriceTypeEnum; +import com.hai.enum_type.GasTaskStatusEnum; +import com.hai.service.HighGasOilPriceOfficialService; +import com.hai.service.HighGasOilPriceService; +import com.hai.service.HighGasOilPriceTaskService; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; +import java.util.Map; + +@Service("gasOilPriceTaskService") +public class HighGasOilPriceTaskServiceImpl implements HighGasOilPriceTaskService { + + @Resource + private HighGasOilPriceTaskMapper gasOilPriceTaskMapper; + + @Resource + private HighGasOilPriceService gasOilPriceService; + + @Resource + private HighGasOilPriceOfficialService gasOilPriceOfficialService; + + @Override + public void editData(HighGasOilPriceTask gasOilPriceTask) { + if (gasOilPriceTask.getId() == null) { + gasOilPriceTask.setStatus(GasTaskStatusEnum.status1.getStatus()); + gasOilPriceTask.setCreateTime(new Date()); + gasOilPriceTask.setUpdateTime(new Date()); + gasOilPriceTaskMapper.insert(gasOilPriceTask); + } else { + gasOilPriceTaskMapper.updateByPrimaryKey(gasOilPriceTask); + } + } + + @Override + public void addTask(HighGasOilPriceTask gasOilPriceTask) { + editData(gasOilPriceTask); + + // 立刻执行 + if (gasOilPriceTask.getExecutionType().equals(GasTaskExecutionTypeEnum.type1.getStatus())) { + businessHandle(gasOilPriceTask); + } + + } + + @Override + public void businessHandle(HighGasOilPriceTask gasOilPriceTask) { + // 立刻执行 + if (gasOilPriceTask.getExecutionType().equals(GasTaskExecutionTypeEnum.type1.getStatus())) { + gasOilPriceTask.setStartTime(new Date()); + gasOilPriceTask.setStatus(GasTaskStatusEnum.status2.getStatus()); + editData(gasOilPriceTask); + + // 国标价 + if (gasOilPriceTask.getPriceType().equals(GasTaskPriceTypeEnum.type1.getStatus())) { + // 查询国标价油品价格 + HighGasOilPriceOfficial price = gasOilPriceOfficialService.getPrice(gasOilPriceTask.getRegionId(), gasOilPriceTask.getOilNo()); + if (price == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油品价格"); + } + gasOilPriceOfficialService.editPrice(gasOilPriceTask.getRegionId(), gasOilPriceTask.getOilNo(), gasOilPriceTask.getPrice()); + + new Thread(() -> { + gasOilPriceOfficialService.refreshGasPriceOfficial(gasOilPriceTask.getRegionId(), gasOilPriceTask.getOilNo()); + }).start(); + } + + // 油站价 + if (gasOilPriceTask.getPriceType().equals(GasTaskPriceTypeEnum.type2.getStatus())) { + // 查询油品价格 + HighGasOilPrice price = gasOilPriceService.getGasOilPriceByStoreAndOilNo(gasOilPriceTask.getMerStoreId(), gasOilPriceTask.getOilNo()); + if (price == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油品价格"); + } + price.setPriceGun(gasOilPriceTask.getPrice()); + price.setPriceVip(gasOilPriceTask.getPrice().subtract(price.getPreferentialMargin())); + gasOilPriceService.editGasOilPrice(price); + } + + // 优惠幅度 + if (gasOilPriceTask.getPriceType().equals(GasTaskPriceTypeEnum.type3.getStatus())) { + // 查询油品价格 + HighGasOilPrice price = gasOilPriceService.getGasOilPriceByStoreAndOilNo(gasOilPriceTask.getMerStoreId(), gasOilPriceTask.getOilNo()); + if (price == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油品价格"); + } + price.setPreferentialMargin(gasOilPriceTask.getPrice()); + price.setPriceVip(price.getPriceGun().subtract(price.getPreferentialMargin())); + gasOilPriceService.editGasOilPrice(price); + } + + } + } + + @Override + public HighGasOilPriceTask getDetailById(Long taskId) { + return gasOilPriceTaskMapper.selectByPrimaryKey(taskId); + } + + @Override + public void delTask(Long taskId) { + // 查询价格任务 + HighGasOilPriceTask detail = getDetailById(taskId); + if (detail == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_ORDER, "未找到任务"); + } + detail.setStatus(GasTaskStatusEnum.status0.getStatus()); + editData(detail); + } + + @Override + public List getTaskList(Map param) { + HighGasOilPriceTaskExample example = new HighGasOilPriceTaskExample(); + HighGasOilPriceTaskExample.Criteria criteria = example.createCriteria() + .andStatusNotEqualTo(GasTaskStatusEnum.status0.getStatus()); + + if (MapUtils.getLong(param, "regionId") != null) { + criteria.andRegionIdEqualTo(MapUtils.getLong(param, "regionId")); + } + + if (StringUtils.isNotBlank(MapUtils.getString(param, "regionName"))) { + criteria.andRegionNameLike("%" + MapUtils.getString(param, "regionName") + "%"); + } + + if (MapUtils.getLong(param, "merStoreId") != null) { + criteria.andMerStoreIdEqualTo(MapUtils.getLong(param, "merStoreId")); + } + + if (StringUtils.isNotBlank(MapUtils.getString(param, "merStoreName"))) { + criteria.andMerStoreNameLike("%" + MapUtils.getString(param, "merStoreName") + "%"); + } + + if (MapUtils.getInteger(param, "oilType") != null) { + criteria.andOilTypeEqualTo(MapUtils.getInteger(param, "oilType")); + } + + if (MapUtils.getInteger(param, "oilNo") != null) { + criteria.andOilNoEqualTo(MapUtils.getInteger(param, "oilNo")); + } + + if (MapUtils.getInteger(param, "priceType") != null) { + criteria.andPriceTypeEqualTo(MapUtils.getInteger(param, "priceType")); + } + + if (MapUtils.getInteger(param, "executionType") != null) { + criteria.andExecutionTypeEqualTo(MapUtils.getInteger(param, "executionType")); + } + + if (MapUtils.getInteger(param, "status") != null) { + criteria.andStatusEqualTo(MapUtils.getInteger(param, "status")); + } + + example.setOrderByClause("create_time desc"); + return gasOilPriceTaskMapper.selectByExample(example); + } +}