From f6092f99540af692867013261128a9233e7b6e22 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Wed, 15 Jun 2022 09:13:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bweb/controller/HighDeviceController.java | 239 +++ .../com/hai/config/MqttProviderConfig.java | 6 +- .../java/com/hai/dao/HighDeviceMapper.java | 155 ++ .../java/com/hai/dao/HighDeviceMapperExt.java | 7 + .../com/hai/dao/HighDeviceSqlProvider.java | 430 +++++ .../main/java/com/hai/entity/HighDevice.java | 344 ++++ .../com/hai/entity/HighDeviceExample.java | 1473 +++++++++++++++++ .../com/hai/enum_type/DeviceTypeEnum.java | 44 + .../com/hai/service/HighDeviceService.java | 35 + .../service/impl/HighDeviceServiceImpl.java | 68 + 10 files changed, 2798 insertions(+), 3 deletions(-) create mode 100644 hai-bweb/src/main/java/com/bweb/controller/HighDeviceController.java create mode 100644 hai-service/src/main/java/com/hai/dao/HighDeviceMapper.java create mode 100644 hai-service/src/main/java/com/hai/dao/HighDeviceMapperExt.java create mode 100644 hai-service/src/main/java/com/hai/dao/HighDeviceSqlProvider.java create mode 100644 hai-service/src/main/java/com/hai/entity/HighDevice.java create mode 100644 hai-service/src/main/java/com/hai/entity/HighDeviceExample.java create mode 100644 hai-service/src/main/java/com/hai/enum_type/DeviceTypeEnum.java create mode 100644 hai-service/src/main/java/com/hai/service/HighDeviceService.java create mode 100644 hai-service/src/main/java/com/hai/service/impl/HighDeviceServiceImpl.java diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighDeviceController.java b/hai-bweb/src/main/java/com/bweb/controller/HighDeviceController.java new file mode 100644 index 00000000..4b243b34 --- /dev/null +++ b/hai-bweb/src/main/java/com/bweb/controller/HighDeviceController.java @@ -0,0 +1,239 @@ +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.SessionObject; +import com.hai.common.security.UserCenter; +import com.hai.common.utils.DateUtil; +import com.hai.common.utils.ResponseMsgUtil; +import com.hai.entity.*; +import com.hai.enum_type.DeviceTypeEnum; +import com.hai.model.HighCouponHandselModel; +import com.hai.model.HighMerchantModel; +import com.hai.model.ResponseData; +import com.hai.model.UserInfoModel; +import com.hai.service.BsCompanyService; +import com.hai.service.HighDeviceService; +import com.hai.service.HighMerchantService; +import com.hai.service.HighMerchantStoreService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.commons.collections4.MapUtils; +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 javax.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.Map; + +@Controller +@RequestMapping(value = "/device") +@Api(value = "卡卷接口") +public class HighDeviceController { + + private static Logger log = LoggerFactory.getLogger(HighCouponController.class); + + @Resource + private UserCenter userCenter; + + @Resource + private HighDeviceService deviceService; + + @Resource + private HighMerchantService merchantService; + + @Resource + private HighMerchantStoreService merchantStoreService; + + @Resource + private BsCompanyService companyService; + + @RequestMapping(value="/editDevice",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "编辑设备") + public ResponseData editDevice(@RequestBody HighDevice body) { + try { + + if (body.getMerStoreId() == null + || body.getType() == null + || StringUtils.isBlank(body.getDeviceName()) + ) { + log.error("HighDeviceController -> editDevice() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + if (DeviceTypeEnum.getNameByType(body.getType()) == null) { + log.error("HighDeviceController -> editDevice() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的设备类型"); + } + + if (body.getType().equals(DeviceTypeEnum.type1.getType()) + && (StringUtils.isBlank(body.getDeviceSn())) || StringUtils.isBlank(body.getDeviceKey())) { + log.error("HighDeviceController -> editDevice() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + if (body.getType().equals(DeviceTypeEnum.type2.getType()) + && (StringUtils.isBlank(body.getDeviceImei())) || StringUtils.isBlank(body.getDeviceIccid())) { + log.error("HighDeviceController -> editDevice() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + HighDevice device; + if (body.getId() != null) { + // 查询设备 + device = deviceService.getDetailById(body.getId()); + if (device == null) { + log.error("HighDeviceController -> editDevice() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + } else { + device = new HighDevice(); + } + + // 查询门店 + HighMerchantStore store = merchantStoreService.getDetailById(body.getMerStoreId()); + if (store == null) { + log.error("HighDeviceController -> editDevice() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的门店"); + } + + // 查询商户 + HighMerchant merchant = merchantService.getDetailById(store.getMerchantId()); + if (merchant == null) { + log.error("HighDeviceController -> editDevice() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户"); + } + + // 查询分公司 + BsCompany company = companyService.getCompanyById(store.getMerchantId()); + if (company == null) { + log.error("HighDeviceController -> editDevice() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的分公司"); + } + + device.setCompanyId(company.getId()); + device.setCompanyName(company.getName()); + device.setMerId(merchant.getId()); + device.setMerName(merchant.getMerchantName()); + device.setMerStoreId(store.getId()); + device.setMerStoreName(store.getStoreName()); + device.setType(body.getType()); + device.setDeviceName(body.getDeviceName()); + device.setDeviceSn(body.getDeviceSn()); + device.setDeviceKey(body.getDeviceKey()); + device.setDeviceImei(body.getDeviceImei()); + device.setDeviceIccid(body.getDeviceIccid()); + deviceService.editDevice(device); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("HighDeviceController -> insertCoupon() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/delDevice",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "删除设备") + public ResponseData delDevice(@RequestBody JSONObject body) { + try { + + if (body.getLong("deviceId") == null) { + log.error("HighDeviceController -> delDevice() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + // 查询设备 + HighDevice device = deviceService.getDetailById(body.getLong("deviceId")); + if (device == null) { + log.error("HighDeviceController -> delDevice() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + device.setStatus(0); + deviceService.editDevice(device); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("HighDeviceController -> delDevice() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getDetailById",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "根据id查询设备详情") + public ResponseData getDetailById(@RequestParam(name = "deviceId", required = true) Long deviceId) { + try { + + return ResponseMsgUtil.success(deviceService.getDetailById(deviceId)); + + } catch (Exception e) { + log.error("HighDeviceController -> getDetailById() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getDeviceList",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "根据id查询设备详情") + public ResponseData getDeviceList(@RequestParam(name = "companyId", required = false) Long companyId, + @RequestParam(name = "merId", required = false) Long merId, + @RequestParam(name = "storeId", required = false) Long storeId, + @RequestParam(name = "deviceName", required = false) String deviceName, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize) { + try { + + UserInfoModel sessionModel = userCenter.getSessionModel(UserInfoModel.class); + if (sessionModel == null) { + log.error("HighDeviceController -> getDeviceList() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到"); + } + + Map param = new HashMap<>(); + param.put("deviceName", deviceName); + + if (sessionModel.getSecUser().getObjectType().equals(0)) { + param.put("companyId", companyId); + param.put("merId", merId); + param.put("storeId", storeId); + + } else if (sessionModel.getSecUser().getObjectType().equals(1)) { + param.put("companyId", sessionModel.getBsCompany().getId()); + param.put("merId", merId); + param.put("storeId", storeId); + + } else if (sessionModel.getSecUser().getObjectType().equals(2)) { + param.put("merId", sessionModel.getMerchant().getId()); + param.put("storeId", storeId); + + } else if (sessionModel.getSecUser().getObjectType().equals(3)) { + param.put("storeId", sessionModel.getMerchantStore().getId()); + + } else { + log.error("HighDeviceController -> getDeviceList() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); + } + + PageHelper.startPage(pageNum, pageSize); + return ResponseMsgUtil.success(new PageInfo<>(deviceService.getDeviceList(param))); + + } catch (Exception e) { + log.error("HighDeviceController -> getDeviceList() error!",e); + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/hai-service/src/main/java/com/hai/config/MqttProviderConfig.java b/hai-service/src/main/java/com/hai/config/MqttProviderConfig.java index 73728d6d..d2e27113 100644 --- a/hai-service/src/main/java/com/hai/config/MqttProviderConfig.java +++ b/hai-service/src/main/java/com/hai/config/MqttProviderConfig.java @@ -14,13 +14,13 @@ import org.springframework.context.annotation.Configuration; @Configuration @Slf4j public class MqttProviderConfig { - // @Value("${spring.mqtt.username}") + @Value("${spring.mqtt.username}") private String username; - // @Value("${spring.mqtt.password}") + @Value("${spring.mqtt.password}") private String password; - // @Value("${spring.mqtt.url}") + @Value("${spring.mqtt.url}") private String hostUrl; /* @Value("${spring.mqtt.client.id}") diff --git a/hai-service/src/main/java/com/hai/dao/HighDeviceMapper.java b/hai-service/src/main/java/com/hai/dao/HighDeviceMapper.java new file mode 100644 index 00000000..e0bef313 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighDeviceMapper.java @@ -0,0 +1,155 @@ +package com.hai.dao; + +import com.hai.entity.HighDevice; +import com.hai.entity.HighDeviceExample; +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 HighDeviceMapper extends HighDeviceMapperExt { + @SelectProvider(type=HighDeviceSqlProvider.class, method="countByExample") + long countByExample(HighDeviceExample example); + + @DeleteProvider(type=HighDeviceSqlProvider.class, method="deleteByExample") + int deleteByExample(HighDeviceExample example); + + @Delete({ + "delete from high_device", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into high_device (`type`, company_id, ", + "company_name, mer_id, ", + "mer_name, mer_store_id, ", + "mer_store_name, device_name, ", + "device_sn, device_key, ", + "device_imei, device_iccid, ", + "`status`, create_time, ", + "update_time, ext_1, ", + "ext_2, ext_3)", + "values (#{type,jdbcType=INTEGER}, #{companyId,jdbcType=BIGINT}, ", + "#{companyName,jdbcType=VARCHAR}, #{merId,jdbcType=BIGINT}, ", + "#{merName,jdbcType=VARCHAR}, #{merStoreId,jdbcType=BIGINT}, ", + "#{merStoreName,jdbcType=VARCHAR}, #{deviceName,jdbcType=VARCHAR}, ", + "#{deviceSn,jdbcType=VARCHAR}, #{deviceKey,jdbcType=VARCHAR}, ", + "#{deviceImei,jdbcType=VARCHAR}, #{deviceIccid,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(HighDevice record); + + @InsertProvider(type=HighDeviceSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(HighDevice record); + + @SelectProvider(type=HighDeviceSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), + @Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT), + @Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_store_id", property="merStoreId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_store_name", property="merStoreName", jdbcType=JdbcType.VARCHAR), + @Result(column="device_name", property="deviceName", jdbcType=JdbcType.VARCHAR), + @Result(column="device_sn", property="deviceSn", jdbcType=JdbcType.VARCHAR), + @Result(column="device_key", property="deviceKey", jdbcType=JdbcType.VARCHAR), + @Result(column="device_imei", property="deviceImei", jdbcType=JdbcType.VARCHAR), + @Result(column="device_iccid", property="deviceIccid", 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(HighDeviceExample example); + + @Select({ + "select", + "id, `type`, company_id, company_name, mer_id, mer_name, mer_store_id, mer_store_name, ", + "device_name, device_sn, device_key, device_imei, device_iccid, `status`, create_time, ", + "update_time, ext_1, ext_2, ext_3", + "from high_device", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), + @Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT), + @Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_store_id", property="merStoreId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_store_name", property="merStoreName", jdbcType=JdbcType.VARCHAR), + @Result(column="device_name", property="deviceName", jdbcType=JdbcType.VARCHAR), + @Result(column="device_sn", property="deviceSn", jdbcType=JdbcType.VARCHAR), + @Result(column="device_key", property="deviceKey", jdbcType=JdbcType.VARCHAR), + @Result(column="device_imei", property="deviceImei", jdbcType=JdbcType.VARCHAR), + @Result(column="device_iccid", property="deviceIccid", 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) + }) + HighDevice selectByPrimaryKey(Long id); + + @UpdateProvider(type=HighDeviceSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") HighDevice record, @Param("example") HighDeviceExample example); + + @UpdateProvider(type=HighDeviceSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") HighDevice record, @Param("example") HighDeviceExample example); + + @UpdateProvider(type=HighDeviceSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(HighDevice record); + + @Update({ + "update high_device", + "set `type` = #{type,jdbcType=INTEGER},", + "company_id = #{companyId,jdbcType=BIGINT},", + "company_name = #{companyName,jdbcType=VARCHAR},", + "mer_id = #{merId,jdbcType=BIGINT},", + "mer_name = #{merName,jdbcType=VARCHAR},", + "mer_store_id = #{merStoreId,jdbcType=BIGINT},", + "mer_store_name = #{merStoreName,jdbcType=VARCHAR},", + "device_name = #{deviceName,jdbcType=VARCHAR},", + "device_sn = #{deviceSn,jdbcType=VARCHAR},", + "device_key = #{deviceKey,jdbcType=VARCHAR},", + "device_imei = #{deviceImei,jdbcType=VARCHAR},", + "device_iccid = #{deviceIccid,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(HighDevice record); +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighDeviceMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighDeviceMapperExt.java new file mode 100644 index 00000000..f3bc285c --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighDeviceMapperExt.java @@ -0,0 +1,7 @@ +package com.hai.dao; + +/** + * mapper扩展类 + */ +public interface HighDeviceMapperExt { +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighDeviceSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighDeviceSqlProvider.java new file mode 100644 index 00000000..5ab171a7 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighDeviceSqlProvider.java @@ -0,0 +1,430 @@ +package com.hai.dao; + +import com.hai.entity.HighDevice; +import com.hai.entity.HighDeviceExample.Criteria; +import com.hai.entity.HighDeviceExample.Criterion; +import com.hai.entity.HighDeviceExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class HighDeviceSqlProvider { + + public String countByExample(HighDeviceExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("high_device"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(HighDeviceExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("high_device"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(HighDevice record) { + SQL sql = new SQL(); + sql.INSERT_INTO("high_device"); + + if (record.getType() != null) { + sql.VALUES("`type`", "#{type,jdbcType=INTEGER}"); + } + + if (record.getCompanyId() != null) { + sql.VALUES("company_id", "#{companyId,jdbcType=BIGINT}"); + } + + if (record.getCompanyName() != null) { + sql.VALUES("company_name", "#{companyName,jdbcType=VARCHAR}"); + } + + if (record.getMerId() != null) { + sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}"); + } + + if (record.getMerName() != null) { + sql.VALUES("mer_name", "#{merName,jdbcType=VARCHAR}"); + } + + if (record.getMerStoreId() != null) { + sql.VALUES("mer_store_id", "#{merStoreId,jdbcType=BIGINT}"); + } + + if (record.getMerStoreName() != null) { + sql.VALUES("mer_store_name", "#{merStoreName,jdbcType=VARCHAR}"); + } + + if (record.getDeviceName() != null) { + sql.VALUES("device_name", "#{deviceName,jdbcType=VARCHAR}"); + } + + if (record.getDeviceSn() != null) { + sql.VALUES("device_sn", "#{deviceSn,jdbcType=VARCHAR}"); + } + + if (record.getDeviceKey() != null) { + sql.VALUES("device_key", "#{deviceKey,jdbcType=VARCHAR}"); + } + + if (record.getDeviceImei() != null) { + sql.VALUES("device_imei", "#{deviceImei,jdbcType=VARCHAR}"); + } + + if (record.getDeviceIccid() != null) { + sql.VALUES("device_iccid", "#{deviceIccid,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(HighDeviceExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("`type`"); + sql.SELECT("company_id"); + sql.SELECT("company_name"); + sql.SELECT("mer_id"); + sql.SELECT("mer_name"); + sql.SELECT("mer_store_id"); + sql.SELECT("mer_store_name"); + sql.SELECT("device_name"); + sql.SELECT("device_sn"); + sql.SELECT("device_key"); + sql.SELECT("device_imei"); + sql.SELECT("device_iccid"); + 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_device"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + HighDevice record = (HighDevice) parameter.get("record"); + HighDeviceExample example = (HighDeviceExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("high_device"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getType() != null) { + sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); + } + + if (record.getCompanyId() != null) { + sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}"); + } + + if (record.getCompanyName() != null) { + sql.SET("company_name = #{record.companyName,jdbcType=VARCHAR}"); + } + + if (record.getMerId() != null) { + sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); + } + + if (record.getMerName() != null) { + sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); + } + + if (record.getMerStoreId() != null) { + sql.SET("mer_store_id = #{record.merStoreId,jdbcType=BIGINT}"); + } + + if (record.getMerStoreName() != null) { + sql.SET("mer_store_name = #{record.merStoreName,jdbcType=VARCHAR}"); + } + + if (record.getDeviceName() != null) { + sql.SET("device_name = #{record.deviceName,jdbcType=VARCHAR}"); + } + + if (record.getDeviceSn() != null) { + sql.SET("device_sn = #{record.deviceSn,jdbcType=VARCHAR}"); + } + + if (record.getDeviceKey() != null) { + sql.SET("device_key = #{record.deviceKey,jdbcType=VARCHAR}"); + } + + if (record.getDeviceImei() != null) { + sql.SET("device_imei = #{record.deviceImei,jdbcType=VARCHAR}"); + } + + if (record.getDeviceIccid() != null) { + sql.SET("device_iccid = #{record.deviceIccid,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_device"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); + sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}"); + sql.SET("company_name = #{record.companyName,jdbcType=VARCHAR}"); + sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); + sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); + sql.SET("mer_store_id = #{record.merStoreId,jdbcType=BIGINT}"); + sql.SET("mer_store_name = #{record.merStoreName,jdbcType=VARCHAR}"); + sql.SET("device_name = #{record.deviceName,jdbcType=VARCHAR}"); + sql.SET("device_sn = #{record.deviceSn,jdbcType=VARCHAR}"); + sql.SET("device_key = #{record.deviceKey,jdbcType=VARCHAR}"); + sql.SET("device_imei = #{record.deviceImei,jdbcType=VARCHAR}"); + sql.SET("device_iccid = #{record.deviceIccid,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}"); + + HighDeviceExample example = (HighDeviceExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(HighDevice record) { + SQL sql = new SQL(); + sql.UPDATE("high_device"); + + if (record.getType() != null) { + sql.SET("`type` = #{type,jdbcType=INTEGER}"); + } + + if (record.getCompanyId() != null) { + sql.SET("company_id = #{companyId,jdbcType=BIGINT}"); + } + + if (record.getCompanyName() != null) { + sql.SET("company_name = #{companyName,jdbcType=VARCHAR}"); + } + + if (record.getMerId() != null) { + sql.SET("mer_id = #{merId,jdbcType=BIGINT}"); + } + + if (record.getMerName() != null) { + sql.SET("mer_name = #{merName,jdbcType=VARCHAR}"); + } + + if (record.getMerStoreId() != null) { + sql.SET("mer_store_id = #{merStoreId,jdbcType=BIGINT}"); + } + + if (record.getMerStoreName() != null) { + sql.SET("mer_store_name = #{merStoreName,jdbcType=VARCHAR}"); + } + + if (record.getDeviceName() != null) { + sql.SET("device_name = #{deviceName,jdbcType=VARCHAR}"); + } + + if (record.getDeviceSn() != null) { + sql.SET("device_sn = #{deviceSn,jdbcType=VARCHAR}"); + } + + if (record.getDeviceKey() != null) { + sql.SET("device_key = #{deviceKey,jdbcType=VARCHAR}"); + } + + if (record.getDeviceImei() != null) { + sql.SET("device_imei = #{deviceImei,jdbcType=VARCHAR}"); + } + + if (record.getDeviceIccid() != null) { + sql.SET("device_iccid = #{deviceIccid,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, HighDeviceExample 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/HighDevice.java b/hai-service/src/main/java/com/hai/entity/HighDevice.java new file mode 100644 index 00000000..6b681185 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighDevice.java @@ -0,0 +1,344 @@ +package com.hai.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * high_device + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class HighDevice implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 设备类型 1. 商鹏4G 2. 4G打印机 + */ + private Integer type; + + /** + * 公司id + */ + private Long companyId; + + /** + * 公司名称 + */ + private String companyName; + + /** + * 商户id + */ + private Long merId; + + /** + * 商户名称 + */ + private String merName; + + /** + * 门店id + */ + private Long merStoreId; + + /** + * 门店名称 + */ + private String merStoreName; + + /** + * 设备名称 + */ + private String deviceName; + + /** + * 设备SN编号 + */ + private String deviceSn; + + /** + * 设备KEY编号 + */ + private String deviceKey; + + /** + * 设备IMEI + */ + private String deviceImei; + + /** + * 设备ICCID + */ + private String deviceIccid; + + /** + * 状态: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 Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public Long getCompanyId() { + return companyId; + } + + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + public String getCompanyName() { + return companyName; + } + + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + public Long getMerId() { + return merId; + } + + public void setMerId(Long merId) { + this.merId = merId; + } + + public String getMerName() { + return merName; + } + + public void setMerName(String merName) { + this.merName = merName; + } + + public Long getMerStoreId() { + return merStoreId; + } + + public void setMerStoreId(Long merStoreId) { + this.merStoreId = merStoreId; + } + + public String getMerStoreName() { + return merStoreName; + } + + public void setMerStoreName(String merStoreName) { + this.merStoreName = merStoreName; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getDeviceSn() { + return deviceSn; + } + + public void setDeviceSn(String deviceSn) { + this.deviceSn = deviceSn; + } + + public String getDeviceKey() { + return deviceKey; + } + + public void setDeviceKey(String deviceKey) { + this.deviceKey = deviceKey; + } + + public String getDeviceImei() { + return deviceImei; + } + + public void setDeviceImei(String deviceImei) { + this.deviceImei = deviceImei; + } + + public String getDeviceIccid() { + return deviceIccid; + } + + public void setDeviceIccid(String deviceIccid) { + this.deviceIccid = deviceIccid; + } + + 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; + } + HighDevice other = (HighDevice) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) + && (this.getCompanyId() == null ? other.getCompanyId() == null : this.getCompanyId().equals(other.getCompanyId())) + && (this.getCompanyName() == null ? other.getCompanyName() == null : this.getCompanyName().equals(other.getCompanyName())) + && (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId())) + && (this.getMerName() == null ? other.getMerName() == null : this.getMerName().equals(other.getMerName())) + && (this.getMerStoreId() == null ? other.getMerStoreId() == null : this.getMerStoreId().equals(other.getMerStoreId())) + && (this.getMerStoreName() == null ? other.getMerStoreName() == null : this.getMerStoreName().equals(other.getMerStoreName())) + && (this.getDeviceName() == null ? other.getDeviceName() == null : this.getDeviceName().equals(other.getDeviceName())) + && (this.getDeviceSn() == null ? other.getDeviceSn() == null : this.getDeviceSn().equals(other.getDeviceSn())) + && (this.getDeviceKey() == null ? other.getDeviceKey() == null : this.getDeviceKey().equals(other.getDeviceKey())) + && (this.getDeviceImei() == null ? other.getDeviceImei() == null : this.getDeviceImei().equals(other.getDeviceImei())) + && (this.getDeviceIccid() == null ? other.getDeviceIccid() == null : this.getDeviceIccid().equals(other.getDeviceIccid())) + && (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 + ((getType() == null) ? 0 : getType().hashCode()); + result = prime * result + ((getCompanyId() == null) ? 0 : getCompanyId().hashCode()); + result = prime * result + ((getCompanyName() == null) ? 0 : getCompanyName().hashCode()); + result = prime * result + ((getMerId() == null) ? 0 : getMerId().hashCode()); + result = prime * result + ((getMerName() == null) ? 0 : getMerName().hashCode()); + result = prime * result + ((getMerStoreId() == null) ? 0 : getMerStoreId().hashCode()); + result = prime * result + ((getMerStoreName() == null) ? 0 : getMerStoreName().hashCode()); + result = prime * result + ((getDeviceName() == null) ? 0 : getDeviceName().hashCode()); + result = prime * result + ((getDeviceSn() == null) ? 0 : getDeviceSn().hashCode()); + result = prime * result + ((getDeviceKey() == null) ? 0 : getDeviceKey().hashCode()); + result = prime * result + ((getDeviceImei() == null) ? 0 : getDeviceImei().hashCode()); + result = prime * result + ((getDeviceIccid() == null) ? 0 : getDeviceIccid().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(", type=").append(type); + sb.append(", companyId=").append(companyId); + sb.append(", companyName=").append(companyName); + sb.append(", merId=").append(merId); + sb.append(", merName=").append(merName); + sb.append(", merStoreId=").append(merStoreId); + sb.append(", merStoreName=").append(merStoreName); + sb.append(", deviceName=").append(deviceName); + sb.append(", deviceSn=").append(deviceSn); + sb.append(", deviceKey=").append(deviceKey); + sb.append(", deviceImei=").append(deviceImei); + sb.append(", deviceIccid=").append(deviceIccid); + 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/HighDeviceExample.java b/hai-service/src/main/java/com/hai/entity/HighDeviceExample.java new file mode 100644 index 00000000..0c510035 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighDeviceExample.java @@ -0,0 +1,1473 @@ +package com.hai.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class HighDeviceExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public HighDeviceExample() { + 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 andTypeIsNull() { + addCriterion("`type` is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("`type` is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(Integer value) { + addCriterion("`type` =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(Integer value) { + addCriterion("`type` <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(Integer value) { + addCriterion("`type` >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("`type` >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(Integer value) { + addCriterion("`type` <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(Integer value) { + addCriterion("`type` <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("`type` in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("`type` not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(Integer value1, Integer value2) { + addCriterion("`type` between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(Integer value1, Integer value2) { + addCriterion("`type` not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNull() { + addCriterion("company_id is null"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNotNull() { + addCriterion("company_id is not null"); + return (Criteria) this; + } + + public Criteria andCompanyIdEqualTo(Long value) { + addCriterion("company_id =", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotEqualTo(Long value) { + addCriterion("company_id <>", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThan(Long value) { + addCriterion("company_id >", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThanOrEqualTo(Long value) { + addCriterion("company_id >=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThan(Long value) { + addCriterion("company_id <", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThanOrEqualTo(Long value) { + addCriterion("company_id <=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdIn(List values) { + addCriterion("company_id in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotIn(List values) { + addCriterion("company_id not in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdBetween(Long value1, Long value2) { + addCriterion("company_id between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotBetween(Long value1, Long value2) { + addCriterion("company_id not between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyNameIsNull() { + addCriterion("company_name is null"); + return (Criteria) this; + } + + public Criteria andCompanyNameIsNotNull() { + addCriterion("company_name is not null"); + return (Criteria) this; + } + + public Criteria andCompanyNameEqualTo(String value) { + addCriterion("company_name =", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotEqualTo(String value) { + addCriterion("company_name <>", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameGreaterThan(String value) { + addCriterion("company_name >", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameGreaterThanOrEqualTo(String value) { + addCriterion("company_name >=", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameLessThan(String value) { + addCriterion("company_name <", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameLessThanOrEqualTo(String value) { + addCriterion("company_name <=", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameLike(String value) { + addCriterion("company_name like", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotLike(String value) { + addCriterion("company_name not like", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameIn(List values) { + addCriterion("company_name in", values, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotIn(List values) { + addCriterion("company_name not in", values, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameBetween(String value1, String value2) { + addCriterion("company_name between", value1, value2, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotBetween(String value1, String value2) { + addCriterion("company_name not between", value1, value2, "companyName"); + return (Criteria) this; + } + + public Criteria andMerIdIsNull() { + addCriterion("mer_id is null"); + return (Criteria) this; + } + + public Criteria andMerIdIsNotNull() { + addCriterion("mer_id is not null"); + return (Criteria) this; + } + + public Criteria andMerIdEqualTo(Long value) { + addCriterion("mer_id =", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotEqualTo(Long value) { + addCriterion("mer_id <>", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdGreaterThan(Long value) { + addCriterion("mer_id >", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdGreaterThanOrEqualTo(Long value) { + addCriterion("mer_id >=", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdLessThan(Long value) { + addCriterion("mer_id <", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdLessThanOrEqualTo(Long value) { + addCriterion("mer_id <=", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdIn(List values) { + addCriterion("mer_id in", values, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotIn(List values) { + addCriterion("mer_id not in", values, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdBetween(Long value1, Long value2) { + addCriterion("mer_id between", value1, value2, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotBetween(Long value1, Long value2) { + addCriterion("mer_id not between", value1, value2, "merId"); + return (Criteria) this; + } + + public Criteria andMerNameIsNull() { + addCriterion("mer_name is null"); + return (Criteria) this; + } + + public Criteria andMerNameIsNotNull() { + addCriterion("mer_name is not null"); + return (Criteria) this; + } + + public Criteria andMerNameEqualTo(String value) { + addCriterion("mer_name =", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotEqualTo(String value) { + addCriterion("mer_name <>", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameGreaterThan(String value) { + addCriterion("mer_name >", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameGreaterThanOrEqualTo(String value) { + addCriterion("mer_name >=", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLessThan(String value) { + addCriterion("mer_name <", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLessThanOrEqualTo(String value) { + addCriterion("mer_name <=", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLike(String value) { + addCriterion("mer_name like", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotLike(String value) { + addCriterion("mer_name not like", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameIn(List values) { + addCriterion("mer_name in", values, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotIn(List values) { + addCriterion("mer_name not in", values, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameBetween(String value1, String value2) { + addCriterion("mer_name between", value1, value2, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotBetween(String value1, String value2) { + addCriterion("mer_name not between", value1, value2, "merName"); + return (Criteria) this; + } + + public Criteria andMerStoreIdIsNull() { + addCriterion("mer_store_id is null"); + return (Criteria) this; + } + + public Criteria andMerStoreIdIsNotNull() { + addCriterion("mer_store_id is not null"); + return (Criteria) this; + } + + public Criteria andMerStoreIdEqualTo(Long value) { + addCriterion("mer_store_id =", value, "merStoreId"); + return (Criteria) this; + } + + public Criteria andMerStoreIdNotEqualTo(Long value) { + addCriterion("mer_store_id <>", value, "merStoreId"); + return (Criteria) this; + } + + public Criteria andMerStoreIdGreaterThan(Long value) { + addCriterion("mer_store_id >", value, "merStoreId"); + return (Criteria) this; + } + + public Criteria andMerStoreIdGreaterThanOrEqualTo(Long value) { + addCriterion("mer_store_id >=", value, "merStoreId"); + return (Criteria) this; + } + + public Criteria andMerStoreIdLessThan(Long value) { + addCriterion("mer_store_id <", value, "merStoreId"); + return (Criteria) this; + } + + public Criteria andMerStoreIdLessThanOrEqualTo(Long value) { + addCriterion("mer_store_id <=", value, "merStoreId"); + return (Criteria) this; + } + + public Criteria andMerStoreIdIn(List values) { + addCriterion("mer_store_id in", values, "merStoreId"); + return (Criteria) this; + } + + public Criteria andMerStoreIdNotIn(List values) { + addCriterion("mer_store_id not in", values, "merStoreId"); + return (Criteria) this; + } + + public Criteria andMerStoreIdBetween(Long value1, Long value2) { + addCriterion("mer_store_id between", value1, value2, "merStoreId"); + return (Criteria) this; + } + + public Criteria andMerStoreIdNotBetween(Long value1, Long value2) { + addCriterion("mer_store_id not between", value1, value2, "merStoreId"); + return (Criteria) this; + } + + public Criteria andMerStoreNameIsNull() { + addCriterion("mer_store_name is null"); + return (Criteria) this; + } + + public Criteria andMerStoreNameIsNotNull() { + addCriterion("mer_store_name is not null"); + return (Criteria) this; + } + + public Criteria andMerStoreNameEqualTo(String value) { + addCriterion("mer_store_name =", value, "merStoreName"); + return (Criteria) this; + } + + public Criteria andMerStoreNameNotEqualTo(String value) { + addCriterion("mer_store_name <>", value, "merStoreName"); + return (Criteria) this; + } + + public Criteria andMerStoreNameGreaterThan(String value) { + addCriterion("mer_store_name >", value, "merStoreName"); + return (Criteria) this; + } + + public Criteria andMerStoreNameGreaterThanOrEqualTo(String value) { + addCriterion("mer_store_name >=", value, "merStoreName"); + return (Criteria) this; + } + + public Criteria andMerStoreNameLessThan(String value) { + addCriterion("mer_store_name <", value, "merStoreName"); + return (Criteria) this; + } + + public Criteria andMerStoreNameLessThanOrEqualTo(String value) { + addCriterion("mer_store_name <=", value, "merStoreName"); + return (Criteria) this; + } + + public Criteria andMerStoreNameLike(String value) { + addCriterion("mer_store_name like", value, "merStoreName"); + return (Criteria) this; + } + + public Criteria andMerStoreNameNotLike(String value) { + addCriterion("mer_store_name not like", value, "merStoreName"); + return (Criteria) this; + } + + public Criteria andMerStoreNameIn(List values) { + addCriterion("mer_store_name in", values, "merStoreName"); + return (Criteria) this; + } + + public Criteria andMerStoreNameNotIn(List values) { + addCriterion("mer_store_name not in", values, "merStoreName"); + return (Criteria) this; + } + + public Criteria andMerStoreNameBetween(String value1, String value2) { + addCriterion("mer_store_name between", value1, value2, "merStoreName"); + return (Criteria) this; + } + + public Criteria andMerStoreNameNotBetween(String value1, String value2) { + addCriterion("mer_store_name not between", value1, value2, "merStoreName"); + return (Criteria) this; + } + + public Criteria andDeviceNameIsNull() { + addCriterion("device_name is null"); + return (Criteria) this; + } + + public Criteria andDeviceNameIsNotNull() { + addCriterion("device_name is not null"); + return (Criteria) this; + } + + public Criteria andDeviceNameEqualTo(String value) { + addCriterion("device_name =", value, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceNameNotEqualTo(String value) { + addCriterion("device_name <>", value, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceNameGreaterThan(String value) { + addCriterion("device_name >", value, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceNameGreaterThanOrEqualTo(String value) { + addCriterion("device_name >=", value, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceNameLessThan(String value) { + addCriterion("device_name <", value, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceNameLessThanOrEqualTo(String value) { + addCriterion("device_name <=", value, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceNameLike(String value) { + addCriterion("device_name like", value, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceNameNotLike(String value) { + addCriterion("device_name not like", value, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceNameIn(List values) { + addCriterion("device_name in", values, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceNameNotIn(List values) { + addCriterion("device_name not in", values, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceNameBetween(String value1, String value2) { + addCriterion("device_name between", value1, value2, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceNameNotBetween(String value1, String value2) { + addCriterion("device_name not between", value1, value2, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceSnIsNull() { + addCriterion("device_sn is null"); + return (Criteria) this; + } + + public Criteria andDeviceSnIsNotNull() { + addCriterion("device_sn is not null"); + return (Criteria) this; + } + + public Criteria andDeviceSnEqualTo(String value) { + addCriterion("device_sn =", value, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceSnNotEqualTo(String value) { + addCriterion("device_sn <>", value, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceSnGreaterThan(String value) { + addCriterion("device_sn >", value, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceSnGreaterThanOrEqualTo(String value) { + addCriterion("device_sn >=", value, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceSnLessThan(String value) { + addCriterion("device_sn <", value, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceSnLessThanOrEqualTo(String value) { + addCriterion("device_sn <=", value, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceSnLike(String value) { + addCriterion("device_sn like", value, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceSnNotLike(String value) { + addCriterion("device_sn not like", value, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceSnIn(List values) { + addCriterion("device_sn in", values, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceSnNotIn(List values) { + addCriterion("device_sn not in", values, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceSnBetween(String value1, String value2) { + addCriterion("device_sn between", value1, value2, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceSnNotBetween(String value1, String value2) { + addCriterion("device_sn not between", value1, value2, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceKeyIsNull() { + addCriterion("device_key is null"); + return (Criteria) this; + } + + public Criteria andDeviceKeyIsNotNull() { + addCriterion("device_key is not null"); + return (Criteria) this; + } + + public Criteria andDeviceKeyEqualTo(String value) { + addCriterion("device_key =", value, "deviceKey"); + return (Criteria) this; + } + + public Criteria andDeviceKeyNotEqualTo(String value) { + addCriterion("device_key <>", value, "deviceKey"); + return (Criteria) this; + } + + public Criteria andDeviceKeyGreaterThan(String value) { + addCriterion("device_key >", value, "deviceKey"); + return (Criteria) this; + } + + public Criteria andDeviceKeyGreaterThanOrEqualTo(String value) { + addCriterion("device_key >=", value, "deviceKey"); + return (Criteria) this; + } + + public Criteria andDeviceKeyLessThan(String value) { + addCriterion("device_key <", value, "deviceKey"); + return (Criteria) this; + } + + public Criteria andDeviceKeyLessThanOrEqualTo(String value) { + addCriterion("device_key <=", value, "deviceKey"); + return (Criteria) this; + } + + public Criteria andDeviceKeyLike(String value) { + addCriterion("device_key like", value, "deviceKey"); + return (Criteria) this; + } + + public Criteria andDeviceKeyNotLike(String value) { + addCriterion("device_key not like", value, "deviceKey"); + return (Criteria) this; + } + + public Criteria andDeviceKeyIn(List values) { + addCriterion("device_key in", values, "deviceKey"); + return (Criteria) this; + } + + public Criteria andDeviceKeyNotIn(List values) { + addCriterion("device_key not in", values, "deviceKey"); + return (Criteria) this; + } + + public Criteria andDeviceKeyBetween(String value1, String value2) { + addCriterion("device_key between", value1, value2, "deviceKey"); + return (Criteria) this; + } + + public Criteria andDeviceKeyNotBetween(String value1, String value2) { + addCriterion("device_key not between", value1, value2, "deviceKey"); + return (Criteria) this; + } + + public Criteria andDeviceImeiIsNull() { + addCriterion("device_imei is null"); + return (Criteria) this; + } + + public Criteria andDeviceImeiIsNotNull() { + addCriterion("device_imei is not null"); + return (Criteria) this; + } + + public Criteria andDeviceImeiEqualTo(String value) { + addCriterion("device_imei =", value, "deviceImei"); + return (Criteria) this; + } + + public Criteria andDeviceImeiNotEqualTo(String value) { + addCriterion("device_imei <>", value, "deviceImei"); + return (Criteria) this; + } + + public Criteria andDeviceImeiGreaterThan(String value) { + addCriterion("device_imei >", value, "deviceImei"); + return (Criteria) this; + } + + public Criteria andDeviceImeiGreaterThanOrEqualTo(String value) { + addCriterion("device_imei >=", value, "deviceImei"); + return (Criteria) this; + } + + public Criteria andDeviceImeiLessThan(String value) { + addCriterion("device_imei <", value, "deviceImei"); + return (Criteria) this; + } + + public Criteria andDeviceImeiLessThanOrEqualTo(String value) { + addCriterion("device_imei <=", value, "deviceImei"); + return (Criteria) this; + } + + public Criteria andDeviceImeiLike(String value) { + addCriterion("device_imei like", value, "deviceImei"); + return (Criteria) this; + } + + public Criteria andDeviceImeiNotLike(String value) { + addCriterion("device_imei not like", value, "deviceImei"); + return (Criteria) this; + } + + public Criteria andDeviceImeiIn(List values) { + addCriterion("device_imei in", values, "deviceImei"); + return (Criteria) this; + } + + public Criteria andDeviceImeiNotIn(List values) { + addCriterion("device_imei not in", values, "deviceImei"); + return (Criteria) this; + } + + public Criteria andDeviceImeiBetween(String value1, String value2) { + addCriterion("device_imei between", value1, value2, "deviceImei"); + return (Criteria) this; + } + + public Criteria andDeviceImeiNotBetween(String value1, String value2) { + addCriterion("device_imei not between", value1, value2, "deviceImei"); + return (Criteria) this; + } + + public Criteria andDeviceIccidIsNull() { + addCriterion("device_iccid is null"); + return (Criteria) this; + } + + public Criteria andDeviceIccidIsNotNull() { + addCriterion("device_iccid is not null"); + return (Criteria) this; + } + + public Criteria andDeviceIccidEqualTo(String value) { + addCriterion("device_iccid =", value, "deviceIccid"); + return (Criteria) this; + } + + public Criteria andDeviceIccidNotEqualTo(String value) { + addCriterion("device_iccid <>", value, "deviceIccid"); + return (Criteria) this; + } + + public Criteria andDeviceIccidGreaterThan(String value) { + addCriterion("device_iccid >", value, "deviceIccid"); + return (Criteria) this; + } + + public Criteria andDeviceIccidGreaterThanOrEqualTo(String value) { + addCriterion("device_iccid >=", value, "deviceIccid"); + return (Criteria) this; + } + + public Criteria andDeviceIccidLessThan(String value) { + addCriterion("device_iccid <", value, "deviceIccid"); + return (Criteria) this; + } + + public Criteria andDeviceIccidLessThanOrEqualTo(String value) { + addCriterion("device_iccid <=", value, "deviceIccid"); + return (Criteria) this; + } + + public Criteria andDeviceIccidLike(String value) { + addCriterion("device_iccid like", value, "deviceIccid"); + return (Criteria) this; + } + + public Criteria andDeviceIccidNotLike(String value) { + addCriterion("device_iccid not like", value, "deviceIccid"); + return (Criteria) this; + } + + public Criteria andDeviceIccidIn(List values) { + addCriterion("device_iccid in", values, "deviceIccid"); + return (Criteria) this; + } + + public Criteria andDeviceIccidNotIn(List values) { + addCriterion("device_iccid not in", values, "deviceIccid"); + return (Criteria) this; + } + + public Criteria andDeviceIccidBetween(String value1, String value2) { + addCriterion("device_iccid between", value1, value2, "deviceIccid"); + return (Criteria) this; + } + + public Criteria andDeviceIccidNotBetween(String value1, String value2) { + addCriterion("device_iccid not between", value1, value2, "deviceIccid"); + 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/DeviceTypeEnum.java b/hai-service/src/main/java/com/hai/enum_type/DeviceTypeEnum.java new file mode 100644 index 00000000..e80beea9 --- /dev/null +++ b/hai-service/src/main/java/com/hai/enum_type/DeviceTypeEnum.java @@ -0,0 +1,44 @@ +package com.hai.enum_type; + +import java.util.Objects; + +/** + * 设备类型 + * @author hurui + */ +public enum DeviceTypeEnum { + type1(0 , "商鹏-4G"), + type2(1, "ZKC-4G"), + ; + + private Integer type; + private String name; + + DeviceTypeEnum(int type , String name) { + this.type = type; + this.name = name; + } + + public static String getNameByType(Integer type) { + for (DeviceTypeEnum ele : values()) { + if(Objects.equals(type,ele.getType())) return ele.getName(); + } + return null; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/hai-service/src/main/java/com/hai/service/HighDeviceService.java b/hai-service/src/main/java/com/hai/service/HighDeviceService.java new file mode 100644 index 00000000..72521ad7 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/HighDeviceService.java @@ -0,0 +1,35 @@ +package com.hai.service; + +import com.hai.entity.HighDevice; + +import java.util.List; +import java.util.Map; + +/** + * 设备管理 + * @author hurui + */ +public interface HighDeviceService { + + /** + * 编辑设备 + * @param device + */ + void editDevice(HighDevice device); + + /** + * 查询设备详情 + * @param deviceId + * @return + */ + HighDevice getDetailById(Long deviceId); + + /** + * 查询设备列表 + * @param param + * @return + */ + List getDeviceList(Map param); + + +} diff --git a/hai-service/src/main/java/com/hai/service/impl/HighDeviceServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighDeviceServiceImpl.java new file mode 100644 index 00000000..28dbdf92 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/impl/HighDeviceServiceImpl.java @@ -0,0 +1,68 @@ +package com.hai.service.impl; + +import com.hai.dao.HighDeviceMapper; +import com.hai.entity.HighDevice; +import com.hai.entity.HighDeviceExample; +import com.hai.service.HighDeviceService; +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("deviceService") +public class HighDeviceServiceImpl implements HighDeviceService { + + @Resource + private HighDeviceMapper deviceMapper; + + @Override + public void editDevice(HighDevice device) { + if (device.getId() != null) { + device.setCreateTime(new Date()); + device.setUpdateTime(new Date()); + device.setStatus(1); + deviceMapper.insert(device); + } else { + device.setUpdateTime(new Date()); + deviceMapper.updateByPrimaryKey(device); + } + } + + @Override + public HighDevice getDetailById(Long deviceId) { + return deviceMapper.selectByPrimaryKey(deviceId); + } + + @Override + public List getDeviceList(Map param) { + HighDeviceExample example = new HighDeviceExample(); + HighDeviceExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(0); + + if (MapUtils.getInteger(param, "type") != null) { + criteria.andTypeEqualTo(MapUtils.getInteger(param, "type")); + } + + if (MapUtils.getLong(param, "companyId") != null) { + criteria.andCompanyIdEqualTo(MapUtils.getLong(param, "type")); + } + + if (MapUtils.getLong(param, "merId") != null) { + criteria.andMerIdEqualTo(MapUtils.getLong(param, "merId")); + } + + if (MapUtils.getLong(param, "merStoreId") != null) { + criteria.andMerStoreIdEqualTo(MapUtils.getLong(param, "merStoreId")); + } + + if (StringUtils.isNotBlank(MapUtils.getString(param, "deviceName"))) { + criteria.andDeviceNameLike("%" + MapUtils.getString(param, "deviceName") + "%"); + } + + example.setOrderByClause("create_time desc"); + return deviceMapper.selectByExample(example); + } +}