diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighGasClassGroupController.java b/hai-bweb/src/main/java/com/bweb/controller/HighGasClassGroupController.java new file mode 100644 index 00000000..5a700d2c --- /dev/null +++ b/hai-bweb/src/main/java/com/bweb/controller/HighGasClassGroupController.java @@ -0,0 +1,166 @@ +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.security.UserCenter; +import com.hai.common.utils.ResponseMsgUtil; +import com.hai.entity.HighGasClassGroup; +import com.hai.entity.HighGasClassGroupTask; +import com.hai.enum_type.GasClassGroupTaskStatus; +import com.hai.model.ResponseData; +import com.hai.model.UserInfoModel; +import com.hai.service.HighGasClassGroupService; +import com.hai.service.HighGasClassGroupTaskService; +import com.hai.service.HighMerchantStoreService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 加油站班组 + * @author hurui + */ +@Controller +@RequestMapping(value = "/gasClassGroup") +@Api(value = "加油站班组") +public class HighGasClassGroupController { + + private static Logger log = LoggerFactory.getLogger(HighGasClassGroupController.class); + + @Resource + private HighGasClassGroupService gasClassGroupService; + + @Resource + private HighGasClassGroupTaskService gasClassGroupTaskService; + + @Resource + private HighMerchantStoreService merchantStoreService; + + @Resource + private UserCenter userCenter; + + @RequestMapping(value = "/editClassGroup", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "编辑班组") + public ResponseData editClassGroup(@RequestBody JSONObject body) { + try { + UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class); + if (userInfoModel == null || userInfoModel.getMerchantStore() == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); + } + if (body == null + || StringUtils.isBlank(body.getString("name")) + || StringUtils.isBlank(body.getString("principalName")) + || StringUtils.isBlank(body.getString("principalPhone"))) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + HighGasClassGroup gasClassGroup; + + if (body.getLong("id") != null) { + // 查询班组 + gasClassGroup = gasClassGroupService.getDetailById(body.getLong("id")); + if (gasClassGroup == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + } else { + gasClassGroup = new HighGasClassGroup(); + gasClassGroup.setMerchantStoreId(userInfoModel.getMerchantStore().getId()); + gasClassGroup.setMerchantStoreName(userInfoModel.getMerchantStore().getStoreName()); + } + + gasClassGroup.setName(body.getString("name")); + gasClassGroup.setPrincipalName(body.getString("principalName")); + gasClassGroup.setPrincipalPhone(body.getString("principalPhone")); + gasClassGroupService.editGroup(gasClassGroup); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("HighGasClassGroupController --> editClassGroup() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/delClassGroup", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "删除班组") + public ResponseData delClassGroup(@RequestBody JSONObject body) { + try { + if (body == null || body.getLong("id") == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + Map param = new HashMap<>(); + param.put("gasClassGroupId", body.getLong("id")); + param.put("status", GasClassGroupTaskStatus.status1.getStatus()); + List groupTaskList = gasClassGroupTaskService.getGroupTaskList(param); + if (groupTaskList.size() > 0) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "班组有任务进行中,暂时无法删除"); + } + + gasClassGroupService.delGroup(body.getLong("id")); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("HighGasClassGroupController --> delClassGroup() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/getClassGroupById", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询班组详情") + public ResponseData getClassGroupById(@RequestParam(name = "groupId", required = true) Long groupId) { + try { + + return ResponseMsgUtil.success(gasClassGroupService.getDetailById(groupId)); + + } catch (Exception e) { + log.error("HighGasClassGroupController --> getClassGroupById() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/getClassGroupList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询班组列表") + public ResponseData getClassGroupList(@RequestParam(name = "principalName", required = false) String principalName, + @RequestParam(name = "principalPhone", required = false) String principalPhone, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize) { + try { + UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class); + if (userInfoModel == null || userInfoModel.getMerchantStore() == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); + } + + Map param = new HashMap<>(); + param.put("merchantStoreId", userInfoModel.getMerchantStore().getId()); + param.put("principalName", principalName); + param.put("principalPhone", principalPhone); + + PageHelper.startPage(pageNum, pageSize); + return ResponseMsgUtil.success(new PageInfo<>(gasClassGroupService.getGroupList(param))); + + } catch (Exception e) { + log.error("HighGasClassGroupController --> getClassGroupList() error!", e); + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighGasClassGroupTaskController.java b/hai-bweb/src/main/java/com/bweb/controller/HighGasClassGroupTaskController.java new file mode 100644 index 00000000..3d486817 --- /dev/null +++ b/hai-bweb/src/main/java/com/bweb/controller/HighGasClassGroupTaskController.java @@ -0,0 +1,135 @@ +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.security.UserCenter; +import com.hai.common.utils.ResponseMsgUtil; +import com.hai.model.ResponseData; +import com.hai.service.HighGasClassGroupTaskService; +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; + +/** + * 加油站班组任务 + * @author hurui + */ +@Controller +@RequestMapping(value = "/gasClassGroupTask") +@Api(value = "加油站班组任务") +public class HighGasClassGroupTaskController { + + private static Logger log = LoggerFactory.getLogger(HighGasClassGroupTaskController.class); + + @Resource + private HighGasClassGroupTaskService gasClassGroupTaskService; + + @Resource + private UserCenter userCenter; + + @RequestMapping(value = "/startGroupTask", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "开启班组任务") + public ResponseData startGroupTask(@RequestBody JSONObject body) { + try { + if (body == null || body.getLong("gasId") == null || body.getLong("gasClassGroupId") == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + gasClassGroupTaskService.startGroupTask(body.getLong("gasId"), body.getLong("gasClassGroupId")); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("HighGasClassGroupTaskController --> startGroupTask() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/endGroupTask", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "结束班组任务") + public ResponseData endGroupTask(@RequestBody JSONObject body) { + try { + if (body == null || body.getLong("gasId") == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + gasClassGroupTaskService.endGroupTask(body.getLong("gasId")); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("HighGasClassGroupTaskController --> endGroupTask() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/swapGroupTask", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "交换班组任务") + public ResponseData swapGroupTask(@RequestBody JSONObject body) { + try { + if (body == null || body.getLong("gasId") == null || body.getLong("gasClassGroupId") == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + gasClassGroupTaskService.swapGroupTask(body.getLong("gasId"), body.getLong("gasClassGroupId")); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("HighGasClassGroupTaskController --> swapGroupTask() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/getClassGroupTaskById", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询班组任务记录") + public ResponseData getClassGroupTaskById(@RequestParam(name = "gasClassGroupTaskId", required = true) Long gasClassGroupTaskId) { + try { + + return ResponseMsgUtil.success(gasClassGroupTaskService.getDetailById(gasClassGroupTaskId)); + + } catch (Exception e) { + log.error("HighGasClassGroupTaskController --> getClassGroupTaskById() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/getClassGroupTaskList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询班组任务记录") + public ResponseData getClassGroupTaskList(@RequestParam(name = "gasClassGroupId", required = false) Long gasClassGroupId, + @RequestParam(name = "merchantStoreId", required = false) Long merchantStoreId, + @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("gasClassGroupId", gasClassGroupId); + param.put("merchantStoreId", merchantStoreId); + param.put("status", status); + + PageHelper.startPage(pageNum, pageSize); + return ResponseMsgUtil.success(new PageInfo<>(gasClassGroupTaskService.getGroupTaskList(param))); + + } catch (Exception e) { + log.error("HighGasClassGroupTaskController --> getClassGroupTaskList() error!", e); + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/hai-service/src/main/java/com/hai/dao/HighGasClassGroupMapper.java b/hai-service/src/main/java/com/hai/dao/HighGasClassGroupMapper.java new file mode 100644 index 00000000..a16ab939 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighGasClassGroupMapper.java @@ -0,0 +1,125 @@ +package com.hai.dao; + +import com.hai.entity.HighGasClassGroup; +import com.hai.entity.HighGasClassGroupExample; +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 HighGasClassGroupMapper extends HighGasClassGroupMapperExt { + @SelectProvider(type=HighGasClassGroupSqlProvider.class, method="countByExample") + long countByExample(HighGasClassGroupExample example); + + @DeleteProvider(type=HighGasClassGroupSqlProvider.class, method="deleteByExample") + int deleteByExample(HighGasClassGroupExample example); + + @Delete({ + "delete from high_gas_class_group", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into high_gas_class_group (merchant_store_id, merchant_store_name, ", + "`name`, principal_name, ", + "principal_phone, `status`, ", + "create_time, update_time, ", + "ext_1, ext_2, ext_3)", + "values (#{merchantStoreId,jdbcType=BIGINT}, #{merchantStoreName,jdbcType=VARCHAR}, ", + "#{name,jdbcType=VARCHAR}, #{principalName,jdbcType=VARCHAR}, ", + "#{principalPhone,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", + "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(HighGasClassGroup record); + + @InsertProvider(type=HighGasClassGroupSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(HighGasClassGroup record); + + @SelectProvider(type=HighGasClassGroupSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="merchant_store_id", property="merchantStoreId", jdbcType=JdbcType.BIGINT), + @Result(column="merchant_store_name", property="merchantStoreName", jdbcType=JdbcType.VARCHAR), + @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR), + @Result(column="principal_name", property="principalName", jdbcType=JdbcType.VARCHAR), + @Result(column="principal_phone", property="principalPhone", jdbcType=JdbcType.VARCHAR), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) + }) + List selectByExample(HighGasClassGroupExample example); + + @Select({ + "select", + "id, merchant_store_id, merchant_store_name, `name`, principal_name, principal_phone, ", + "`status`, create_time, update_time, ext_1, ext_2, ext_3", + "from high_gas_class_group", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="merchant_store_id", property="merchantStoreId", jdbcType=JdbcType.BIGINT), + @Result(column="merchant_store_name", property="merchantStoreName", jdbcType=JdbcType.VARCHAR), + @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR), + @Result(column="principal_name", property="principalName", jdbcType=JdbcType.VARCHAR), + @Result(column="principal_phone", property="principalPhone", jdbcType=JdbcType.VARCHAR), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) + }) + HighGasClassGroup selectByPrimaryKey(Long id); + + @UpdateProvider(type=HighGasClassGroupSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") HighGasClassGroup record, @Param("example") HighGasClassGroupExample example); + + @UpdateProvider(type=HighGasClassGroupSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") HighGasClassGroup record, @Param("example") HighGasClassGroupExample example); + + @UpdateProvider(type=HighGasClassGroupSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(HighGasClassGroup record); + + @Update({ + "update high_gas_class_group", + "set merchant_store_id = #{merchantStoreId,jdbcType=BIGINT},", + "merchant_store_name = #{merchantStoreName,jdbcType=VARCHAR},", + "`name` = #{name,jdbcType=VARCHAR},", + "principal_name = #{principalName,jdbcType=VARCHAR},", + "principal_phone = #{principalPhone,jdbcType=VARCHAR},", + "`status` = #{status,jdbcType=INTEGER},", + "create_time = #{createTime,jdbcType=TIMESTAMP},", + "update_time = #{updateTime,jdbcType=TIMESTAMP},", + "ext_1 = #{ext1,jdbcType=VARCHAR},", + "ext_2 = #{ext2,jdbcType=VARCHAR},", + "ext_3 = #{ext3,jdbcType=VARCHAR}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(HighGasClassGroup record); +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighGasClassGroupMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighGasClassGroupMapperExt.java new file mode 100644 index 00000000..503e6a44 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighGasClassGroupMapperExt.java @@ -0,0 +1,7 @@ +package com.hai.dao; + +/** + * mapper扩展类 + */ +public interface HighGasClassGroupMapperExt { +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighGasClassGroupSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighGasClassGroupSqlProvider.java new file mode 100644 index 00000000..c969449a --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighGasClassGroupSqlProvider.java @@ -0,0 +1,332 @@ +package com.hai.dao; + +import com.hai.entity.HighGasClassGroup; +import com.hai.entity.HighGasClassGroupExample.Criteria; +import com.hai.entity.HighGasClassGroupExample.Criterion; +import com.hai.entity.HighGasClassGroupExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class HighGasClassGroupSqlProvider { + + public String countByExample(HighGasClassGroupExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("high_gas_class_group"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(HighGasClassGroupExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("high_gas_class_group"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(HighGasClassGroup record) { + SQL sql = new SQL(); + sql.INSERT_INTO("high_gas_class_group"); + + if (record.getMerchantStoreId() != null) { + sql.VALUES("merchant_store_id", "#{merchantStoreId,jdbcType=BIGINT}"); + } + + if (record.getMerchantStoreName() != null) { + sql.VALUES("merchant_store_name", "#{merchantStoreName,jdbcType=VARCHAR}"); + } + + if (record.getName() != null) { + sql.VALUES("`name`", "#{name,jdbcType=VARCHAR}"); + } + + if (record.getPrincipalName() != null) { + sql.VALUES("principal_name", "#{principalName,jdbcType=VARCHAR}"); + } + + if (record.getPrincipalPhone() != null) { + sql.VALUES("principal_phone", "#{principalPhone,jdbcType=VARCHAR}"); + } + + if (record.getStatus() != null) { + sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getExt1() != null) { + sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); + } + + return sql.toString(); + } + + public String selectByExample(HighGasClassGroupExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("merchant_store_id"); + sql.SELECT("merchant_store_name"); + sql.SELECT("`name`"); + sql.SELECT("principal_name"); + sql.SELECT("principal_phone"); + sql.SELECT("`status`"); + sql.SELECT("create_time"); + sql.SELECT("update_time"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("high_gas_class_group"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + HighGasClassGroup record = (HighGasClassGroup) parameter.get("record"); + HighGasClassGroupExample example = (HighGasClassGroupExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("high_gas_class_group"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getMerchantStoreId() != null) { + sql.SET("merchant_store_id = #{record.merchantStoreId,jdbcType=BIGINT}"); + } + + if (record.getMerchantStoreName() != null) { + sql.SET("merchant_store_name = #{record.merchantStoreName,jdbcType=VARCHAR}"); + } + + if (record.getName() != null) { + sql.SET("`name` = #{record.name,jdbcType=VARCHAR}"); + } + + if (record.getPrincipalName() != null) { + sql.SET("principal_name = #{record.principalName,jdbcType=VARCHAR}"); + } + + if (record.getPrincipalPhone() != null) { + sql.SET("principal_phone = #{record.principalPhone,jdbcType=VARCHAR}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getExt1() != null) { + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + } + + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByExample(Map parameter) { + SQL sql = new SQL(); + sql.UPDATE("high_gas_class_group"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("merchant_store_id = #{record.merchantStoreId,jdbcType=BIGINT}"); + sql.SET("merchant_store_name = #{record.merchantStoreName,jdbcType=VARCHAR}"); + sql.SET("`name` = #{record.name,jdbcType=VARCHAR}"); + sql.SET("principal_name = #{record.principalName,jdbcType=VARCHAR}"); + sql.SET("principal_phone = #{record.principalPhone,jdbcType=VARCHAR}"); + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + + HighGasClassGroupExample example = (HighGasClassGroupExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(HighGasClassGroup record) { + SQL sql = new SQL(); + sql.UPDATE("high_gas_class_group"); + + if (record.getMerchantStoreId() != null) { + sql.SET("merchant_store_id = #{merchantStoreId,jdbcType=BIGINT}"); + } + + if (record.getMerchantStoreName() != null) { + sql.SET("merchant_store_name = #{merchantStoreName,jdbcType=VARCHAR}"); + } + + if (record.getName() != null) { + sql.SET("`name` = #{name,jdbcType=VARCHAR}"); + } + + if (record.getPrincipalName() != null) { + sql.SET("principal_name = #{principalName,jdbcType=VARCHAR}"); + } + + if (record.getPrincipalPhone() != null) { + sql.SET("principal_phone = #{principalPhone,jdbcType=VARCHAR}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{status,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getExt1() != null) { + sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); + } + + sql.WHERE("id = #{id,jdbcType=BIGINT}"); + + return sql.toString(); + } + + protected void applyWhere(SQL sql, HighGasClassGroupExample 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/dao/HighGasClassGroupTaskMapper.java b/hai-service/src/main/java/com/hai/dao/HighGasClassGroupTaskMapper.java new file mode 100644 index 00000000..99c9c8e0 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighGasClassGroupTaskMapper.java @@ -0,0 +1,134 @@ +package com.hai.dao; + +import com.hai.entity.HighGasClassGroupTask; +import com.hai.entity.HighGasClassGroupTaskExample; +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 HighGasClassGroupTaskMapper extends HighGasClassGroupTaskMapperExt { + @SelectProvider(type=HighGasClassGroupTaskSqlProvider.class, method="countByExample") + long countByExample(HighGasClassGroupTaskExample example); + + @DeleteProvider(type=HighGasClassGroupTaskSqlProvider.class, method="deleteByExample") + int deleteByExample(HighGasClassGroupTaskExample example); + + @Delete({ + "delete from high_gas_class_group_task", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into high_gas_class_group_task (gas_class_group_id, gas_class_group_name, ", + "merchant_store_id, merchant_store_name, ", + "start_time, end_time, ", + "data_count, `status`, ", + "create_time, update_time, ", + "ext_1, ext_2, ext_3)", + "values (#{gasClassGroupId,jdbcType=BIGINT}, #{gasClassGroupName,jdbcType=VARCHAR}, ", + "#{merchantStoreId,jdbcType=BIGINT}, #{merchantStoreName,jdbcType=VARCHAR}, ", + "#{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, ", + "#{dataCount,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", + "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(HighGasClassGroupTask record); + + @InsertProvider(type=HighGasClassGroupTaskSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(HighGasClassGroupTask record); + + @SelectProvider(type=HighGasClassGroupTaskSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="gas_class_group_id", property="gasClassGroupId", jdbcType=JdbcType.BIGINT), + @Result(column="gas_class_group_name", property="gasClassGroupName", jdbcType=JdbcType.VARCHAR), + @Result(column="merchant_store_id", property="merchantStoreId", jdbcType=JdbcType.BIGINT), + @Result(column="merchant_store_name", property="merchantStoreName", jdbcType=JdbcType.VARCHAR), + @Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="data_count", property="dataCount", jdbcType=JdbcType.VARCHAR), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) + }) + List selectByExample(HighGasClassGroupTaskExample example); + + @Select({ + "select", + "id, gas_class_group_id, gas_class_group_name, merchant_store_id, merchant_store_name, ", + "start_time, end_time, data_count, `status`, create_time, update_time, ext_1, ", + "ext_2, ext_3", + "from high_gas_class_group_task", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="gas_class_group_id", property="gasClassGroupId", jdbcType=JdbcType.BIGINT), + @Result(column="gas_class_group_name", property="gasClassGroupName", jdbcType=JdbcType.VARCHAR), + @Result(column="merchant_store_id", property="merchantStoreId", jdbcType=JdbcType.BIGINT), + @Result(column="merchant_store_name", property="merchantStoreName", jdbcType=JdbcType.VARCHAR), + @Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="data_count", property="dataCount", jdbcType=JdbcType.VARCHAR), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) + }) + HighGasClassGroupTask selectByPrimaryKey(Long id); + + @UpdateProvider(type=HighGasClassGroupTaskSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") HighGasClassGroupTask record, @Param("example") HighGasClassGroupTaskExample example); + + @UpdateProvider(type=HighGasClassGroupTaskSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") HighGasClassGroupTask record, @Param("example") HighGasClassGroupTaskExample example); + + @UpdateProvider(type=HighGasClassGroupTaskSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(HighGasClassGroupTask record); + + @Update({ + "update high_gas_class_group_task", + "set gas_class_group_id = #{gasClassGroupId,jdbcType=BIGINT},", + "gas_class_group_name = #{gasClassGroupName,jdbcType=VARCHAR},", + "merchant_store_id = #{merchantStoreId,jdbcType=BIGINT},", + "merchant_store_name = #{merchantStoreName,jdbcType=VARCHAR},", + "start_time = #{startTime,jdbcType=TIMESTAMP},", + "end_time = #{endTime,jdbcType=TIMESTAMP},", + "data_count = #{dataCount,jdbcType=VARCHAR},", + "`status` = #{status,jdbcType=INTEGER},", + "create_time = #{createTime,jdbcType=TIMESTAMP},", + "update_time = #{updateTime,jdbcType=TIMESTAMP},", + "ext_1 = #{ext1,jdbcType=VARCHAR},", + "ext_2 = #{ext2,jdbcType=VARCHAR},", + "ext_3 = #{ext3,jdbcType=VARCHAR}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(HighGasClassGroupTask record); +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighGasClassGroupTaskMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighGasClassGroupTaskMapperExt.java new file mode 100644 index 00000000..f5e9dd48 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighGasClassGroupTaskMapperExt.java @@ -0,0 +1,58 @@ +package com.hai.dao; + +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; +import java.util.Map; + +/** + * mapper扩展类 + */ +public interface HighGasClassGroupTaskMapperExt { + + @Select("") + Map countRefuelData(@Param("gasClassGroupTaskId") Long gasClassGroupTaskId); + + @Select("") + Map countRefundData(@Param("gasClassGroupTaskId") Long gasClassGroupTaskId); + + @Select("") + List> countOilData(@Param("gasId") Long gasId, @Param("gasClassGroupTaskId") Long gasClassGroupTaskId); +} diff --git a/hai-service/src/main/java/com/hai/dao/HighGasClassGroupTaskSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighGasClassGroupTaskSqlProvider.java new file mode 100644 index 00000000..6d83be29 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighGasClassGroupTaskSqlProvider.java @@ -0,0 +1,360 @@ +package com.hai.dao; + +import com.hai.entity.HighGasClassGroupTask; +import com.hai.entity.HighGasClassGroupTaskExample.Criteria; +import com.hai.entity.HighGasClassGroupTaskExample.Criterion; +import com.hai.entity.HighGasClassGroupTaskExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class HighGasClassGroupTaskSqlProvider { + + public String countByExample(HighGasClassGroupTaskExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("high_gas_class_group_task"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(HighGasClassGroupTaskExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("high_gas_class_group_task"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(HighGasClassGroupTask record) { + SQL sql = new SQL(); + sql.INSERT_INTO("high_gas_class_group_task"); + + if (record.getGasClassGroupId() != null) { + sql.VALUES("gas_class_group_id", "#{gasClassGroupId,jdbcType=BIGINT}"); + } + + if (record.getGasClassGroupName() != null) { + sql.VALUES("gas_class_group_name", "#{gasClassGroupName,jdbcType=VARCHAR}"); + } + + if (record.getMerchantStoreId() != null) { + sql.VALUES("merchant_store_id", "#{merchantStoreId,jdbcType=BIGINT}"); + } + + if (record.getMerchantStoreName() != null) { + sql.VALUES("merchant_store_name", "#{merchantStoreName,jdbcType=VARCHAR}"); + } + + if (record.getStartTime() != null) { + sql.VALUES("start_time", "#{startTime,jdbcType=TIMESTAMP}"); + } + + if (record.getEndTime() != null) { + sql.VALUES("end_time", "#{endTime,jdbcType=TIMESTAMP}"); + } + + if (record.getDataCount() != null) { + sql.VALUES("data_count", "#{dataCount,jdbcType=VARCHAR}"); + } + + if (record.getStatus() != null) { + sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getExt1() != null) { + sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); + } + + return sql.toString(); + } + + public String selectByExample(HighGasClassGroupTaskExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("gas_class_group_id"); + sql.SELECT("gas_class_group_name"); + sql.SELECT("merchant_store_id"); + sql.SELECT("merchant_store_name"); + sql.SELECT("start_time"); + sql.SELECT("end_time"); + sql.SELECT("data_count"); + sql.SELECT("`status`"); + sql.SELECT("create_time"); + sql.SELECT("update_time"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("high_gas_class_group_task"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + HighGasClassGroupTask record = (HighGasClassGroupTask) parameter.get("record"); + HighGasClassGroupTaskExample example = (HighGasClassGroupTaskExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("high_gas_class_group_task"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getGasClassGroupId() != null) { + sql.SET("gas_class_group_id = #{record.gasClassGroupId,jdbcType=BIGINT}"); + } + + if (record.getGasClassGroupName() != null) { + sql.SET("gas_class_group_name = #{record.gasClassGroupName,jdbcType=VARCHAR}"); + } + + if (record.getMerchantStoreId() != null) { + sql.SET("merchant_store_id = #{record.merchantStoreId,jdbcType=BIGINT}"); + } + + if (record.getMerchantStoreName() != null) { + sql.SET("merchant_store_name = #{record.merchantStoreName,jdbcType=VARCHAR}"); + } + + if (record.getStartTime() != null) { + sql.SET("start_time = #{record.startTime,jdbcType=TIMESTAMP}"); + } + + if (record.getEndTime() != null) { + sql.SET("end_time = #{record.endTime,jdbcType=TIMESTAMP}"); + } + + if (record.getDataCount() != null) { + sql.SET("data_count = #{record.dataCount,jdbcType=VARCHAR}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getExt1() != null) { + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + } + + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByExample(Map parameter) { + SQL sql = new SQL(); + sql.UPDATE("high_gas_class_group_task"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("gas_class_group_id = #{record.gasClassGroupId,jdbcType=BIGINT}"); + sql.SET("gas_class_group_name = #{record.gasClassGroupName,jdbcType=VARCHAR}"); + sql.SET("merchant_store_id = #{record.merchantStoreId,jdbcType=BIGINT}"); + sql.SET("merchant_store_name = #{record.merchantStoreName,jdbcType=VARCHAR}"); + sql.SET("start_time = #{record.startTime,jdbcType=TIMESTAMP}"); + sql.SET("end_time = #{record.endTime,jdbcType=TIMESTAMP}"); + sql.SET("data_count = #{record.dataCount,jdbcType=VARCHAR}"); + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + + HighGasClassGroupTaskExample example = (HighGasClassGroupTaskExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(HighGasClassGroupTask record) { + SQL sql = new SQL(); + sql.UPDATE("high_gas_class_group_task"); + + if (record.getGasClassGroupId() != null) { + sql.SET("gas_class_group_id = #{gasClassGroupId,jdbcType=BIGINT}"); + } + + if (record.getGasClassGroupName() != null) { + sql.SET("gas_class_group_name = #{gasClassGroupName,jdbcType=VARCHAR}"); + } + + if (record.getMerchantStoreId() != null) { + sql.SET("merchant_store_id = #{merchantStoreId,jdbcType=BIGINT}"); + } + + if (record.getMerchantStoreName() != null) { + sql.SET("merchant_store_name = #{merchantStoreName,jdbcType=VARCHAR}"); + } + + if (record.getStartTime() != null) { + sql.SET("start_time = #{startTime,jdbcType=TIMESTAMP}"); + } + + if (record.getEndTime() != null) { + sql.SET("end_time = #{endTime,jdbcType=TIMESTAMP}"); + } + + if (record.getDataCount() != null) { + sql.SET("data_count = #{dataCount,jdbcType=VARCHAR}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{status,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getExt1() != null) { + sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); + } + + sql.WHERE("id = #{id,jdbcType=BIGINT}"); + + return sql.toString(); + } + + protected void applyWhere(SQL sql, HighGasClassGroupTaskExample 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/HighGasClassGroup.java b/hai-service/src/main/java/com/hai/entity/HighGasClassGroup.java new file mode 100644 index 00000000..03cc5801 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighGasClassGroup.java @@ -0,0 +1,232 @@ +package com.hai.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * high_gas_class_group + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class HighGasClassGroup implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 加油站id + */ + private Long merchantStoreId; + + /** + * 加油站名称 + */ + private String merchantStoreName; + + /** + * 班组名称 + */ + private String name; + + /** + * 负责人名称 + */ + private String principalName; + + /** + * 负责人电话 + */ + private String principalPhone; + + /** + * 状态 0:删除 1:正常 + */ + private Integer status; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 修改时间 + */ + private Date updateTime; + + private String ext1; + + private String ext2; + + private String ext3; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getMerchantStoreId() { + return merchantStoreId; + } + + public void setMerchantStoreId(Long merchantStoreId) { + this.merchantStoreId = merchantStoreId; + } + + public String getMerchantStoreName() { + return merchantStoreName; + } + + public void setMerchantStoreName(String merchantStoreName) { + this.merchantStoreName = merchantStoreName; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPrincipalName() { + return principalName; + } + + public void setPrincipalName(String principalName) { + this.principalName = principalName; + } + + public String getPrincipalPhone() { + return principalPhone; + } + + public void setPrincipalPhone(String principalPhone) { + this.principalPhone = principalPhone; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public String getExt1() { + return ext1; + } + + public void setExt1(String ext1) { + this.ext1 = ext1; + } + + public String getExt2() { + return ext2; + } + + public void setExt2(String ext2) { + this.ext2 = ext2; + } + + public String getExt3() { + return ext3; + } + + public void setExt3(String ext3) { + this.ext3 = ext3; + } + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + HighGasClassGroup other = (HighGasClassGroup) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getMerchantStoreId() == null ? other.getMerchantStoreId() == null : this.getMerchantStoreId().equals(other.getMerchantStoreId())) + && (this.getMerchantStoreName() == null ? other.getMerchantStoreName() == null : this.getMerchantStoreName().equals(other.getMerchantStoreName())) + && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName())) + && (this.getPrincipalName() == null ? other.getPrincipalName() == null : this.getPrincipalName().equals(other.getPrincipalName())) + && (this.getPrincipalPhone() == null ? other.getPrincipalPhone() == null : this.getPrincipalPhone().equals(other.getPrincipalPhone())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) + && (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) + && (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) + && (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getMerchantStoreId() == null) ? 0 : getMerchantStoreId().hashCode()); + result = prime * result + ((getMerchantStoreName() == null) ? 0 : getMerchantStoreName().hashCode()); + result = prime * result + ((getName() == null) ? 0 : getName().hashCode()); + result = prime * result + ((getPrincipalName() == null) ? 0 : getPrincipalName().hashCode()); + result = prime * result + ((getPrincipalPhone() == null) ? 0 : getPrincipalPhone().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); + result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); + result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); + result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", merchantStoreId=").append(merchantStoreId); + sb.append(", merchantStoreName=").append(merchantStoreName); + sb.append(", name=").append(name); + sb.append(", principalName=").append(principalName); + sb.append(", principalPhone=").append(principalPhone); + sb.append(", status=").append(status); + sb.append(", createTime=").append(createTime); + sb.append(", updateTime=").append(updateTime); + sb.append(", ext1=").append(ext1); + sb.append(", ext2=").append(ext2); + sb.append(", ext3=").append(ext3); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/HighGasClassGroupExample.java b/hai-service/src/main/java/com/hai/entity/HighGasClassGroupExample.java new file mode 100644 index 00000000..29c66a91 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighGasClassGroupExample.java @@ -0,0 +1,1013 @@ +package com.hai.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class HighGasClassGroupExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public HighGasClassGroupExample() { + 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 andMerchantStoreIdIsNull() { + addCriterion("merchant_store_id is null"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdIsNotNull() { + addCriterion("merchant_store_id is not null"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdEqualTo(Long value) { + addCriterion("merchant_store_id =", value, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdNotEqualTo(Long value) { + addCriterion("merchant_store_id <>", value, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdGreaterThan(Long value) { + addCriterion("merchant_store_id >", value, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdGreaterThanOrEqualTo(Long value) { + addCriterion("merchant_store_id >=", value, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdLessThan(Long value) { + addCriterion("merchant_store_id <", value, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdLessThanOrEqualTo(Long value) { + addCriterion("merchant_store_id <=", value, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdIn(List values) { + addCriterion("merchant_store_id in", values, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdNotIn(List values) { + addCriterion("merchant_store_id not in", values, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdBetween(Long value1, Long value2) { + addCriterion("merchant_store_id between", value1, value2, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdNotBetween(Long value1, Long value2) { + addCriterion("merchant_store_id not between", value1, value2, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameIsNull() { + addCriterion("merchant_store_name is null"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameIsNotNull() { + addCriterion("merchant_store_name is not null"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameEqualTo(String value) { + addCriterion("merchant_store_name =", value, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameNotEqualTo(String value) { + addCriterion("merchant_store_name <>", value, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameGreaterThan(String value) { + addCriterion("merchant_store_name >", value, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameGreaterThanOrEqualTo(String value) { + addCriterion("merchant_store_name >=", value, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameLessThan(String value) { + addCriterion("merchant_store_name <", value, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameLessThanOrEqualTo(String value) { + addCriterion("merchant_store_name <=", value, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameLike(String value) { + addCriterion("merchant_store_name like", value, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameNotLike(String value) { + addCriterion("merchant_store_name not like", value, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameIn(List values) { + addCriterion("merchant_store_name in", values, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameNotIn(List values) { + addCriterion("merchant_store_name not in", values, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameBetween(String value1, String value2) { + addCriterion("merchant_store_name between", value1, value2, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameNotBetween(String value1, String value2) { + addCriterion("merchant_store_name not between", value1, value2, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("`name` is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("`name` is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("`name` =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("`name` <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("`name` >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("`name` >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("`name` <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("`name` <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("`name` like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("`name` not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("`name` in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("`name` not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("`name` between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("`name` not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andPrincipalNameIsNull() { + addCriterion("principal_name is null"); + return (Criteria) this; + } + + public Criteria andPrincipalNameIsNotNull() { + addCriterion("principal_name is not null"); + return (Criteria) this; + } + + public Criteria andPrincipalNameEqualTo(String value) { + addCriterion("principal_name =", value, "principalName"); + return (Criteria) this; + } + + public Criteria andPrincipalNameNotEqualTo(String value) { + addCriterion("principal_name <>", value, "principalName"); + return (Criteria) this; + } + + public Criteria andPrincipalNameGreaterThan(String value) { + addCriterion("principal_name >", value, "principalName"); + return (Criteria) this; + } + + public Criteria andPrincipalNameGreaterThanOrEqualTo(String value) { + addCriterion("principal_name >=", value, "principalName"); + return (Criteria) this; + } + + public Criteria andPrincipalNameLessThan(String value) { + addCriterion("principal_name <", value, "principalName"); + return (Criteria) this; + } + + public Criteria andPrincipalNameLessThanOrEqualTo(String value) { + addCriterion("principal_name <=", value, "principalName"); + return (Criteria) this; + } + + public Criteria andPrincipalNameLike(String value) { + addCriterion("principal_name like", value, "principalName"); + return (Criteria) this; + } + + public Criteria andPrincipalNameNotLike(String value) { + addCriterion("principal_name not like", value, "principalName"); + return (Criteria) this; + } + + public Criteria andPrincipalNameIn(List values) { + addCriterion("principal_name in", values, "principalName"); + return (Criteria) this; + } + + public Criteria andPrincipalNameNotIn(List values) { + addCriterion("principal_name not in", values, "principalName"); + return (Criteria) this; + } + + public Criteria andPrincipalNameBetween(String value1, String value2) { + addCriterion("principal_name between", value1, value2, "principalName"); + return (Criteria) this; + } + + public Criteria andPrincipalNameNotBetween(String value1, String value2) { + addCriterion("principal_name not between", value1, value2, "principalName"); + return (Criteria) this; + } + + public Criteria andPrincipalPhoneIsNull() { + addCriterion("principal_phone is null"); + return (Criteria) this; + } + + public Criteria andPrincipalPhoneIsNotNull() { + addCriterion("principal_phone is not null"); + return (Criteria) this; + } + + public Criteria andPrincipalPhoneEqualTo(String value) { + addCriterion("principal_phone =", value, "principalPhone"); + return (Criteria) this; + } + + public Criteria andPrincipalPhoneNotEqualTo(String value) { + addCriterion("principal_phone <>", value, "principalPhone"); + return (Criteria) this; + } + + public Criteria andPrincipalPhoneGreaterThan(String value) { + addCriterion("principal_phone >", value, "principalPhone"); + return (Criteria) this; + } + + public Criteria andPrincipalPhoneGreaterThanOrEqualTo(String value) { + addCriterion("principal_phone >=", value, "principalPhone"); + return (Criteria) this; + } + + public Criteria andPrincipalPhoneLessThan(String value) { + addCriterion("principal_phone <", value, "principalPhone"); + return (Criteria) this; + } + + public Criteria andPrincipalPhoneLessThanOrEqualTo(String value) { + addCriterion("principal_phone <=", value, "principalPhone"); + return (Criteria) this; + } + + public Criteria andPrincipalPhoneLike(String value) { + addCriterion("principal_phone like", value, "principalPhone"); + return (Criteria) this; + } + + public Criteria andPrincipalPhoneNotLike(String value) { + addCriterion("principal_phone not like", value, "principalPhone"); + return (Criteria) this; + } + + public Criteria andPrincipalPhoneIn(List values) { + addCriterion("principal_phone in", values, "principalPhone"); + return (Criteria) this; + } + + public Criteria andPrincipalPhoneNotIn(List values) { + addCriterion("principal_phone not in", values, "principalPhone"); + return (Criteria) this; + } + + public Criteria andPrincipalPhoneBetween(String value1, String value2) { + addCriterion("principal_phone between", value1, value2, "principalPhone"); + return (Criteria) this; + } + + public Criteria andPrincipalPhoneNotBetween(String value1, String value2) { + addCriterion("principal_phone not between", value1, value2, "principalPhone"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("`status` is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("`status` is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Integer value) { + addCriterion("`status` =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Integer value) { + addCriterion("`status` <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Integer value) { + addCriterion("`status` >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("`status` >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Integer value) { + addCriterion("`status` <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Integer value) { + addCriterion("`status` <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("`status` not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Integer value1, Integer value2) { + addCriterion("`status` between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Integer value1, Integer value2) { + addCriterion("`status` not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andExt1IsNull() { + addCriterion("ext_1 is null"); + return (Criteria) this; + } + + public Criteria andExt1IsNotNull() { + addCriterion("ext_1 is not null"); + return (Criteria) this; + } + + public Criteria andExt1EqualTo(String value) { + addCriterion("ext_1 =", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotEqualTo(String value) { + addCriterion("ext_1 <>", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThan(String value) { + addCriterion("ext_1 >", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThanOrEqualTo(String value) { + addCriterion("ext_1 >=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThan(String value) { + addCriterion("ext_1 <", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThanOrEqualTo(String value) { + addCriterion("ext_1 <=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Like(String value) { + addCriterion("ext_1 like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotLike(String value) { + addCriterion("ext_1 not like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1In(List values) { + addCriterion("ext_1 in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotIn(List values) { + addCriterion("ext_1 not in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Between(String value1, String value2) { + addCriterion("ext_1 between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotBetween(String value1, String value2) { + addCriterion("ext_1 not between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt2IsNull() { + addCriterion("ext_2 is null"); + return (Criteria) this; + } + + public Criteria andExt2IsNotNull() { + addCriterion("ext_2 is not null"); + return (Criteria) this; + } + + public Criteria andExt2EqualTo(String value) { + addCriterion("ext_2 =", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotEqualTo(String value) { + addCriterion("ext_2 <>", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThan(String value) { + addCriterion("ext_2 >", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThanOrEqualTo(String value) { + addCriterion("ext_2 >=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThan(String value) { + addCriterion("ext_2 <", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThanOrEqualTo(String value) { + addCriterion("ext_2 <=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Like(String value) { + addCriterion("ext_2 like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotLike(String value) { + addCriterion("ext_2 not like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2In(List values) { + addCriterion("ext_2 in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotIn(List values) { + addCriterion("ext_2 not in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Between(String value1, String value2) { + addCriterion("ext_2 between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotBetween(String value1, String value2) { + addCriterion("ext_2 not between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt3IsNull() { + addCriterion("ext_3 is null"); + return (Criteria) this; + } + + public Criteria andExt3IsNotNull() { + addCriterion("ext_3 is not null"); + return (Criteria) this; + } + + public Criteria andExt3EqualTo(String value) { + addCriterion("ext_3 =", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotEqualTo(String value) { + addCriterion("ext_3 <>", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThan(String value) { + addCriterion("ext_3 >", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThanOrEqualTo(String value) { + addCriterion("ext_3 >=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThan(String value) { + addCriterion("ext_3 <", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThanOrEqualTo(String value) { + addCriterion("ext_3 <=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Like(String value) { + addCriterion("ext_3 like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotLike(String value) { + addCriterion("ext_3 not like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3In(List values) { + addCriterion("ext_3 in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotIn(List values) { + addCriterion("ext_3 not in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Between(String value1, String value2) { + addCriterion("ext_3 between", value1, value2, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotBetween(String value1, String value2) { + addCriterion("ext_3 not between", value1, value2, "ext3"); + return (Criteria) this; + } + } + + /** + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/HighGasClassGroupTask.java b/hai-service/src/main/java/com/hai/entity/HighGasClassGroupTask.java new file mode 100644 index 00000000..b32f2ee1 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighGasClassGroupTask.java @@ -0,0 +1,264 @@ +package com.hai.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * high_gas_class_group_task + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class HighGasClassGroupTask implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 班组id + */ + private Long gasClassGroupId; + + /** + * 班组名称 + */ + private String gasClassGroupName; + + /** + * 加油站id + */ + private Long merchantStoreId; + + /** + * 加油站名称 + */ + private String merchantStoreName; + + /** + * 开始时间 + */ + private Date startTime; + + /** + * 结束时间 + */ + private Date endTime; + + /** + * 数据统计 + */ + private String dataCount; + + /** + * 状态 0:删除 1:进行中 2:已结束 + */ + private Integer status; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 修改时间 + */ + private Date updateTime; + + private String ext1; + + private String ext2; + + private String ext3; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getGasClassGroupId() { + return gasClassGroupId; + } + + public void setGasClassGroupId(Long gasClassGroupId) { + this.gasClassGroupId = gasClassGroupId; + } + + public String getGasClassGroupName() { + return gasClassGroupName; + } + + public void setGasClassGroupName(String gasClassGroupName) { + this.gasClassGroupName = gasClassGroupName; + } + + public Long getMerchantStoreId() { + return merchantStoreId; + } + + public void setMerchantStoreId(Long merchantStoreId) { + this.merchantStoreId = merchantStoreId; + } + + public String getMerchantStoreName() { + return merchantStoreName; + } + + public void setMerchantStoreName(String merchantStoreName) { + this.merchantStoreName = merchantStoreName; + } + + public Date getStartTime() { + return startTime; + } + + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + + public Date getEndTime() { + return endTime; + } + + public void setEndTime(Date endTime) { + this.endTime = endTime; + } + + public String getDataCount() { + return dataCount; + } + + public void setDataCount(String dataCount) { + this.dataCount = dataCount; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public String getExt1() { + return ext1; + } + + public void setExt1(String ext1) { + this.ext1 = ext1; + } + + public String getExt2() { + return ext2; + } + + public void setExt2(String ext2) { + this.ext2 = ext2; + } + + public String getExt3() { + return ext3; + } + + public void setExt3(String ext3) { + this.ext3 = ext3; + } + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + HighGasClassGroupTask other = (HighGasClassGroupTask) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getGasClassGroupId() == null ? other.getGasClassGroupId() == null : this.getGasClassGroupId().equals(other.getGasClassGroupId())) + && (this.getGasClassGroupName() == null ? other.getGasClassGroupName() == null : this.getGasClassGroupName().equals(other.getGasClassGroupName())) + && (this.getMerchantStoreId() == null ? other.getMerchantStoreId() == null : this.getMerchantStoreId().equals(other.getMerchantStoreId())) + && (this.getMerchantStoreName() == null ? other.getMerchantStoreName() == null : this.getMerchantStoreName().equals(other.getMerchantStoreName())) + && (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime())) + && (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime())) + && (this.getDataCount() == null ? other.getDataCount() == null : this.getDataCount().equals(other.getDataCount())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) + && (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) + && (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) + && (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getGasClassGroupId() == null) ? 0 : getGasClassGroupId().hashCode()); + result = prime * result + ((getGasClassGroupName() == null) ? 0 : getGasClassGroupName().hashCode()); + result = prime * result + ((getMerchantStoreId() == null) ? 0 : getMerchantStoreId().hashCode()); + result = prime * result + ((getMerchantStoreName() == null) ? 0 : getMerchantStoreName().hashCode()); + result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode()); + result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode()); + result = prime * result + ((getDataCount() == null) ? 0 : getDataCount().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); + result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); + result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); + result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", gasClassGroupId=").append(gasClassGroupId); + sb.append(", gasClassGroupName=").append(gasClassGroupName); + sb.append(", merchantStoreId=").append(merchantStoreId); + sb.append(", merchantStoreName=").append(merchantStoreName); + sb.append(", startTime=").append(startTime); + sb.append(", endTime=").append(endTime); + sb.append(", dataCount=").append(dataCount); + sb.append(", status=").append(status); + sb.append(", createTime=").append(createTime); + sb.append(", updateTime=").append(updateTime); + sb.append(", ext1=").append(ext1); + sb.append(", ext2=").append(ext2); + sb.append(", ext3=").append(ext3); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/HighGasClassGroupTaskExample.java b/hai-service/src/main/java/com/hai/entity/HighGasClassGroupTaskExample.java new file mode 100644 index 00000000..54827ee5 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighGasClassGroupTaskExample.java @@ -0,0 +1,1123 @@ +package com.hai.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class HighGasClassGroupTaskExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public HighGasClassGroupTaskExample() { + 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 andGasClassGroupIdIsNull() { + addCriterion("gas_class_group_id is null"); + return (Criteria) this; + } + + public Criteria andGasClassGroupIdIsNotNull() { + addCriterion("gas_class_group_id is not null"); + return (Criteria) this; + } + + public Criteria andGasClassGroupIdEqualTo(Long value) { + addCriterion("gas_class_group_id =", value, "gasClassGroupId"); + return (Criteria) this; + } + + public Criteria andGasClassGroupIdNotEqualTo(Long value) { + addCriterion("gas_class_group_id <>", value, "gasClassGroupId"); + return (Criteria) this; + } + + public Criteria andGasClassGroupIdGreaterThan(Long value) { + addCriterion("gas_class_group_id >", value, "gasClassGroupId"); + return (Criteria) this; + } + + public Criteria andGasClassGroupIdGreaterThanOrEqualTo(Long value) { + addCriterion("gas_class_group_id >=", value, "gasClassGroupId"); + return (Criteria) this; + } + + public Criteria andGasClassGroupIdLessThan(Long value) { + addCriterion("gas_class_group_id <", value, "gasClassGroupId"); + return (Criteria) this; + } + + public Criteria andGasClassGroupIdLessThanOrEqualTo(Long value) { + addCriterion("gas_class_group_id <=", value, "gasClassGroupId"); + return (Criteria) this; + } + + public Criteria andGasClassGroupIdIn(List values) { + addCriterion("gas_class_group_id in", values, "gasClassGroupId"); + return (Criteria) this; + } + + public Criteria andGasClassGroupIdNotIn(List values) { + addCriterion("gas_class_group_id not in", values, "gasClassGroupId"); + return (Criteria) this; + } + + public Criteria andGasClassGroupIdBetween(Long value1, Long value2) { + addCriterion("gas_class_group_id between", value1, value2, "gasClassGroupId"); + return (Criteria) this; + } + + public Criteria andGasClassGroupIdNotBetween(Long value1, Long value2) { + addCriterion("gas_class_group_id not between", value1, value2, "gasClassGroupId"); + return (Criteria) this; + } + + public Criteria andGasClassGroupNameIsNull() { + addCriterion("gas_class_group_name is null"); + return (Criteria) this; + } + + public Criteria andGasClassGroupNameIsNotNull() { + addCriterion("gas_class_group_name is not null"); + return (Criteria) this; + } + + public Criteria andGasClassGroupNameEqualTo(String value) { + addCriterion("gas_class_group_name =", value, "gasClassGroupName"); + return (Criteria) this; + } + + public Criteria andGasClassGroupNameNotEqualTo(String value) { + addCriterion("gas_class_group_name <>", value, "gasClassGroupName"); + return (Criteria) this; + } + + public Criteria andGasClassGroupNameGreaterThan(String value) { + addCriterion("gas_class_group_name >", value, "gasClassGroupName"); + return (Criteria) this; + } + + public Criteria andGasClassGroupNameGreaterThanOrEqualTo(String value) { + addCriterion("gas_class_group_name >=", value, "gasClassGroupName"); + return (Criteria) this; + } + + public Criteria andGasClassGroupNameLessThan(String value) { + addCriterion("gas_class_group_name <", value, "gasClassGroupName"); + return (Criteria) this; + } + + public Criteria andGasClassGroupNameLessThanOrEqualTo(String value) { + addCriterion("gas_class_group_name <=", value, "gasClassGroupName"); + return (Criteria) this; + } + + public Criteria andGasClassGroupNameLike(String value) { + addCriterion("gas_class_group_name like", value, "gasClassGroupName"); + return (Criteria) this; + } + + public Criteria andGasClassGroupNameNotLike(String value) { + addCriterion("gas_class_group_name not like", value, "gasClassGroupName"); + return (Criteria) this; + } + + public Criteria andGasClassGroupNameIn(List values) { + addCriterion("gas_class_group_name in", values, "gasClassGroupName"); + return (Criteria) this; + } + + public Criteria andGasClassGroupNameNotIn(List values) { + addCriterion("gas_class_group_name not in", values, "gasClassGroupName"); + return (Criteria) this; + } + + public Criteria andGasClassGroupNameBetween(String value1, String value2) { + addCriterion("gas_class_group_name between", value1, value2, "gasClassGroupName"); + return (Criteria) this; + } + + public Criteria andGasClassGroupNameNotBetween(String value1, String value2) { + addCriterion("gas_class_group_name not between", value1, value2, "gasClassGroupName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdIsNull() { + addCriterion("merchant_store_id is null"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdIsNotNull() { + addCriterion("merchant_store_id is not null"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdEqualTo(Long value) { + addCriterion("merchant_store_id =", value, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdNotEqualTo(Long value) { + addCriterion("merchant_store_id <>", value, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdGreaterThan(Long value) { + addCriterion("merchant_store_id >", value, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdGreaterThanOrEqualTo(Long value) { + addCriterion("merchant_store_id >=", value, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdLessThan(Long value) { + addCriterion("merchant_store_id <", value, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdLessThanOrEqualTo(Long value) { + addCriterion("merchant_store_id <=", value, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdIn(List values) { + addCriterion("merchant_store_id in", values, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdNotIn(List values) { + addCriterion("merchant_store_id not in", values, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdBetween(Long value1, Long value2) { + addCriterion("merchant_store_id between", value1, value2, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdNotBetween(Long value1, Long value2) { + addCriterion("merchant_store_id not between", value1, value2, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameIsNull() { + addCriterion("merchant_store_name is null"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameIsNotNull() { + addCriterion("merchant_store_name is not null"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameEqualTo(String value) { + addCriterion("merchant_store_name =", value, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameNotEqualTo(String value) { + addCriterion("merchant_store_name <>", value, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameGreaterThan(String value) { + addCriterion("merchant_store_name >", value, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameGreaterThanOrEqualTo(String value) { + addCriterion("merchant_store_name >=", value, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameLessThan(String value) { + addCriterion("merchant_store_name <", value, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameLessThanOrEqualTo(String value) { + addCriterion("merchant_store_name <=", value, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameLike(String value) { + addCriterion("merchant_store_name like", value, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameNotLike(String value) { + addCriterion("merchant_store_name not like", value, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameIn(List values) { + addCriterion("merchant_store_name in", values, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameNotIn(List values) { + addCriterion("merchant_store_name not in", values, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameBetween(String value1, String value2) { + addCriterion("merchant_store_name between", value1, value2, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameNotBetween(String value1, String value2) { + addCriterion("merchant_store_name not between", value1, value2, "merchantStoreName"); + 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 andEndTimeIsNull() { + addCriterion("end_time is null"); + return (Criteria) this; + } + + public Criteria andEndTimeIsNotNull() { + addCriterion("end_time is not null"); + return (Criteria) this; + } + + public Criteria andEndTimeEqualTo(Date value) { + addCriterion("end_time =", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotEqualTo(Date value) { + addCriterion("end_time <>", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeGreaterThan(Date value) { + addCriterion("end_time >", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeGreaterThanOrEqualTo(Date value) { + addCriterion("end_time >=", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeLessThan(Date value) { + addCriterion("end_time <", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeLessThanOrEqualTo(Date value) { + addCriterion("end_time <=", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeIn(List values) { + addCriterion("end_time in", values, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotIn(List values) { + addCriterion("end_time not in", values, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeBetween(Date value1, Date value2) { + addCriterion("end_time between", value1, value2, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotBetween(Date value1, Date value2) { + addCriterion("end_time not between", value1, value2, "endTime"); + return (Criteria) this; + } + + public Criteria andDataCountIsNull() { + addCriterion("data_count is null"); + return (Criteria) this; + } + + public Criteria andDataCountIsNotNull() { + addCriterion("data_count is not null"); + return (Criteria) this; + } + + public Criteria andDataCountEqualTo(String value) { + addCriterion("data_count =", value, "dataCount"); + return (Criteria) this; + } + + public Criteria andDataCountNotEqualTo(String value) { + addCriterion("data_count <>", value, "dataCount"); + return (Criteria) this; + } + + public Criteria andDataCountGreaterThan(String value) { + addCriterion("data_count >", value, "dataCount"); + return (Criteria) this; + } + + public Criteria andDataCountGreaterThanOrEqualTo(String value) { + addCriterion("data_count >=", value, "dataCount"); + return (Criteria) this; + } + + public Criteria andDataCountLessThan(String value) { + addCriterion("data_count <", value, "dataCount"); + return (Criteria) this; + } + + public Criteria andDataCountLessThanOrEqualTo(String value) { + addCriterion("data_count <=", value, "dataCount"); + return (Criteria) this; + } + + public Criteria andDataCountLike(String value) { + addCriterion("data_count like", value, "dataCount"); + return (Criteria) this; + } + + public Criteria andDataCountNotLike(String value) { + addCriterion("data_count not like", value, "dataCount"); + return (Criteria) this; + } + + public Criteria andDataCountIn(List values) { + addCriterion("data_count in", values, "dataCount"); + return (Criteria) this; + } + + public Criteria andDataCountNotIn(List values) { + addCriterion("data_count not in", values, "dataCount"); + return (Criteria) this; + } + + public Criteria andDataCountBetween(String value1, String value2) { + addCriterion("data_count between", value1, value2, "dataCount"); + return (Criteria) this; + } + + public Criteria andDataCountNotBetween(String value1, String value2) { + addCriterion("data_count not between", value1, value2, "dataCount"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("`status` is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("`status` is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Integer value) { + addCriterion("`status` =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Integer value) { + addCriterion("`status` <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Integer value) { + addCriterion("`status` >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("`status` >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Integer value) { + addCriterion("`status` <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Integer value) { + addCriterion("`status` <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("`status` not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Integer value1, Integer value2) { + addCriterion("`status` between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Integer value1, Integer value2) { + addCriterion("`status` not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andExt1IsNull() { + addCriterion("ext_1 is null"); + return (Criteria) this; + } + + public Criteria andExt1IsNotNull() { + addCriterion("ext_1 is not null"); + return (Criteria) this; + } + + public Criteria andExt1EqualTo(String value) { + addCriterion("ext_1 =", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotEqualTo(String value) { + addCriterion("ext_1 <>", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThan(String value) { + addCriterion("ext_1 >", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThanOrEqualTo(String value) { + addCriterion("ext_1 >=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThan(String value) { + addCriterion("ext_1 <", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThanOrEqualTo(String value) { + addCriterion("ext_1 <=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Like(String value) { + addCriterion("ext_1 like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotLike(String value) { + addCriterion("ext_1 not like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1In(List values) { + addCriterion("ext_1 in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotIn(List values) { + addCriterion("ext_1 not in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Between(String value1, String value2) { + addCriterion("ext_1 between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotBetween(String value1, String value2) { + addCriterion("ext_1 not between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt2IsNull() { + addCriterion("ext_2 is null"); + return (Criteria) this; + } + + public Criteria andExt2IsNotNull() { + addCriterion("ext_2 is not null"); + return (Criteria) this; + } + + public Criteria andExt2EqualTo(String value) { + addCriterion("ext_2 =", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotEqualTo(String value) { + addCriterion("ext_2 <>", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThan(String value) { + addCriterion("ext_2 >", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThanOrEqualTo(String value) { + addCriterion("ext_2 >=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThan(String value) { + addCriterion("ext_2 <", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThanOrEqualTo(String value) { + addCriterion("ext_2 <=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Like(String value) { + addCriterion("ext_2 like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotLike(String value) { + addCriterion("ext_2 not like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2In(List values) { + addCriterion("ext_2 in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotIn(List values) { + addCriterion("ext_2 not in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Between(String value1, String value2) { + addCriterion("ext_2 between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotBetween(String value1, String value2) { + addCriterion("ext_2 not between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt3IsNull() { + addCriterion("ext_3 is null"); + return (Criteria) this; + } + + public Criteria andExt3IsNotNull() { + addCriterion("ext_3 is not null"); + return (Criteria) this; + } + + public Criteria andExt3EqualTo(String value) { + addCriterion("ext_3 =", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotEqualTo(String value) { + addCriterion("ext_3 <>", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThan(String value) { + addCriterion("ext_3 >", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThanOrEqualTo(String value) { + addCriterion("ext_3 >=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThan(String value) { + addCriterion("ext_3 <", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThanOrEqualTo(String value) { + addCriterion("ext_3 <=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Like(String value) { + addCriterion("ext_3 like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotLike(String value) { + addCriterion("ext_3 not like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3In(List values) { + addCriterion("ext_3 in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotIn(List values) { + addCriterion("ext_3 not in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Between(String value1, String value2) { + addCriterion("ext_3 between", value1, value2, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotBetween(String value1, String value2) { + addCriterion("ext_3 not between", value1, value2, "ext3"); + return (Criteria) this; + } + } + + /** + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/enum_type/GasClassGroupTaskStatus.java b/hai-service/src/main/java/com/hai/enum_type/GasClassGroupTaskStatus.java new file mode 100644 index 00000000..8cc16a62 --- /dev/null +++ b/hai-service/src/main/java/com/hai/enum_type/GasClassGroupTaskStatus.java @@ -0,0 +1,36 @@ +package com.hai.enum_type; + +/** + * 加油站员工状态 + * @author hurui + */ +public enum GasClassGroupTaskStatus { + status0(0 , "删除"), + status1(1 , "进行中"), + status2(2 , "已结束"), + ; + + private Integer status; + private String name; + + GasClassGroupTaskStatus(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/model/GasClassGroupTaskDataCount.java b/hai-service/src/main/java/com/hai/model/GasClassGroupTaskDataCount.java new file mode 100644 index 00000000..b3e1206d --- /dev/null +++ b/hai-service/src/main/java/com/hai/model/GasClassGroupTaskDataCount.java @@ -0,0 +1,129 @@ +package com.hai.model; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * 加油站 班组任务数据统计模型 + * @author hurui + */ +public class GasClassGroupTaskDataCount { + + /** + * 开始时间 + */ + private Date startTime; + + /** + * 结束时间 + */ + private Date endTime; + + /** + * 加油总金额 + */ + private BigDecimal refuelPrice; + + /** + * 加油总数量 + */ + private Integer refuelNum; + + /** + * 加油总升数 + */ + private BigDecimal refuelLiters; + + /** + * 退款总金额 + */ + private BigDecimal refundPrice; + + /** + * 退款总数量 + */ + private Integer refundNum; + + /** + * 退款总升数 + */ + private BigDecimal refundLiters; + + /** + * 班组油品数据统计 + */ + List groupTaskOilCountList; + + public Date getStartTime() { + return startTime; + } + + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + + public Date getEndTime() { + return endTime; + } + + public void setEndTime(Date endTime) { + this.endTime = endTime; + } + + public BigDecimal getRefuelPrice() { + return refuelPrice; + } + + public void setRefuelPrice(BigDecimal refuelPrice) { + this.refuelPrice = refuelPrice; + } + + public Integer getRefuelNum() { + return refuelNum; + } + + public void setRefuelNum(Integer refuelNum) { + this.refuelNum = refuelNum; + } + + public BigDecimal getRefuelLiters() { + return refuelLiters; + } + + public void setRefuelLiters(BigDecimal refuelLiters) { + this.refuelLiters = refuelLiters; + } + + public BigDecimal getRefundPrice() { + return refundPrice; + } + + public void setRefundPrice(BigDecimal refundPrice) { + this.refundPrice = refundPrice; + } + + public Integer getRefundNum() { + return refundNum; + } + + public void setRefundNum(Integer refundNum) { + this.refundNum = refundNum; + } + + public BigDecimal getRefundLiters() { + return refundLiters; + } + + public void setRefundLiters(BigDecimal refundLiters) { + this.refundLiters = refundLiters; + } + + public List getGroupTaskOilCountList() { + return groupTaskOilCountList; + } + + public void setGroupTaskOilCountList(List groupTaskOilCountList) { + this.groupTaskOilCountList = groupTaskOilCountList; + } +} diff --git a/hai-service/src/main/java/com/hai/model/GasClassGroupTaskOilCount.java b/hai-service/src/main/java/com/hai/model/GasClassGroupTaskOilCount.java new file mode 100644 index 00000000..7c43ab3f --- /dev/null +++ b/hai-service/src/main/java/com/hai/model/GasClassGroupTaskOilCount.java @@ -0,0 +1,62 @@ +package com.hai.model; + +import java.math.BigDecimal; + +/** + * 加油站 班组任务,加油统计 + * @author hurui + */ +public class GasClassGroupTaskOilCount { + + /** + * 油号 + */ + private Integer oilNo; + + /** + * 加油总金额 + */ + private BigDecimal refuelPrice; + + /** + * 加油总数量 + */ + private Integer refuelNum; + + /** + * 加油总升数 + */ + private BigDecimal refuelLiters; + + public Integer getOilNo() { + return oilNo; + } + + public void setOilNo(Integer oilNo) { + this.oilNo = oilNo; + } + + public BigDecimal getRefuelPrice() { + return refuelPrice; + } + + public void setRefuelPrice(BigDecimal refuelPrice) { + this.refuelPrice = refuelPrice; + } + + public Integer getRefuelNum() { + return refuelNum; + } + + public void setRefuelNum(Integer refuelNum) { + this.refuelNum = refuelNum; + } + + public BigDecimal getRefuelLiters() { + return refuelLiters; + } + + public void setRefuelLiters(BigDecimal refuelLiters) { + this.refuelLiters = refuelLiters; + } +} diff --git a/hai-service/src/main/java/com/hai/model/HighCouponCodeModel.java b/hai-service/src/main/java/com/hai/model/HighCouponCodeModel.java deleted file mode 100644 index 08cb1a56..00000000 --- a/hai-service/src/main/java/com/hai/model/HighCouponCodeModel.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.hai.model; - -/** - * @ClassName HighCouponCodeModel - * @Description: - * @Author 胡锐 - * @Date 2021/3/16 - **/ -public interface HighCouponCodeModel { - - - -} diff --git a/hai-service/src/main/java/com/hai/service/HighGasClassGroupService.java b/hai-service/src/main/java/com/hai/service/HighGasClassGroupService.java new file mode 100644 index 00000000..c5b9f75b --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/HighGasClassGroupService.java @@ -0,0 +1,40 @@ +package com.hai.service; + +import com.hai.entity.HighGasClassGroup; + +import java.util.List; +import java.util.Map; + +/** + * 加油站班组服务 + * @author hurui + */ +public interface HighGasClassGroupService { + + /** + * 编辑班组 + * @param gasClassGroup + */ + void editGroup(HighGasClassGroup gasClassGroup); + + /** + * 删除班组 + * @param groupId + */ + void delGroup(Long groupId); + + /** + * 根据id查询详情 + * @param groupId + * @return + */ + HighGasClassGroup getDetailById(Long groupId); + + /** + * 查询班组列表 + * @param param + * @return + */ + List getGroupList(Map param); + +} diff --git a/hai-service/src/main/java/com/hai/service/HighGasClassGroupTaskService.java b/hai-service/src/main/java/com/hai/service/HighGasClassGroupTaskService.java new file mode 100644 index 00000000..153f5550 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/HighGasClassGroupTaskService.java @@ -0,0 +1,64 @@ +package com.hai.service; + +import com.alibaba.fastjson.JSONObject; +import com.hai.entity.HighGasClassGroupTask; +import com.hai.model.GasClassGroupTaskDataCount; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * 加油站班组任务 + * @author hurui + */ +public interface HighGasClassGroupTaskService { + + /** + * 开始班组 + * @param gasId 油站id + * @param gasClassGroupId 班组id + */ + void startGroupTask(Long gasId, Long gasClassGroupId); + + /** + * 结束班组任务 + * @param gasId 油站id + */ + void endGroupTask(Long gasId); + + /** + * 交接班组任务 + * @param gasId 油站id + * @param gasClassGroupId 班组id + */ + void swapGroupTask(Long gasId, Long gasClassGroupId); + + /** + * 统计班组任务数据 + * @param groupTaskId + * @return + */ + GasClassGroupTaskDataCount countGroupTaskData(Long gasId, Long groupTaskId, Date startTime, Date endTime); + + /** + * 编辑班组任务 + * @param gasClassGroupTask + */ + void editGroupTask(HighGasClassGroupTask gasClassGroupTask); + + /** + * 根据id查询详情 + * @param groupTaskId + * @return + */ + HighGasClassGroupTask getDetailById(Long groupTaskId); + + /** + * 查询班组任务列表 + * @param param + * @return + */ + List getGroupTaskList(Map param); + +} diff --git a/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java index 2114240c..3a3fdc35 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java @@ -7,7 +7,6 @@ import com.hai.common.exception.SysCode; import com.hai.dao.HighCouponHandselMapper; import com.hai.dao.HighCouponMapper; import com.hai.entity.*; -import com.hai.model.HighCouponCodeModel; import com.hai.model.HighCouponHandselModel; import com.hai.model.HighCouponModel; import com.hai.service.*; diff --git a/hai-service/src/main/java/com/hai/service/impl/HighGasClassGroupServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighGasClassGroupServiceImpl.java new file mode 100644 index 00000000..148d69ae --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/impl/HighGasClassGroupServiceImpl.java @@ -0,0 +1,77 @@ +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.HighGasClassGroupMapper; +import com.hai.entity.HighGasClassGroup; +import com.hai.entity.HighGasClassGroupExample; +import com.hai.service.HighGasClassGroupService; +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("gasClassGroupService") +public class HighGasClassGroupServiceImpl implements HighGasClassGroupService { + + @Resource + private HighGasClassGroupMapper gasClassGroupMapper; + + @Override + public void editGroup(HighGasClassGroup gasClassGroup) { + if (gasClassGroup.getId() == null) { + gasClassGroup.setStatus(1); + gasClassGroup.setCreateTime(new Date()); + gasClassGroup.setUpdateTime(new Date()); + gasClassGroupMapper.insert(gasClassGroup); + } else { + gasClassGroup.setUpdateTime(new Date()); + gasClassGroupMapper.updateByPrimaryKey(gasClassGroup); + } + } + + @Override + public void delGroup(Long groupId) { + HighGasClassGroup classGroup = getDetailById(groupId); + if (classGroup == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到班组"); + } + classGroup.setStatus(0); + editGroup(classGroup); + } + + @Override + public HighGasClassGroup getDetailById(Long groupId) { + return gasClassGroupMapper.selectByPrimaryKey(groupId); + } + + @Override + public List getGroupList(Map param) { + HighGasClassGroupExample example = new HighGasClassGroupExample(); + HighGasClassGroupExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(0); + + if (MapUtils.getLong(param, "merchantStoreId") != null) { + criteria.andMerchantStoreIdEqualTo(MapUtils.getLong(param, "merchantStoreId")); + } + + if (StringUtils.isNotBlank(MapUtils.getString(param, "merchantStoreName"))) { + criteria.andMerchantStoreNameLike("%" + MapUtils.getString(param, "merchantStoreId") + "%"); + } + + if (StringUtils.isNotBlank(MapUtils.getString(param, "principalName"))) { + criteria.andPrincipalNameLike("%" + MapUtils.getString(param, "principalName") + "%"); + } + + if (StringUtils.isNotBlank(MapUtils.getString(param, "principalPhone"))) { + criteria.andPrincipalPhoneLike("%" + MapUtils.getString(param, "principalPhone") + "%"); + } + + example.setOrderByClause("create_time desc"); + return gasClassGroupMapper.selectByExample(example); + } +} diff --git a/hai-service/src/main/java/com/hai/service/impl/HighGasClassGroupTaskServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighGasClassGroupTaskServiceImpl.java new file mode 100644 index 00000000..41136539 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/impl/HighGasClassGroupTaskServiceImpl.java @@ -0,0 +1,181 @@ +package com.hai.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.hai.common.exception.ErrorCode; +import com.hai.common.exception.ErrorHelp; +import com.hai.common.exception.SysCode; +import com.hai.dao.HighGasClassGroupTaskMapper; +import com.hai.entity.HighGasClassGroup; +import com.hai.entity.HighGasClassGroupTask; +import com.hai.entity.HighGasClassGroupTaskExample; +import com.hai.entity.HighMerchantStore; +import com.hai.enum_type.GasClassGroupTaskStatus; +import com.hai.model.GasClassGroupTaskDataCount; +import com.hai.model.GasClassGroupTaskOilCount; +import com.hai.service.HighGasClassGroupService; +import com.hai.service.HighGasClassGroupTaskService; +import com.hai.service.HighMerchantStoreService; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.util.*; + +@Service("gasClassGroupTask") +public class HighGasClassGroupTaskServiceImpl implements HighGasClassGroupTaskService { + + @Resource + private HighGasClassGroupTaskMapper gasClassGroupTaskMapper; + + @Resource + private HighGasClassGroupService gasClassGroupService; + + @Resource + private HighMerchantStoreService merchantStoreService; + + @Override + @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) + public void startGroupTask(Long gasId, Long gasClassGroupId) { + // 查询加油站 + HighMerchantStore merchantStore = merchantStoreService.getDetailById(gasId); + if (merchantStore == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到加油站信息"); + } + + // 查询进行中的任务 + Map param = new HashMap<>(); + param.put("merchantStoreId", merchantStore.getId()); + param.put("status", GasClassGroupTaskStatus.status1.getStatus()); + List list = getGroupTaskList(param); + if (list.size() > 0) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已有班组正在进行中,请结束班组或交换班组"); + } + // 查询班组信息 + HighGasClassGroup group = gasClassGroupService.getDetailById(gasClassGroupId); + if (group == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到班组信息"); + } + + HighGasClassGroupTask groupTask = new HighGasClassGroupTask(); + groupTask.setGasClassGroupId(group.getId()); + groupTask.setGasClassGroupName(group.getName()); + groupTask.setMerchantStoreId(merchantStore.getId()); + groupTask.setMerchantStoreName(merchantStore.getStoreName()); + groupTask.setStartTime(new Date()); + editGroupTask(groupTask); + } + + @Override + @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) + public void endGroupTask(Long gasId) { + // 查询进行中的任务 + Map param = new HashMap<>(); + param.put("merchantStoreId", gasId); + param.put("status", GasClassGroupTaskStatus.status1.getStatus()); + List list = getGroupTaskList(param); + if (list.size() > 0) { + HighGasClassGroupTask groupTask = list.get(0); + groupTask.setEndTime(new Date()); + groupTask.setStatus(GasClassGroupTaskStatus.status2.getStatus()); + groupTask.setDataCount(JSONObject.toJSONString(countGroupTaskData(gasId, groupTask.getId(), groupTask.getStartTime(), groupTask.getEndTime()))); + editGroupTask(groupTask); + } + } + + @Override + @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) + public void swapGroupTask(Long gasId, Long gasClassGroupId) { + // 任务结束 + endGroupTask(gasId); + + // 开启新的任务 + startGroupTask(gasId, gasClassGroupId); + } + + @Override + public GasClassGroupTaskDataCount countGroupTaskData(Long gasId, Long groupTaskId, Date startTime, Date endTime) { + GasClassGroupTaskDataCount dataCount = new GasClassGroupTaskDataCount(); + dataCount.setStartTime(startTime); + dataCount.setEndTime(endTime); + + // 加油汇总 + Map refuelData = gasClassGroupTaskMapper.countRefuelData(groupTaskId); + dataCount.setRefuelPrice(new BigDecimal(MapUtils.getString(refuelData, "refuelPrice"))); + dataCount.setRefuelNum(MapUtils.getInteger(refuelData, "refuelNum")); + dataCount.setRefuelLiters(new BigDecimal(MapUtils.getString(refuelData, "refuelLiters"))); + + // 退款汇总 + Map refundData = gasClassGroupTaskMapper.countRefundData(groupTaskId); + dataCount.setRefundPrice(new BigDecimal(MapUtils.getString(refundData, "refundPrice"))); + dataCount.setRefundNum(MapUtils.getInteger(refundData, "refuelNum")); + dataCount.setRefundLiters(new BigDecimal(MapUtils.getString(refundData, "refundLiters"))); + + + // 油品汇总 + List> oilDataList = gasClassGroupTaskMapper.countOilData(gasId, groupTaskId); + + List oilCountList = new ArrayList<>(); + for (Map oilData : oilDataList) { + GasClassGroupTaskOilCount oilCount = new GasClassGroupTaskOilCount(); + oilCount.setRefuelPrice(new BigDecimal(MapUtils.getString(refuelData, "refuelPrice"))); + oilCount.setRefuelNum(MapUtils.getInteger(refuelData, "refuelNum")); + oilCount.setRefuelLiters(new BigDecimal(MapUtils.getString(refuelData, "refuelLiters"))); + oilCountList.add(oilCount); + } + dataCount.setGroupTaskOilCountList(oilCountList); + + return dataCount; + } + + @Override + public void editGroupTask(HighGasClassGroupTask gasClassGroupTask) { + if (gasClassGroupTask.getId() == null) { + gasClassGroupTask.setStatus(GasClassGroupTaskStatus.status1.getStatus()); + gasClassGroupTask.setCreateTime(new Date()); + gasClassGroupTask.setUpdateTime(new Date()); + gasClassGroupTaskMapper.insert(gasClassGroupTask); + } else { + gasClassGroupTask.setUpdateTime(new Date()); + gasClassGroupTaskMapper.updateByPrimaryKey(gasClassGroupTask); + } + } + + @Override + public HighGasClassGroupTask getDetailById(Long groupTaskId) { + return gasClassGroupTaskMapper.selectByPrimaryKey(groupTaskId); + } + + @Override + public List getGroupTaskList(Map param) { + HighGasClassGroupTaskExample example = new HighGasClassGroupTaskExample(); + HighGasClassGroupTaskExample.Criteria criteria = example.createCriteria() + .andStatusNotEqualTo(GasClassGroupTaskStatus.status0.getStatus()); + + if (MapUtils.getLong(param, "gasClassGroupId") != null) { + criteria.andGasClassGroupIdEqualTo(MapUtils.getLong(param, "gasClassGroupId")); + } + + if (StringUtils.isNotBlank(MapUtils.getString(param, "gasClassGroupName"))) { + criteria.andGasClassGroupNameLike("%" + MapUtils.getString(param, "gasClassGroupName") + "%"); + } + + if (MapUtils.getLong(param, "merchantStoreId") != null) { + criteria.andMerchantStoreIdEqualTo(MapUtils.getLong(param, "merchantStoreId")); + } + + if (StringUtils.isNotBlank(MapUtils.getString(param, "gasClassGroupName"))) { + criteria.andGasClassGroupNameLike("%" + MapUtils.getString(param, "gasClassGroupName") + "%"); + } + + if (MapUtils.getInteger(param, "status") != null) { + criteria.andStatusEqualTo(MapUtils.getInteger(param, "status")); + } + + example.setOrderByClause("create_time desc"); + return gasClassGroupTaskMapper.selectByExample(example); + } +}