From 3c6b23d49a26e5d2c56fdab7a4bb3d67fcdfcb80 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Thu, 25 Apr 2024 10:22:42 +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 --- .../main/java/com/bweb/config/AuthConfig.java | 1 + .../com/bweb/controller/BsMerController.java | 132 ++ .../com/bweb/controller/CommonController.java | 35 +- .../bweb/controller/SecUserController.java | 4 + .../com/hfkj/common/utils/IdCardUtil.java | 99 -- .../com/hfkj/common/utils/RandomUtils.java | 31 + .../main/java/com/hfkj/dao/BsMerMapper.java | 133 ++ .../java/com/hfkj/dao/BsMerMapperExt.java | 7 + .../java/com/hfkj/dao/BsMerSqlProvider.java | 360 +++++ .../main/java/com/hfkj/dao/SecUserMapper.java | 13 +- .../java/com/hfkj/dao/SecUserSqlProvider.java | 14 + .../src/main/java/com/hfkj/entity/BsMer.java | 264 ++++ .../java/com/hfkj/entity/BsMerExample.java | 1163 +++++++++++++++++ .../main/java/com/hfkj/entity/SecUser.java | 16 + .../java/com/hfkj/entity/SecUserExample.java | 60 + .../main/java/com/hfkj/model/BsMerModel.java | 25 + .../java/com/hfkj/service/BsMerService.java | 49 + .../hfkj/service/SecDictionaryService.java | 37 + .../java/com/hfkj/service/SecUserService.java | 9 + .../hfkj/service/impl/BsMerServiceImpl.java | 160 +++ .../impl/SecDictionaryServiceImpl.java | 59 + .../hfkj/service/impl/SecUserServiceImpl.java | 19 + .../java/com/hfkj/sysenum/MerStatusEnum.java | 47 + .../hfkj/sysenum/SecUserObjectTypeEnum.java | 47 + 24 files changed, 2679 insertions(+), 105 deletions(-) create mode 100644 bweb/src/main/java/com/bweb/controller/BsMerController.java delete mode 100644 service/src/main/java/com/hfkj/common/utils/IdCardUtil.java create mode 100644 service/src/main/java/com/hfkj/common/utils/RandomUtils.java create mode 100644 service/src/main/java/com/hfkj/dao/BsMerMapper.java create mode 100644 service/src/main/java/com/hfkj/dao/BsMerMapperExt.java create mode 100644 service/src/main/java/com/hfkj/dao/BsMerSqlProvider.java create mode 100644 service/src/main/java/com/hfkj/entity/BsMer.java create mode 100644 service/src/main/java/com/hfkj/entity/BsMerExample.java create mode 100644 service/src/main/java/com/hfkj/model/BsMerModel.java create mode 100644 service/src/main/java/com/hfkj/service/BsMerService.java create mode 100644 service/src/main/java/com/hfkj/service/SecDictionaryService.java create mode 100644 service/src/main/java/com/hfkj/service/impl/BsMerServiceImpl.java create mode 100644 service/src/main/java/com/hfkj/service/impl/SecDictionaryServiceImpl.java create mode 100644 service/src/main/java/com/hfkj/sysenum/MerStatusEnum.java create mode 100644 service/src/main/java/com/hfkj/sysenum/SecUserObjectTypeEnum.java diff --git a/bweb/src/main/java/com/bweb/config/AuthConfig.java b/bweb/src/main/java/com/bweb/config/AuthConfig.java index 95747fb..bebc107 100644 --- a/bweb/src/main/java/com/bweb/config/AuthConfig.java +++ b/bweb/src/main/java/com/bweb/config/AuthConfig.java @@ -87,6 +87,7 @@ public class AuthConfig implements WebMvcConfigurer { .excludePathPatterns("/**/springfox-swagger-ui/**") .excludePathPatterns("/**/swagger-ui.html") .excludePathPatterns("/secMenu/queryMenuList") + .excludePathPatterns("/common/*") ; } diff --git a/bweb/src/main/java/com/bweb/controller/BsMerController.java b/bweb/src/main/java/com/bweb/controller/BsMerController.java new file mode 100644 index 0000000..90ae512 --- /dev/null +++ b/bweb/src/main/java/com/bweb/controller/BsMerController.java @@ -0,0 +1,132 @@ +package com.bweb.controller; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.model.BsMerModel; +import com.hfkj.model.ResponseData; +import com.hfkj.service.BsMerService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.Map; + +/** + * @className: BsMerController + * @author: HuRui + * @date: 2024/4/24 + **/ +@Controller +@RequestMapping(value="/mer") +@Api(value="商户业务") +public class BsMerController { + Logger log = LoggerFactory.getLogger(BsMerController.class); + @Resource + private BsMerService merService; + + @RequestMapping(value="/create",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "创建商户") + public ResponseData create(@RequestBody BsMerModel body) { + try { + if (body == null + || StringUtils.isBlank(body.getLoginName()) + || body.getRoleId() == null + || StringUtils.isBlank(body.getMerName()) + || StringUtils.isBlank(body.getDirectorName()) + || StringUtils.isBlank(body.getDirectorTel()) + || StringUtils.isBlank(body.getAddress()) + ) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + merService.create(body); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/update",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "修改商户") + public ResponseData update(@RequestBody BsMerModel body) { + try { + if (body == null + || StringUtils.isBlank(body.getMerNo()) + || body.getRoleId() == null + || StringUtils.isBlank(body.getMerName()) + || StringUtils.isBlank(body.getDirectorName()) + || StringUtils.isBlank(body.getDirectorTel()) + || StringUtils.isBlank(body.getAddress()) + ) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + // 查询商户 + if (merService.getDetail(body.getMerNo()) == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "商户不存在"); + } + + merService.update(body); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/queryMer",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询商户") + public ResponseData queryMer(@RequestParam(value = "merNo" , required = true) String merNo) { + try { + + return ResponseMsgUtil.success(merService.getDetail(merNo)); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/queryList",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询商户列表") + public ResponseData queryList(@RequestParam(value = "merNo" , required = false) String merNo, + @RequestParam(value = "merName" , required = false) String merName, + @RequestParam(value = "status" , required = false) Integer status, + @RequestParam(value = "pageNum" , required = true) Integer pageNum, + @RequestParam(value = "pageSize" , required = true) Integer pageSize) { + try { + Map param = new HashMap<>(); + param.put("merNo", merNo); + param.put("merName", merName); + param.put("status", status); + + PageHelper.startPage(pageNum, pageSize); + return ResponseMsgUtil.success(new PageInfo<>(merService.getList(param))); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + +} diff --git a/bweb/src/main/java/com/bweb/controller/CommonController.java b/bweb/src/main/java/com/bweb/controller/CommonController.java index fabbb4f..937b7b8 100644 --- a/bweb/src/main/java/com/bweb/controller/CommonController.java +++ b/bweb/src/main/java/com/bweb/controller/CommonController.java @@ -1,18 +1,49 @@ package com.bweb.controller; +import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.model.ResponseData; +import com.hfkj.service.SecDictionaryService; 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; -@RestController +@Controller @RequestMapping(value="/common") @Api(value="共用接口") public class CommonController { - Logger log = LoggerFactory.getLogger(CommonController.class); + @Resource + private SecDictionaryService secDictionaryService; + + @RequestMapping(value="/queryDictionary",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询数据字典") + public ResponseData queryDictionary(@RequestParam(value = "codeType" , required = false) String codeType, + @RequestParam(value = "codeValue" , required = false) String codeValue) { + try { + + if (StringUtils.isBlank(codeType) && StringUtils.isBlank(codeValue)) { + return ResponseMsgUtil.success(secDictionaryService.getDictionary()); + + } else if (StringUtils.isNotBlank(codeType) && StringUtils.isNotBlank(codeValue)) { + return ResponseMsgUtil.success(secDictionaryService.getDictionary(codeType, codeValue)); + + } else if (StringUtils.isNotBlank(codeType)) { + return ResponseMsgUtil.success(secDictionaryService.getDictionary(codeType)); + } + return ResponseMsgUtil.success(null); + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } } diff --git a/bweb/src/main/java/com/bweb/controller/SecUserController.java b/bweb/src/main/java/com/bweb/controller/SecUserController.java index b423d84..66f61ba 100644 --- a/bweb/src/main/java/com/bweb/controller/SecUserController.java +++ b/bweb/src/main/java/com/bweb/controller/SecUserController.java @@ -12,6 +12,7 @@ import com.hfkj.entity.SecUser; import com.hfkj.model.ResponseData; import com.hfkj.service.SecUserLoginLogService; import com.hfkj.service.SecUserService; +import com.hfkj.sysenum.SecUserObjectTypeEnum; import com.hfkj.sysenum.SecUserStatusEnum; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -61,6 +62,7 @@ public class SecUserController { } else { secUser = new SecUser(); secUser.setPassword(MD5Util.encode("123456".getBytes())); + secUser.setObjectType(SecUserObjectTypeEnum.type1.getCode()); // 校验重复登录账户 if (secUserService.getDetailByLoginName(body.getString("loginName")) != null) { @@ -200,6 +202,7 @@ public class SecUserController { public ResponseData queryList(@RequestParam(value = "userName", required = false) String userName, @RequestParam(value = "loginName", required = false) String loginName, @RequestParam(value = "telephone", required = false) String telephone, + @RequestParam(value = "objectType", required = false) Integer objectType, @RequestParam(value = "status", required = false) Integer status, @RequestParam(value = "pageNum", required = true) Integer pageNum, @RequestParam(value = "pageSize", required = true) Integer pageSize) { @@ -209,6 +212,7 @@ public class SecUserController { param.put("userName", userName); param.put("loginName", loginName); param.put("telephone", telephone); + param.put("objectType", objectType); param.put("status", status); PageHelper.startPage(pageNum, pageSize); diff --git a/service/src/main/java/com/hfkj/common/utils/IdCardUtil.java b/service/src/main/java/com/hfkj/common/utils/IdCardUtil.java deleted file mode 100644 index f5b128e..0000000 --- a/service/src/main/java/com/hfkj/common/utils/IdCardUtil.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.hfkj.common.utils; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * @ClassName IdCardUtil - * @Description - * @Author 杜江 - * @Date 2020/8/11 11:38 - * @Version 1.0 - */ -public class IdCardUtil { - public static boolean isIdCard(String card){ - card = replaceBlank(card); - if(card == null || "".equals(card)){ - return false; - } - //定义 叛别用户 身份证号的正则表达式 (15位 或 18位,最后一位可以为字母) - String requal = "(^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|(10|20|30|31))\\d{3}[0-9Xx]$)|" - +"(^[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}$)"; - - // 假设18位 身份证号码: - // ^ 表示开头 - // [1-9] 第一位1-9 中的一个 4 注意!! 前六位代表地址,此处是 拆分 讲解 对正则 的注释 - // \\d{5} 五位数字 10001(前六位省市县地区) - // (18|19|20) 19 (现阶段可能取值范围18xx-20xx年) - // \\d{2} 91 (年份) - // ((0[1-9])|(10|11|12)) 01(月份) - // (([0-2][1-9])|10|20|30|31) 01(日期) 也可写成(([0-2][1-9])|(10|20|30|31)) - // \\d{3} 三位数字 123(第十七位奇数表示男,偶数表示女) - // [0-9Xx] 0123456789Xx 其中的一个 X(第十八位为校验值) - // $结尾 - - // 假设15位身份证号码: 410001910101123 - // ^ 开头 - // [1-9] 第一位1-9中的一个 4 - // \\d{5} 五位数字 10001(前六位省市县地区) - // \\d{2} 91(年份) 表示 91年 - // ((0[1-9])|(10|11|12)) 01(月份) - // (([0-2][1-9])|10|20|30|31) 01(日期) - // \\d{3} 123(第十五位奇数代表男,偶数代表女),15位身份证不含X - // $结尾 - boolean matches = card.matches(requal); - - //判断 第 18位 校验值 ,校验算法涉及两次mod 11的过程 - // 二代身份证中的 号码第十八位的计算方法为: - if(matches){ - if (card.length() == 18){ - try { - char[] charArray = card.toCharArray(); - //1,将前面的身份证号码17位数分别乘以不同的系数,系数为此处的 加权因子 - //前十七位加权因子 - int[] idCardWi = {7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2}; - int sum = 0; - // 2,将这17位数字 和系数相乘 的结果相加 - for (int i = 0;i < idCardWi.length;i++){ - int current = Integer.parseInt(String.valueOf(charArray[i])); - // 相乘对应的 加权因子系数 - int count = current * idCardWi[i]; - // 结果相加 - sum += count; - } - char idCardLast = charArray[17]; - // 3,结果和 除以11,查看余数 - int idCardMod = sum % 11; - // 4,这是除以 11后,可能产生的 11位余数对应的验证码(--对应下标),其中 X 代表罗马数字 10 - String[] idCardY = {"1","0","X","9","8","7","6","5","4","3","2"}; - if (idCardY[idCardMod].toUpperCase().equals(String.valueOf(idCardLast).toUpperCase())){ - return true; - }else { - System.out.println("身份证最后一位:"+String.valueOf(idCardLast).toUpperCase()+ - "错误,正确的应该是:"+idCardY[idCardMod].toUpperCase()); - return false; - } - }catch (Exception e){ - e.printStackTrace(); - System.out.println("异常:"+card); - return false; - } - } - } - return matches; - } - - public static String replaceBlank(String str) { - String dest = ""; - if (str!=null) { - Pattern p = Pattern.compile("\\s*|\t|\r|\n"); - Matcher m = p.matcher(str); - dest = m.replaceAll(""); - } - return dest; - } - - public static void main(String[] args) { - System.out.println(isIdCard("5113221999409035038")); - } -} diff --git a/service/src/main/java/com/hfkj/common/utils/RandomUtils.java b/service/src/main/java/com/hfkj/common/utils/RandomUtils.java new file mode 100644 index 0000000..5f993a3 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/utils/RandomUtils.java @@ -0,0 +1,31 @@ +package com.hfkj.common.utils; + +import java.util.Random; + +/** + * + * @className: RandomUtils + * @author: HuRui + * @date: 2024/4/24 + **/ +public class RandomUtils { + + /** + * 生成随机数 + * @param length 长度 + * @param zero 是否包含零 + * @return + */ + public static String number(int length, boolean zero) { + String sl = "123456789"; + if (zero) { + sl += "0"; + } + StringBuilder sb = new StringBuilder(); + for(int i = 0 ; i < length ; i ++){ + sb.append(sl.charAt(new Random().nextInt(sl.length()))); + } + return sb.toString(); + } + +} diff --git a/service/src/main/java/com/hfkj/dao/BsMerMapper.java b/service/src/main/java/com/hfkj/dao/BsMerMapper.java new file mode 100644 index 0000000..1a0a509 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsMerMapper.java @@ -0,0 +1,133 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsMer; +import com.hfkj.entity.BsMerExample; +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 BsMerMapper extends BsMerMapperExt { + @SelectProvider(type=BsMerSqlProvider.class, method="countByExample") + long countByExample(BsMerExample example); + + @DeleteProvider(type=BsMerSqlProvider.class, method="deleteByExample") + int deleteByExample(BsMerExample example); + + @Delete({ + "delete from bs_mer", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into bs_mer (mer_no, mer_logo, ", + "mer_name, director_name, ", + "director_tel, customer_service_tel, ", + "address, `status`, ", + "create_time, update_time, ", + "ext_1, ext_2, ext_3)", + "values (#{merNo,jdbcType=VARCHAR}, #{merLogo,jdbcType=VARCHAR}, ", + "#{merName,jdbcType=VARCHAR}, #{directorName,jdbcType=VARCHAR}, ", + "#{directorTel,jdbcType=VARCHAR}, #{customerServiceTel,jdbcType=VARCHAR}, ", + "#{address,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(BsMer record); + + @InsertProvider(type=BsMerSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(BsMer record); + + @SelectProvider(type=BsMerSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_logo", property="merLogo", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), + @Result(column="director_name", property="directorName", jdbcType=JdbcType.VARCHAR), + @Result(column="director_tel", property="directorTel", jdbcType=JdbcType.VARCHAR), + @Result(column="customer_service_tel", property="customerServiceTel", jdbcType=JdbcType.VARCHAR), + @Result(column="address", property="address", 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(BsMerExample example); + + @Select({ + "select", + "id, mer_no, mer_logo, mer_name, director_name, director_tel, customer_service_tel, ", + "address, `status`, create_time, update_time, ext_1, ext_2, ext_3", + "from bs_mer", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_logo", property="merLogo", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), + @Result(column="director_name", property="directorName", jdbcType=JdbcType.VARCHAR), + @Result(column="director_tel", property="directorTel", jdbcType=JdbcType.VARCHAR), + @Result(column="customer_service_tel", property="customerServiceTel", jdbcType=JdbcType.VARCHAR), + @Result(column="address", property="address", 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) + }) + BsMer selectByPrimaryKey(Long id); + + @UpdateProvider(type=BsMerSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") BsMer record, @Param("example") BsMerExample example); + + @UpdateProvider(type=BsMerSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") BsMer record, @Param("example") BsMerExample example); + + @UpdateProvider(type=BsMerSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(BsMer record); + + @Update({ + "update bs_mer", + "set mer_no = #{merNo,jdbcType=VARCHAR},", + "mer_logo = #{merLogo,jdbcType=VARCHAR},", + "mer_name = #{merName,jdbcType=VARCHAR},", + "director_name = #{directorName,jdbcType=VARCHAR},", + "director_tel = #{directorTel,jdbcType=VARCHAR},", + "customer_service_tel = #{customerServiceTel,jdbcType=VARCHAR},", + "address = #{address,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(BsMer record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsMerMapperExt.java b/service/src/main/java/com/hfkj/dao/BsMerMapperExt.java new file mode 100644 index 0000000..336b1ed --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsMerMapperExt.java @@ -0,0 +1,7 @@ +package com.hfkj.dao; + +/** + * mapper扩展类 + */ +public interface BsMerMapperExt { +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsMerSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsMerSqlProvider.java new file mode 100644 index 0000000..9bef095 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsMerSqlProvider.java @@ -0,0 +1,360 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsMer; +import com.hfkj.entity.BsMerExample.Criteria; +import com.hfkj.entity.BsMerExample.Criterion; +import com.hfkj.entity.BsMerExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class BsMerSqlProvider { + + public String countByExample(BsMerExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("bs_mer"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(BsMerExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("bs_mer"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(BsMer record) { + SQL sql = new SQL(); + sql.INSERT_INTO("bs_mer"); + + if (record.getMerNo() != null) { + sql.VALUES("mer_no", "#{merNo,jdbcType=VARCHAR}"); + } + + if (record.getMerLogo() != null) { + sql.VALUES("mer_logo", "#{merLogo,jdbcType=VARCHAR}"); + } + + if (record.getMerName() != null) { + sql.VALUES("mer_name", "#{merName,jdbcType=VARCHAR}"); + } + + if (record.getDirectorName() != null) { + sql.VALUES("director_name", "#{directorName,jdbcType=VARCHAR}"); + } + + if (record.getDirectorTel() != null) { + sql.VALUES("director_tel", "#{directorTel,jdbcType=VARCHAR}"); + } + + if (record.getCustomerServiceTel() != null) { + sql.VALUES("customer_service_tel", "#{customerServiceTel,jdbcType=VARCHAR}"); + } + + if (record.getAddress() != null) { + sql.VALUES("address", "#{address,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(BsMerExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("mer_no"); + sql.SELECT("mer_logo"); + sql.SELECT("mer_name"); + sql.SELECT("director_name"); + sql.SELECT("director_tel"); + sql.SELECT("customer_service_tel"); + sql.SELECT("address"); + sql.SELECT("`status`"); + sql.SELECT("create_time"); + sql.SELECT("update_time"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("bs_mer"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + BsMer record = (BsMer) parameter.get("record"); + BsMerExample example = (BsMerExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("bs_mer"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getMerNo() != null) { + sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}"); + } + + if (record.getMerLogo() != null) { + sql.SET("mer_logo = #{record.merLogo,jdbcType=VARCHAR}"); + } + + if (record.getMerName() != null) { + sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); + } + + if (record.getDirectorName() != null) { + sql.SET("director_name = #{record.directorName,jdbcType=VARCHAR}"); + } + + if (record.getDirectorTel() != null) { + sql.SET("director_tel = #{record.directorTel,jdbcType=VARCHAR}"); + } + + if (record.getCustomerServiceTel() != null) { + sql.SET("customer_service_tel = #{record.customerServiceTel,jdbcType=VARCHAR}"); + } + + if (record.getAddress() != null) { + sql.SET("address = #{record.address,jdbcType=VARCHAR}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getExt1() != null) { + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + } + + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByExample(Map parameter) { + SQL sql = new SQL(); + sql.UPDATE("bs_mer"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}"); + sql.SET("mer_logo = #{record.merLogo,jdbcType=VARCHAR}"); + sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); + sql.SET("director_name = #{record.directorName,jdbcType=VARCHAR}"); + sql.SET("director_tel = #{record.directorTel,jdbcType=VARCHAR}"); + sql.SET("customer_service_tel = #{record.customerServiceTel,jdbcType=VARCHAR}"); + sql.SET("address = #{record.address,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}"); + + BsMerExample example = (BsMerExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(BsMer record) { + SQL sql = new SQL(); + sql.UPDATE("bs_mer"); + + if (record.getMerNo() != null) { + sql.SET("mer_no = #{merNo,jdbcType=VARCHAR}"); + } + + if (record.getMerLogo() != null) { + sql.SET("mer_logo = #{merLogo,jdbcType=VARCHAR}"); + } + + if (record.getMerName() != null) { + sql.SET("mer_name = #{merName,jdbcType=VARCHAR}"); + } + + if (record.getDirectorName() != null) { + sql.SET("director_name = #{directorName,jdbcType=VARCHAR}"); + } + + if (record.getDirectorTel() != null) { + sql.SET("director_tel = #{directorTel,jdbcType=VARCHAR}"); + } + + if (record.getCustomerServiceTel() != null) { + sql.SET("customer_service_tel = #{customerServiceTel,jdbcType=VARCHAR}"); + } + + if (record.getAddress() != null) { + sql.SET("address = #{address,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, BsMerExample example, boolean includeExamplePhrase) { + if (example == null) { + return; + } + + String parmPhrase1; + String parmPhrase1_th; + String parmPhrase2; + String parmPhrase2_th; + String parmPhrase3; + String parmPhrase3_th; + if (includeExamplePhrase) { + parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; + parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; + parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; + parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; + parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; + parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; + } else { + parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; + parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; + parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; + parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; + parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; + parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; + } + + StringBuilder sb = new StringBuilder(); + List oredCriteria = example.getOredCriteria(); + boolean firstCriteria = true; + for (int i = 0; i < oredCriteria.size(); i++) { + Criteria criteria = oredCriteria.get(i); + if (criteria.isValid()) { + if (firstCriteria) { + firstCriteria = false; + } else { + sb.append(" or "); + } + + sb.append('('); + List criterions = criteria.getAllCriteria(); + boolean firstCriterion = true; + for (int j = 0; j < criterions.size(); j++) { + Criterion criterion = criterions.get(j); + if (firstCriterion) { + firstCriterion = false; + } else { + sb.append(" and "); + } + + if (criterion.isNoValue()) { + sb.append(criterion.getCondition()); + } else if (criterion.isSingleValue()) { + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); + } else { + sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); + } + } else if (criterion.isBetweenValue()) { + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); + } else { + sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); + } + } else if (criterion.isListValue()) { + sb.append(criterion.getCondition()); + sb.append(" ("); + List listItems = (List) criterion.getValue(); + boolean comma = false; + for (int k = 0; k < listItems.size(); k++) { + if (comma) { + sb.append(", "); + } else { + comma = true; + } + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase3, i, j, k)); + } else { + sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); + } + } + sb.append(')'); + } + } + sb.append(')'); + } + } + + if (sb.length() > 0) { + sql.WHERE(sb.toString()); + } + } +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/SecUserMapper.java b/service/src/main/java/com/hfkj/dao/SecUserMapper.java index 9e2930d..0d7529f 100644 --- a/service/src/main/java/com/hfkj/dao/SecUserMapper.java +++ b/service/src/main/java/com/hfkj/dao/SecUserMapper.java @@ -42,13 +42,15 @@ public interface SecUserMapper extends SecUserMapperExt { "insert into sec_user (avatar, user_name, ", "login_name, `password`, ", "telephone, object_type, ", - "role_id, `status`, create_time, ", + "object_id, role_id, ", + "`status`, create_time, ", "update_time, ext_1, ", "ext_2, ext_3)", "values (#{avatar,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, ", "#{loginName,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, ", "#{telephone,jdbcType=VARCHAR}, #{objectType,jdbcType=INTEGER}, ", - "#{roleId,jdbcType=BIGINT}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{objectId,jdbcType=BIGINT}, #{roleId,jdbcType=BIGINT}, ", + "#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", "#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" }) @@ -68,6 +70,7 @@ public interface SecUserMapper extends SecUserMapperExt { @Result(column="password", property="password", jdbcType=JdbcType.VARCHAR), @Result(column="telephone", property="telephone", jdbcType=JdbcType.VARCHAR), @Result(column="object_type", property="objectType", jdbcType=JdbcType.INTEGER), + @Result(column="object_id", property="objectId", jdbcType=JdbcType.BIGINT), @Result(column="role_id", property="roleId", jdbcType=JdbcType.BIGINT), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @@ -80,8 +83,8 @@ public interface SecUserMapper extends SecUserMapperExt { @Select({ "select", - "id, avatar, user_name, login_name, `password`, telephone, object_type, role_id, ", - "`status`, create_time, update_time, ext_1, ext_2, ext_3", + "id, avatar, user_name, login_name, `password`, telephone, object_type, object_id, ", + "role_id, `status`, create_time, update_time, ext_1, ext_2, ext_3", "from sec_user", "where id = #{id,jdbcType=BIGINT}" }) @@ -93,6 +96,7 @@ public interface SecUserMapper extends SecUserMapperExt { @Result(column="password", property="password", jdbcType=JdbcType.VARCHAR), @Result(column="telephone", property="telephone", jdbcType=JdbcType.VARCHAR), @Result(column="object_type", property="objectType", jdbcType=JdbcType.INTEGER), + @Result(column="object_id", property="objectId", jdbcType=JdbcType.BIGINT), @Result(column="role_id", property="roleId", jdbcType=JdbcType.BIGINT), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @@ -120,6 +124,7 @@ public interface SecUserMapper extends SecUserMapperExt { "`password` = #{password,jdbcType=VARCHAR},", "telephone = #{telephone,jdbcType=VARCHAR},", "object_type = #{objectType,jdbcType=INTEGER},", + "object_id = #{objectId,jdbcType=BIGINT},", "role_id = #{roleId,jdbcType=BIGINT},", "`status` = #{status,jdbcType=INTEGER},", "create_time = #{createTime,jdbcType=TIMESTAMP},", diff --git a/service/src/main/java/com/hfkj/dao/SecUserSqlProvider.java b/service/src/main/java/com/hfkj/dao/SecUserSqlProvider.java index ae912cf..0ed635d 100644 --- a/service/src/main/java/com/hfkj/dao/SecUserSqlProvider.java +++ b/service/src/main/java/com/hfkj/dao/SecUserSqlProvider.java @@ -52,6 +52,10 @@ public class SecUserSqlProvider { sql.VALUES("object_type", "#{objectType,jdbcType=INTEGER}"); } + if (record.getObjectId() != null) { + sql.VALUES("object_id", "#{objectId,jdbcType=BIGINT}"); + } + if (record.getRoleId() != null) { sql.VALUES("role_id", "#{roleId,jdbcType=BIGINT}"); } @@ -96,6 +100,7 @@ public class SecUserSqlProvider { sql.SELECT("`password`"); sql.SELECT("telephone"); sql.SELECT("object_type"); + sql.SELECT("object_id"); sql.SELECT("role_id"); sql.SELECT("`status`"); sql.SELECT("create_time"); @@ -148,6 +153,10 @@ public class SecUserSqlProvider { sql.SET("object_type = #{record.objectType,jdbcType=INTEGER}"); } + if (record.getObjectId() != null) { + sql.SET("object_id = #{record.objectId,jdbcType=BIGINT}"); + } + if (record.getRoleId() != null) { sql.SET("role_id = #{record.roleId,jdbcType=BIGINT}"); } @@ -191,6 +200,7 @@ public class SecUserSqlProvider { sql.SET("`password` = #{record.password,jdbcType=VARCHAR}"); sql.SET("telephone = #{record.telephone,jdbcType=VARCHAR}"); sql.SET("object_type = #{record.objectType,jdbcType=INTEGER}"); + sql.SET("object_id = #{record.objectId,jdbcType=BIGINT}"); sql.SET("role_id = #{record.roleId,jdbcType=BIGINT}"); sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); @@ -232,6 +242,10 @@ public class SecUserSqlProvider { sql.SET("object_type = #{objectType,jdbcType=INTEGER}"); } + if (record.getObjectId() != null) { + sql.SET("object_id = #{objectId,jdbcType=BIGINT}"); + } + if (record.getRoleId() != null) { sql.SET("role_id = #{roleId,jdbcType=BIGINT}"); } diff --git a/service/src/main/java/com/hfkj/entity/BsMer.java b/service/src/main/java/com/hfkj/entity/BsMer.java new file mode 100644 index 0000000..3c4a542 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsMer.java @@ -0,0 +1,264 @@ +package com.hfkj.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * bs_mer + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class BsMer implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 商户号 + */ + private String merNo; + + /** + * 商户LOGO + */ + private String merLogo; + + /** + * 商户名称 + */ + private String merName; + + /** + * 负责人名称 + */ + private String directorName; + + /** + * 负责人电话 + */ + private String directorTel; + + /** + * 客服电话 + */ + private String customerServiceTel; + + /** + * 详细地址 + */ + private String address; + + /** + * 状态 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 String getMerNo() { + return merNo; + } + + public void setMerNo(String merNo) { + this.merNo = merNo; + } + + public String getMerLogo() { + return merLogo; + } + + public void setMerLogo(String merLogo) { + this.merLogo = merLogo; + } + + public String getMerName() { + return merName; + } + + public void setMerName(String merName) { + this.merName = merName; + } + + public String getDirectorName() { + return directorName; + } + + public void setDirectorName(String directorName) { + this.directorName = directorName; + } + + public String getDirectorTel() { + return directorTel; + } + + public void setDirectorTel(String directorTel) { + this.directorTel = directorTel; + } + + public String getCustomerServiceTel() { + return customerServiceTel; + } + + public void setCustomerServiceTel(String customerServiceTel) { + this.customerServiceTel = customerServiceTel; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + 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; + } + BsMer other = (BsMer) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getMerNo() == null ? other.getMerNo() == null : this.getMerNo().equals(other.getMerNo())) + && (this.getMerLogo() == null ? other.getMerLogo() == null : this.getMerLogo().equals(other.getMerLogo())) + && (this.getMerName() == null ? other.getMerName() == null : this.getMerName().equals(other.getMerName())) + && (this.getDirectorName() == null ? other.getDirectorName() == null : this.getDirectorName().equals(other.getDirectorName())) + && (this.getDirectorTel() == null ? other.getDirectorTel() == null : this.getDirectorTel().equals(other.getDirectorTel())) + && (this.getCustomerServiceTel() == null ? other.getCustomerServiceTel() == null : this.getCustomerServiceTel().equals(other.getCustomerServiceTel())) + && (this.getAddress() == null ? other.getAddress() == null : this.getAddress().equals(other.getAddress())) + && (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 + ((getMerNo() == null) ? 0 : getMerNo().hashCode()); + result = prime * result + ((getMerLogo() == null) ? 0 : getMerLogo().hashCode()); + result = prime * result + ((getMerName() == null) ? 0 : getMerName().hashCode()); + result = prime * result + ((getDirectorName() == null) ? 0 : getDirectorName().hashCode()); + result = prime * result + ((getDirectorTel() == null) ? 0 : getDirectorTel().hashCode()); + result = prime * result + ((getCustomerServiceTel() == null) ? 0 : getCustomerServiceTel().hashCode()); + result = prime * result + ((getAddress() == null) ? 0 : getAddress().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(", merNo=").append(merNo); + sb.append(", merLogo=").append(merLogo); + sb.append(", merName=").append(merName); + sb.append(", directorName=").append(directorName); + sb.append(", directorTel=").append(directorTel); + sb.append(", customerServiceTel=").append(customerServiceTel); + sb.append(", address=").append(address); + sb.append(", status=").append(status); + sb.append(", createTime=").append(createTime); + sb.append(", updateTime=").append(updateTime); + sb.append(", ext1=").append(ext1); + sb.append(", ext2=").append(ext2); + sb.append(", ext3=").append(ext3); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/entity/BsMerExample.java b/service/src/main/java/com/hfkj/entity/BsMerExample.java new file mode 100644 index 0000000..d39d667 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsMerExample.java @@ -0,0 +1,1163 @@ +package com.hfkj.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class BsMerExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public BsMerExample() { + 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 andMerNoIsNull() { + addCriterion("mer_no is null"); + return (Criteria) this; + } + + public Criteria andMerNoIsNotNull() { + addCriterion("mer_no is not null"); + return (Criteria) this; + } + + public Criteria andMerNoEqualTo(String value) { + addCriterion("mer_no =", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotEqualTo(String value) { + addCriterion("mer_no <>", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoGreaterThan(String value) { + addCriterion("mer_no >", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoGreaterThanOrEqualTo(String value) { + addCriterion("mer_no >=", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLessThan(String value) { + addCriterion("mer_no <", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLessThanOrEqualTo(String value) { + addCriterion("mer_no <=", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLike(String value) { + addCriterion("mer_no like", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotLike(String value) { + addCriterion("mer_no not like", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoIn(List values) { + addCriterion("mer_no in", values, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotIn(List values) { + addCriterion("mer_no not in", values, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoBetween(String value1, String value2) { + addCriterion("mer_no between", value1, value2, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotBetween(String value1, String value2) { + addCriterion("mer_no not between", value1, value2, "merNo"); + return (Criteria) this; + } + + public Criteria andMerLogoIsNull() { + addCriterion("mer_logo is null"); + return (Criteria) this; + } + + public Criteria andMerLogoIsNotNull() { + addCriterion("mer_logo is not null"); + return (Criteria) this; + } + + public Criteria andMerLogoEqualTo(String value) { + addCriterion("mer_logo =", value, "merLogo"); + return (Criteria) this; + } + + public Criteria andMerLogoNotEqualTo(String value) { + addCriterion("mer_logo <>", value, "merLogo"); + return (Criteria) this; + } + + public Criteria andMerLogoGreaterThan(String value) { + addCriterion("mer_logo >", value, "merLogo"); + return (Criteria) this; + } + + public Criteria andMerLogoGreaterThanOrEqualTo(String value) { + addCriterion("mer_logo >=", value, "merLogo"); + return (Criteria) this; + } + + public Criteria andMerLogoLessThan(String value) { + addCriterion("mer_logo <", value, "merLogo"); + return (Criteria) this; + } + + public Criteria andMerLogoLessThanOrEqualTo(String value) { + addCriterion("mer_logo <=", value, "merLogo"); + return (Criteria) this; + } + + public Criteria andMerLogoLike(String value) { + addCriterion("mer_logo like", value, "merLogo"); + return (Criteria) this; + } + + public Criteria andMerLogoNotLike(String value) { + addCriterion("mer_logo not like", value, "merLogo"); + return (Criteria) this; + } + + public Criteria andMerLogoIn(List values) { + addCriterion("mer_logo in", values, "merLogo"); + return (Criteria) this; + } + + public Criteria andMerLogoNotIn(List values) { + addCriterion("mer_logo not in", values, "merLogo"); + return (Criteria) this; + } + + public Criteria andMerLogoBetween(String value1, String value2) { + addCriterion("mer_logo between", value1, value2, "merLogo"); + return (Criteria) this; + } + + public Criteria andMerLogoNotBetween(String value1, String value2) { + addCriterion("mer_logo not between", value1, value2, "merLogo"); + 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 andDirectorNameIsNull() { + addCriterion("director_name is null"); + return (Criteria) this; + } + + public Criteria andDirectorNameIsNotNull() { + addCriterion("director_name is not null"); + return (Criteria) this; + } + + public Criteria andDirectorNameEqualTo(String value) { + addCriterion("director_name =", value, "directorName"); + return (Criteria) this; + } + + public Criteria andDirectorNameNotEqualTo(String value) { + addCriterion("director_name <>", value, "directorName"); + return (Criteria) this; + } + + public Criteria andDirectorNameGreaterThan(String value) { + addCriterion("director_name >", value, "directorName"); + return (Criteria) this; + } + + public Criteria andDirectorNameGreaterThanOrEqualTo(String value) { + addCriterion("director_name >=", value, "directorName"); + return (Criteria) this; + } + + public Criteria andDirectorNameLessThan(String value) { + addCriterion("director_name <", value, "directorName"); + return (Criteria) this; + } + + public Criteria andDirectorNameLessThanOrEqualTo(String value) { + addCriterion("director_name <=", value, "directorName"); + return (Criteria) this; + } + + public Criteria andDirectorNameLike(String value) { + addCriterion("director_name like", value, "directorName"); + return (Criteria) this; + } + + public Criteria andDirectorNameNotLike(String value) { + addCriterion("director_name not like", value, "directorName"); + return (Criteria) this; + } + + public Criteria andDirectorNameIn(List values) { + addCriterion("director_name in", values, "directorName"); + return (Criteria) this; + } + + public Criteria andDirectorNameNotIn(List values) { + addCriterion("director_name not in", values, "directorName"); + return (Criteria) this; + } + + public Criteria andDirectorNameBetween(String value1, String value2) { + addCriterion("director_name between", value1, value2, "directorName"); + return (Criteria) this; + } + + public Criteria andDirectorNameNotBetween(String value1, String value2) { + addCriterion("director_name not between", value1, value2, "directorName"); + return (Criteria) this; + } + + public Criteria andDirectorTelIsNull() { + addCriterion("director_tel is null"); + return (Criteria) this; + } + + public Criteria andDirectorTelIsNotNull() { + addCriterion("director_tel is not null"); + return (Criteria) this; + } + + public Criteria andDirectorTelEqualTo(String value) { + addCriterion("director_tel =", value, "directorTel"); + return (Criteria) this; + } + + public Criteria andDirectorTelNotEqualTo(String value) { + addCriterion("director_tel <>", value, "directorTel"); + return (Criteria) this; + } + + public Criteria andDirectorTelGreaterThan(String value) { + addCriterion("director_tel >", value, "directorTel"); + return (Criteria) this; + } + + public Criteria andDirectorTelGreaterThanOrEqualTo(String value) { + addCriterion("director_tel >=", value, "directorTel"); + return (Criteria) this; + } + + public Criteria andDirectorTelLessThan(String value) { + addCriterion("director_tel <", value, "directorTel"); + return (Criteria) this; + } + + public Criteria andDirectorTelLessThanOrEqualTo(String value) { + addCriterion("director_tel <=", value, "directorTel"); + return (Criteria) this; + } + + public Criteria andDirectorTelLike(String value) { + addCriterion("director_tel like", value, "directorTel"); + return (Criteria) this; + } + + public Criteria andDirectorTelNotLike(String value) { + addCriterion("director_tel not like", value, "directorTel"); + return (Criteria) this; + } + + public Criteria andDirectorTelIn(List values) { + addCriterion("director_tel in", values, "directorTel"); + return (Criteria) this; + } + + public Criteria andDirectorTelNotIn(List values) { + addCriterion("director_tel not in", values, "directorTel"); + return (Criteria) this; + } + + public Criteria andDirectorTelBetween(String value1, String value2) { + addCriterion("director_tel between", value1, value2, "directorTel"); + return (Criteria) this; + } + + public Criteria andDirectorTelNotBetween(String value1, String value2) { + addCriterion("director_tel not between", value1, value2, "directorTel"); + return (Criteria) this; + } + + public Criteria andCustomerServiceTelIsNull() { + addCriterion("customer_service_tel is null"); + return (Criteria) this; + } + + public Criteria andCustomerServiceTelIsNotNull() { + addCriterion("customer_service_tel is not null"); + return (Criteria) this; + } + + public Criteria andCustomerServiceTelEqualTo(String value) { + addCriterion("customer_service_tel =", value, "customerServiceTel"); + return (Criteria) this; + } + + public Criteria andCustomerServiceTelNotEqualTo(String value) { + addCriterion("customer_service_tel <>", value, "customerServiceTel"); + return (Criteria) this; + } + + public Criteria andCustomerServiceTelGreaterThan(String value) { + addCriterion("customer_service_tel >", value, "customerServiceTel"); + return (Criteria) this; + } + + public Criteria andCustomerServiceTelGreaterThanOrEqualTo(String value) { + addCriterion("customer_service_tel >=", value, "customerServiceTel"); + return (Criteria) this; + } + + public Criteria andCustomerServiceTelLessThan(String value) { + addCriterion("customer_service_tel <", value, "customerServiceTel"); + return (Criteria) this; + } + + public Criteria andCustomerServiceTelLessThanOrEqualTo(String value) { + addCriterion("customer_service_tel <=", value, "customerServiceTel"); + return (Criteria) this; + } + + public Criteria andCustomerServiceTelLike(String value) { + addCriterion("customer_service_tel like", value, "customerServiceTel"); + return (Criteria) this; + } + + public Criteria andCustomerServiceTelNotLike(String value) { + addCriterion("customer_service_tel not like", value, "customerServiceTel"); + return (Criteria) this; + } + + public Criteria andCustomerServiceTelIn(List values) { + addCriterion("customer_service_tel in", values, "customerServiceTel"); + return (Criteria) this; + } + + public Criteria andCustomerServiceTelNotIn(List values) { + addCriterion("customer_service_tel not in", values, "customerServiceTel"); + return (Criteria) this; + } + + public Criteria andCustomerServiceTelBetween(String value1, String value2) { + addCriterion("customer_service_tel between", value1, value2, "customerServiceTel"); + return (Criteria) this; + } + + public Criteria andCustomerServiceTelNotBetween(String value1, String value2) { + addCriterion("customer_service_tel not between", value1, value2, "customerServiceTel"); + return (Criteria) this; + } + + public Criteria andAddressIsNull() { + addCriterion("address is null"); + return (Criteria) this; + } + + public Criteria andAddressIsNotNull() { + addCriterion("address is not null"); + return (Criteria) this; + } + + public Criteria andAddressEqualTo(String value) { + addCriterion("address =", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressNotEqualTo(String value) { + addCriterion("address <>", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressGreaterThan(String value) { + addCriterion("address >", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressGreaterThanOrEqualTo(String value) { + addCriterion("address >=", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressLessThan(String value) { + addCriterion("address <", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressLessThanOrEqualTo(String value) { + addCriterion("address <=", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressLike(String value) { + addCriterion("address like", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressNotLike(String value) { + addCriterion("address not like", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressIn(List values) { + addCriterion("address in", values, "address"); + return (Criteria) this; + } + + public Criteria andAddressNotIn(List values) { + addCriterion("address not in", values, "address"); + return (Criteria) this; + } + + public Criteria andAddressBetween(String value1, String value2) { + addCriterion("address between", value1, value2, "address"); + return (Criteria) this; + } + + public Criteria andAddressNotBetween(String value1, String value2) { + addCriterion("address not between", value1, value2, "address"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("`status` is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("`status` is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Integer value) { + addCriterion("`status` =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Integer value) { + addCriterion("`status` <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Integer value) { + addCriterion("`status` >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("`status` >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Integer value) { + addCriterion("`status` <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Integer value) { + addCriterion("`status` <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("`status` not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Integer value1, Integer value2) { + addCriterion("`status` between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Integer value1, Integer value2) { + addCriterion("`status` not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andExt1IsNull() { + addCriterion("ext_1 is null"); + return (Criteria) this; + } + + public Criteria andExt1IsNotNull() { + addCriterion("ext_1 is not null"); + return (Criteria) this; + } + + public Criteria andExt1EqualTo(String value) { + addCriterion("ext_1 =", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotEqualTo(String value) { + addCriterion("ext_1 <>", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThan(String value) { + addCriterion("ext_1 >", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThanOrEqualTo(String value) { + addCriterion("ext_1 >=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThan(String value) { + addCriterion("ext_1 <", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThanOrEqualTo(String value) { + addCriterion("ext_1 <=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Like(String value) { + addCriterion("ext_1 like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotLike(String value) { + addCriterion("ext_1 not like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1In(List values) { + addCriterion("ext_1 in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotIn(List values) { + addCriterion("ext_1 not in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Between(String value1, String value2) { + addCriterion("ext_1 between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotBetween(String value1, String value2) { + addCriterion("ext_1 not between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt2IsNull() { + addCriterion("ext_2 is null"); + return (Criteria) this; + } + + public Criteria andExt2IsNotNull() { + addCriterion("ext_2 is not null"); + return (Criteria) this; + } + + public Criteria andExt2EqualTo(String value) { + addCriterion("ext_2 =", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotEqualTo(String value) { + addCriterion("ext_2 <>", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThan(String value) { + addCriterion("ext_2 >", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThanOrEqualTo(String value) { + addCriterion("ext_2 >=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThan(String value) { + addCriterion("ext_2 <", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThanOrEqualTo(String value) { + addCriterion("ext_2 <=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Like(String value) { + addCriterion("ext_2 like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotLike(String value) { + addCriterion("ext_2 not like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2In(List values) { + addCriterion("ext_2 in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotIn(List values) { + addCriterion("ext_2 not in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Between(String value1, String value2) { + addCriterion("ext_2 between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotBetween(String value1, String value2) { + addCriterion("ext_2 not between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt3IsNull() { + addCriterion("ext_3 is null"); + return (Criteria) this; + } + + public Criteria andExt3IsNotNull() { + addCriterion("ext_3 is not null"); + return (Criteria) this; + } + + public Criteria andExt3EqualTo(String value) { + addCriterion("ext_3 =", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotEqualTo(String value) { + addCriterion("ext_3 <>", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThan(String value) { + addCriterion("ext_3 >", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThanOrEqualTo(String value) { + addCriterion("ext_3 >=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThan(String value) { + addCriterion("ext_3 <", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThanOrEqualTo(String value) { + addCriterion("ext_3 <=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Like(String value) { + addCriterion("ext_3 like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotLike(String value) { + addCriterion("ext_3 not like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3In(List values) { + addCriterion("ext_3 in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotIn(List values) { + addCriterion("ext_3 not in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Between(String value1, String value2) { + addCriterion("ext_3 between", value1, value2, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotBetween(String value1, String value2) { + addCriterion("ext_3 not between", value1, value2, "ext3"); + return (Criteria) this; + } + } + + /** + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/entity/SecUser.java b/service/src/main/java/com/hfkj/entity/SecUser.java index 28b9f7a..3fbe97a 100644 --- a/service/src/main/java/com/hfkj/entity/SecUser.java +++ b/service/src/main/java/com/hfkj/entity/SecUser.java @@ -48,6 +48,11 @@ public class SecUser implements Serializable { */ private Integer objectType; + /** + * 对象id + */ + private Long objectId; + /** * 角色id */ @@ -132,6 +137,14 @@ public class SecUser implements Serializable { this.objectType = objectType; } + public Long getObjectId() { + return objectId; + } + + public void setObjectId(Long objectId) { + this.objectId = objectId; + } + public Long getRoleId() { return roleId; } @@ -207,6 +220,7 @@ public class SecUser implements Serializable { && (this.getPassword() == null ? other.getPassword() == null : this.getPassword().equals(other.getPassword())) && (this.getTelephone() == null ? other.getTelephone() == null : this.getTelephone().equals(other.getTelephone())) && (this.getObjectType() == null ? other.getObjectType() == null : this.getObjectType().equals(other.getObjectType())) + && (this.getObjectId() == null ? other.getObjectId() == null : this.getObjectId().equals(other.getObjectId())) && (this.getRoleId() == null ? other.getRoleId() == null : this.getRoleId().equals(other.getRoleId())) && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) @@ -227,6 +241,7 @@ public class SecUser implements Serializable { result = prime * result + ((getPassword() == null) ? 0 : getPassword().hashCode()); result = prime * result + ((getTelephone() == null) ? 0 : getTelephone().hashCode()); result = prime * result + ((getObjectType() == null) ? 0 : getObjectType().hashCode()); + result = prime * result + ((getObjectId() == null) ? 0 : getObjectId().hashCode()); result = prime * result + ((getRoleId() == null) ? 0 : getRoleId().hashCode()); result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); @@ -250,6 +265,7 @@ public class SecUser implements Serializable { sb.append(", password=").append(password); sb.append(", telephone=").append(telephone); sb.append(", objectType=").append(objectType); + sb.append(", objectId=").append(objectId); sb.append(", roleId=").append(roleId); sb.append(", status=").append(status); sb.append(", createTime=").append(createTime); diff --git a/service/src/main/java/com/hfkj/entity/SecUserExample.java b/service/src/main/java/com/hfkj/entity/SecUserExample.java index 6d0baa8..8314f2f 100644 --- a/service/src/main/java/com/hfkj/entity/SecUserExample.java +++ b/service/src/main/java/com/hfkj/entity/SecUserExample.java @@ -595,6 +595,66 @@ public class SecUserExample { return (Criteria) this; } + public Criteria andObjectIdIsNull() { + addCriterion("object_id is null"); + return (Criteria) this; + } + + public Criteria andObjectIdIsNotNull() { + addCriterion("object_id is not null"); + return (Criteria) this; + } + + public Criteria andObjectIdEqualTo(Long value) { + addCriterion("object_id =", value, "objectId"); + return (Criteria) this; + } + + public Criteria andObjectIdNotEqualTo(Long value) { + addCriterion("object_id <>", value, "objectId"); + return (Criteria) this; + } + + public Criteria andObjectIdGreaterThan(Long value) { + addCriterion("object_id >", value, "objectId"); + return (Criteria) this; + } + + public Criteria andObjectIdGreaterThanOrEqualTo(Long value) { + addCriterion("object_id >=", value, "objectId"); + return (Criteria) this; + } + + public Criteria andObjectIdLessThan(Long value) { + addCriterion("object_id <", value, "objectId"); + return (Criteria) this; + } + + public Criteria andObjectIdLessThanOrEqualTo(Long value) { + addCriterion("object_id <=", value, "objectId"); + return (Criteria) this; + } + + public Criteria andObjectIdIn(List values) { + addCriterion("object_id in", values, "objectId"); + return (Criteria) this; + } + + public Criteria andObjectIdNotIn(List values) { + addCriterion("object_id not in", values, "objectId"); + return (Criteria) this; + } + + public Criteria andObjectIdBetween(Long value1, Long value2) { + addCriterion("object_id between", value1, value2, "objectId"); + return (Criteria) this; + } + + public Criteria andObjectIdNotBetween(Long value1, Long value2) { + addCriterion("object_id not between", value1, value2, "objectId"); + return (Criteria) this; + } + public Criteria andRoleIdIsNull() { addCriterion("role_id is null"); return (Criteria) this; diff --git a/service/src/main/java/com/hfkj/model/BsMerModel.java b/service/src/main/java/com/hfkj/model/BsMerModel.java new file mode 100644 index 0000000..36994a5 --- /dev/null +++ b/service/src/main/java/com/hfkj/model/BsMerModel.java @@ -0,0 +1,25 @@ +package com.hfkj.model; + +import com.hfkj.entity.BsMer; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @className: BsMerModel + * @author: HuRui + * @date: 2024/4/24 + **/ +@EqualsAndHashCode(callSuper = true) +@Data +public class BsMerModel extends BsMer { + + /** + * 登录账户 + */ + private String loginName; + + /** + * 角色id + */ + private Long roleId; +} diff --git a/service/src/main/java/com/hfkj/service/BsMerService.java b/service/src/main/java/com/hfkj/service/BsMerService.java new file mode 100644 index 0000000..af8b237 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/BsMerService.java @@ -0,0 +1,49 @@ +package com.hfkj.service; + +import com.hfkj.entity.BsMer; +import com.hfkj.model.BsMerModel; + +import java.util.List; +import java.util.Map; + +/** + * @className: BsMerService + * @author: HuRui + * @date: 2024/4/24 + **/ +public interface BsMerService { + + /** + * 编辑数据 + * @param mer + */ + void editData(BsMer mer); + + /** + * 创建商户 + * @param mer + */ + void create(BsMerModel mer) throws Exception; + + /** + * 修改商户 + * @param mer + */ + void update(BsMerModel mer) throws Exception; + + /** + * 查询商户详情 + * @param merNo 商户号 + * @return + */ + BsMerModel getDetail(String merNo); + + /** + * 查询商户列表 + * @param param + * @return + */ + List getList(Map param); + + +} diff --git a/service/src/main/java/com/hfkj/service/SecDictionaryService.java b/service/src/main/java/com/hfkj/service/SecDictionaryService.java new file mode 100644 index 0000000..476ce3d --- /dev/null +++ b/service/src/main/java/com/hfkj/service/SecDictionaryService.java @@ -0,0 +1,37 @@ +package com.hfkj.service; + +import com.hfkj.entity.SecDictionary; + +import java.util.List; + +/** + * @className: SecDictionaryService + * @author: HuRui + * @date: 2024/4/23 + **/ +public interface SecDictionaryService { + + /** + * 获取数据字典 + * @return + */ + List getDictionary(); + + /** + * 获取数据字典 + * @param codeType + * @return + */ + List getDictionary(String codeType); + + /** + * 获取数据字典 + * @param codeType + * @param codeValue + * @return + */ + SecDictionary getDictionary(String codeType, String codeValue); + + + +} diff --git a/service/src/main/java/com/hfkj/service/SecUserService.java b/service/src/main/java/com/hfkj/service/SecUserService.java index bc9ac60..5f2315c 100644 --- a/service/src/main/java/com/hfkj/service/SecUserService.java +++ b/service/src/main/java/com/hfkj/service/SecUserService.java @@ -3,6 +3,7 @@ package com.hfkj.service; import com.hfkj.common.security.SessionObject; import com.hfkj.entity.SecUser; import com.hfkj.model.SecUserSessionObject; +import com.hfkj.sysenum.SecUserObjectTypeEnum; import java.util.List; import java.util.Map; @@ -32,6 +33,14 @@ public interface SecUserService { */ SecUser getDetail(Long id); + /** + * 查询详情 + * @param objectType + * @param objectId + * @return + */ + SecUser getDetail(SecUserObjectTypeEnum objectType, Long objectId); + /** * 根据登录账户查询详情 * @param loginName diff --git a/service/src/main/java/com/hfkj/service/impl/BsMerServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/BsMerServiceImpl.java new file mode 100644 index 0000000..3db3eac --- /dev/null +++ b/service/src/main/java/com/hfkj/service/impl/BsMerServiceImpl.java @@ -0,0 +1,160 @@ +package com.hfkj.service.impl; + +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.utils.DateUtil; +import com.hfkj.common.utils.MD5Util; +import com.hfkj.common.utils.RandomUtils; +import com.hfkj.common.utils.RedisUtil; +import com.hfkj.dao.BsMerMapper; +import com.hfkj.entity.BsMer; +import com.hfkj.entity.BsMerExample; +import com.hfkj.entity.SecUser; +import com.hfkj.model.BsMerModel; +import com.hfkj.service.BsMerService; +import com.hfkj.service.SecUserService; +import com.hfkj.sysenum.MerStatusEnum; +import com.hfkj.sysenum.SecUserObjectTypeEnum; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.Random; + +/** + * @className: BsMerServiceImpl + * @author: HuRui + * @date: 2024/4/24 + **/ +@Service("merService") +public class BsMerServiceImpl implements BsMerService { + @Autowired + private RedisUtil redisUtil; + private final static String CACHE_MER_KEY = "MER:"; + @Resource + private BsMerMapper merMapper; + @Resource + private SecUserService secUserService; + + /** + * 生成商户号 + * @return + */ + private static String generateMerNo() { + // 166 + 时间 + 随机3位数 + return "166"+DateUtil.format(new Date(), "yyHHmm") + RandomUtils.number(3, false); + } + + @Override + public void editData(BsMer mer) { + mer.setUpdateTime(new Date()); + if (mer.getId() == null) { + mer.setCreateTime(new Date()); + merMapper.insert(mer); + // 生成商户号 + mer.setMerNo(generateMerNo()); + if (getDetail(mer.getMerNo()) != null) { + editData(mer); + } + merMapper.updateByPrimaryKey(mer); + } else { + merMapper.updateByPrimaryKey(mer); + } + } + + @Override + @Transactional(propagation= Propagation.REQUIRES_NEW,rollbackFor= {RuntimeException.class}) + public void create(BsMerModel mer) throws Exception { + editData(mer); + + if (secUserService.getDetailByLoginName(mer.getLoginName()) != null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "登录账户已存在,请更换"); + } + + SecUser secUser = new SecUser(); + secUser.setUserName(mer.getMerName()); + secUser.setLoginName(mer.getLoginName()); + secUser.setPassword(MD5Util.encode("123456".getBytes())); + secUser.setTelephone(mer.getDirectorTel()); + secUser.setRoleId(mer.getRoleId()); + secUser.setObjectType(SecUserObjectTypeEnum.type2.getCode()); + secUser.setObjectId(mer.getId()); + secUserService.editUser(secUser); + + // 加入缓存 + redisUtil.set(CACHE_MER_KEY, mer); + } + + @Override + @Transactional(propagation= Propagation.REQUIRES_NEW,rollbackFor= {RuntimeException.class}) + public void update(BsMerModel mer) throws Exception { + editData(mer); + + // 查询账户 + SecUser secUser = secUserService.getDetail(SecUserObjectTypeEnum.type2, mer.getId()); + if (secUser == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "商户登录账户数据异常"); + } + secUser.setUserName(mer.getMerName()); + secUser.setTelephone(mer.getDirectorTel()); + secUser.setRoleId(mer.getRoleId()); + secUserService.editUser(secUser); + + // 加入缓存 + redisUtil.set(CACHE_MER_KEY, mer); + } + + @Override + public BsMerModel getDetail(String merNo) { + Object cacheObj = redisUtil.get(CACHE_MER_KEY); + if (cacheObj != null) { + return (BsMerModel) cacheObj; + } + BsMerExample example = new BsMerExample(); + example.createCriteria().andMerNoEqualTo(merNo).andStatusNotEqualTo(MerStatusEnum.status0.getCode()); + List list = merMapper.selectByExample(example); + if (!list.isEmpty()) { + BsMerModel mer = (BsMerModel)list.get(0); + // 查询账户 + SecUser secUser = secUserService.getDetail(SecUserObjectTypeEnum.type2, mer.getId()); + if (secUser != null) { + mer.setLoginName(secUser.getLoginName()); + } + redisUtil.set(CACHE_MER_KEY, mer); + return mer; + } + return null; + } + + @Override + public List getList(Map param) { + BsMerExample example = new BsMerExample(); + BsMerExample.Criteria criteria = example.createCriteria() + .andStatusNotEqualTo(MerStatusEnum.status0.getCode()); + + if (StringUtils.isBlank(MapUtils.getString(param, "merNo"))) { + criteria.andMerNoLike("%"+MapUtils.getString(param, "merNo")+"%"); + } + + if (StringUtils.isBlank(MapUtils.getString(param, "merName"))) { + criteria.andMerNameLike("%"+MapUtils.getString(param, "merName")+"%"); + } + + if (MapUtils.getInteger(param, "status") != null) { + criteria.andStatusEqualTo(MapUtils.getInteger(param, "status")); + } + + example.setOrderByClause("create_time desc"); + return merMapper.selectByExample(example); + } + + +} diff --git a/service/src/main/java/com/hfkj/service/impl/SecDictionaryServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/SecDictionaryServiceImpl.java new file mode 100644 index 0000000..d015640 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/impl/SecDictionaryServiceImpl.java @@ -0,0 +1,59 @@ +package com.hfkj.service.impl; + +import com.hfkj.common.utils.RedisUtil; +import com.hfkj.dao.SecDictionaryMapper; +import com.hfkj.entity.SecDictionary; +import com.hfkj.entity.SecDictionaryExample; +import com.hfkj.service.SecDictionaryService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @className: SecDictionaryServiceImpl + * @author: HuRui + * @date: 2024/4/23 + **/ +@Service("secDictionaryService") +public class SecDictionaryServiceImpl implements SecDictionaryService { + + @Resource + private SecDictionaryMapper secDictionaryMapper; + @Resource + private RedisUtil redisUtil; + // 缓存KEY + private final String cacheKey = "SEC_DICTIONARY"; + + @Override + public List getDictionary() { + Object cache = redisUtil.get(cacheKey); + if (cache != null) { + return (List) cache; + } + SecDictionaryExample example = new SecDictionaryExample(); + example.setOrderByClause("sort_id"); + List list = secDictionaryMapper.selectByExample(example); + redisUtil.set(cacheKey, list); + return list; + } + + @Override + public List getDictionary(String codeType) { + return getDictionary().stream().filter(o -> o.getCodeType().equals(codeType)).collect(Collectors.toList()); + } + + @Override + public SecDictionary getDictionary(String codeType, String codeValue) { + List list = getDictionary().stream() + .filter(o -> o.getCodeType().equals(codeType) && o.getCodeValue().equals(codeValue)) + .collect(Collectors.toList()); + if (!list.isEmpty()) { + return list.get(0); + } else { + return null; + } + } + +} diff --git a/service/src/main/java/com/hfkj/service/impl/SecUserServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/SecUserServiceImpl.java index af841cf..84a833e 100644 --- a/service/src/main/java/com/hfkj/service/impl/SecUserServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/impl/SecUserServiceImpl.java @@ -20,6 +20,7 @@ import com.hfkj.service.SecUserLoginLogService; import com.hfkj.service.SecUserService; import com.hfkj.sysenum.SecMenuTypeEnum; import com.hfkj.sysenum.SecUserLoginLogStatusEnum; +import com.hfkj.sysenum.SecUserObjectTypeEnum; import com.hfkj.sysenum.SecUserStatusEnum; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; @@ -82,6 +83,20 @@ public class SecUserServiceImpl implements SecUserService { return secUserMapper.selectByPrimaryKey(id); } + @Override + public SecUser getDetail(SecUserObjectTypeEnum objectType, Long objectId) { + SecUserExample example = new SecUserExample(); + example.createCriteria() + .andObjectTypeEqualTo(objectType.getCode()) + .andObjectIdEqualTo(objectId) + .andStatusNotEqualTo(SecUserStatusEnum.status0.getCode()); + List list = secUserMapper.selectByExample(example); + if (!list.isEmpty()) { + return list.get(0); + } + return null; + } + @Override public SecUser getDetailByLoginName(String loginName) { SecUserExample example = new SecUserExample(); @@ -110,6 +125,10 @@ public class SecUserServiceImpl implements SecUserService { criteria.andTelephoneLike("%"+MapUtils.getString(param, "telephone")+"%"); } + if (MapUtils.getInteger(param, "objectType") != null) { + criteria.andObjectTypeEqualTo(MapUtils.getInteger(param, "objectType")); + } + if (MapUtils.getInteger(param, "status") != null) { criteria.andStatusEqualTo(MapUtils.getInteger(param, "status")); } diff --git a/service/src/main/java/com/hfkj/sysenum/MerStatusEnum.java b/service/src/main/java/com/hfkj/sysenum/MerStatusEnum.java new file mode 100644 index 0000000..c22f4fe --- /dev/null +++ b/service/src/main/java/com/hfkj/sysenum/MerStatusEnum.java @@ -0,0 +1,47 @@ +package com.hfkj.sysenum; + +/** + * 菜单类型 + * @className: MerStatusEnum + * @author: HuRui + * @date: 2024/4/24 + **/ +public enum MerStatusEnum { + + /** + * 删除 + */ + status0(0, "删除"), + + /** + * 正常 + */ + status1(1, "正常"), + ; + + private int code; + + private String name; + + + MerStatusEnum(int code, String name) { + this.code = code; + this.name = name; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/service/src/main/java/com/hfkj/sysenum/SecUserObjectTypeEnum.java b/service/src/main/java/com/hfkj/sysenum/SecUserObjectTypeEnum.java new file mode 100644 index 0000000..70b811e --- /dev/null +++ b/service/src/main/java/com/hfkj/sysenum/SecUserObjectTypeEnum.java @@ -0,0 +1,47 @@ +package com.hfkj.sysenum; + +/** + * 账户类型 + * @className: SecUserObjectTypeEnum + * @author: HuRui + * @date: 2024/4/23 + **/ +public enum SecUserObjectTypeEnum { + + /** + * 系统账户 + */ + type1(1, "系统账户"), + + /** + * 商户 + */ + type2(2, "商户"), + ; + + private int code; + + private String name; + + + SecUserObjectTypeEnum(int code, String name) { + this.code = code; + this.name = name; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +}