diff --git a/doc/platform.md b/doc/platform.md index 29b5aef1..dc1adbde 100644 --- a/doc/platform.md +++ b/doc/platform.md @@ -463,25 +463,73 @@ litemall_coupon_user表的status字段,包含以后三种状态: 当用户或者管理员上传图像时,图像文件会保存到本地或者第三方云存储服务器中, 同时在存储对象表中记录一下。 -### 2.1.10 通用设计 +### 2.1.10 操作日志设计 + +业务日志表litemall_log记录管理员的关键性操作。 + +需要讨论的是,很多项目的业务日志模块采用注解方式,即加上方法注解,因此可以自动捕获 +用户的操作行为。虽然这样做很方便且不会影响业务代码,但是实际上最终是粗颗粒地记录,反而记录意义不大。 + +因此本项目采用在方法内手写业务日志代码方式记录业务操作行为及结果。 +虽然比较繁琐,但是可以保证记录是细颗粒的。而且,如果管理员最终关心的操作较少,那么 +实际上需要写的代码不是很多。 + +考虑到语义,操作业务应该是“谁做了什么操作,结果成功还是失败,失败原因是什么,补充信息是什么”, +因此这里设计的业务日志表关键字段如下: +* 管理员 +* IP地址 +* 操作分类 +* 操作动作 +* 操作状态 +* 操作结果 +* 补充信息 + +#### 2.1.10.1 操作类别 + +这里的日志类型设计成四种(当然开发者需要可以扩展) +* 一般日志:用户觉得需要查看的一般操作日志,建议是默认的日志级别 +* 安全日志:用户安全相关的操作日志,例如登录、删除管理员 +* 订单日志:用户交易相关的操作日志,例如订单发货、退款 +* 其他日志:如果以上三种不合适,可以选择其他日志,建议是优先级最低的日志级别 + +当然建议开发者应该和最终用户讨论交流,记录真正关键性的业务操作,例如登录相关或订单相关等。 + +#### 2.1.10.2 操作结果 + +如果操作成功,可以使用操作结果字段记录被操作的对象。 +当然,有些操作没有具体对象,那么可以省略。 + +如果操作失败,也可以使用操作结果字段记录失败的原因。 + +#### 2.1.10.3 操作失败 + +虽然这里有操作状态字段和操作结果字段,可以记录操作失败的状态。 +但是通常失败操作不会对系统或者数据库带来影响,因此实际上开发者其实不需要 +记录太多操作失败的日志,而是记录操作成功的日志,告诉系统管理员当前状态的变化。 + +当然,是否记录操作失败取决于开发者或者最终用户是否需要。 +例如,登录这里应该记录用户登录失败的日志,因为保存的IP地址可以帮助管理员了解 +系统被访问的情况。 + +### 2.1.11 通用设计 除了以上表,数据库还存在其他一些业务表,例如专题表litemall_topic, 但是都很直观,不需要多讨论。 以下是一些表设计中无具体业务意义可通用的字段。 -#### 2.1.10.1 deleted +#### 2.1.11.1 deleted 除极少数表,其他所有表都存在`deleted`字段,支持逻辑删除。 因此目前删除数据时,不会直接删除数据,而是修改`deleted`字段。 当然,数据库管理员可以连接到数据库直接删除数据,或者开发者 可以修改这里的逻辑采用物理删除。 -#### 2.1.10.2 add_time +#### 2.1.11.2 add_time 除极少数表,其他所有表都存在`add_time`字段,记录数据创建时间。 -#### 2.1.10.3 update_time +#### 2.1.11.3 update_time 除极少数表,其他所有表都存在`update_time`字段,记录数据修改时间。 diff --git a/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/service/AdminOrderService.java b/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/service/AdminOrderService.java index 92cc8845..e361922c 100644 --- a/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/service/AdminOrderService.java +++ b/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/service/AdminOrderService.java @@ -49,6 +49,8 @@ public class AdminOrderService { private WxPayService wxPayService; @Autowired private NotifyService notifyService; + @Autowired + private LogHelper logHelper; public Object list(Integer userId, String orderSn, List orderStatusArray, Integer page, Integer limit, String sort, String order) { @@ -161,6 +163,7 @@ public class AdminOrderService { // 注意订单号只发后6位 notifyService.notifySmsTemplate(order.getMobile(), NotifyType.REFUND, new String[]{order.getOrderSn().substring(8, 14)}); + logHelper.logOrderSucceed("退款", "订单编号 " + orderId); return ResponseUtil.ok(); } @@ -205,6 +208,7 @@ public class AdminOrderService { // "您的订单已经发货,快递公司 {1},快递单 {2} ,请注意查收" notifyService.notifySmsTemplate(order.getMobile(), NotifyType.SHIP, new String[]{shipChannel, shipSn}); + logHelper.logOrderSucceed("发货", "订单编号 " + orderId); return ResponseUtil.ok(); } diff --git a/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/service/LogHelper.java b/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/service/LogHelper.java new file mode 100644 index 00000000..445cc29f --- /dev/null +++ b/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/service/LogHelper.java @@ -0,0 +1,114 @@ +package org.linlinjava.litemall.admin.service; + +import org.apache.shiro.SecurityUtils; +import org.apache.shiro.subject.Subject; +import org.linlinjava.litemall.core.util.IpUtil; +import org.linlinjava.litemall.db.domain.LitemallAdmin; +import org.linlinjava.litemall.db.domain.LitemallLog; +import org.linlinjava.litemall.db.service.LitemallLogService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; + +/** + * 这里的日志类型设计成四种(当然开发者需要可以自己扩展) + * 一般日志:用户觉得需要查看的一般操作日志,建议是默认的日志级别 + * 安全日志:用户安全相关的操作日志,例如登录、删除管理员 + * 订单日志:用户交易相关的操作日志,例如订单发货、退款 + * 其他日志:如果以上三种不合适,可以选择其他日志,建议是优先级最低的日志级别 + * + * 当然可能很多操作是不需要记录到数据库的,例如编辑商品、编辑广告品之类。 + */ +@Component +public class LogHelper { + public final static Integer LOG_TYPE_GENERAL = 0; + public final static Integer LOG_TYPE_AUTH = 1; + public final static Integer LOG_TYPE_ORDER = 2; + public final static Integer LOG_TYPE_OTHER = 3; + + @Autowired + private LitemallLogService logService; + + public void logGeneralSucceed(String action){ + logAdmin(LOG_TYPE_GENERAL, action, true, "", ""); + } + + public void logGeneralSucceed(String action, String result){ + logAdmin(LOG_TYPE_GENERAL, action, true, result, ""); + } + + public void logGeneralFail(String action, String error){ + logAdmin(LOG_TYPE_GENERAL, action, false, error, ""); + } + + public void logAuthSucceed(String action){ + logAdmin(LOG_TYPE_AUTH, action, true, "", ""); + } + + public void logAuthSucceed(String action, String result){ + logAdmin(LOG_TYPE_AUTH, action, true, result, ""); + } + + public void logAuthFail(String action, String error){ + logAdmin(LOG_TYPE_AUTH, action, false, error, ""); + } + + public void logOrderSucceed(String action){ + logAdmin(LOG_TYPE_ORDER, action, true, "", ""); + } + + public void logOrderSucceed(String action, String result){ + logAdmin(LOG_TYPE_ORDER, action, true, result, ""); + } + + public void logOrderFail(String action, String error){ + logAdmin(LOG_TYPE_ORDER, action, false, error, ""); + } + + public void logOtherSucceed(String action){ + logAdmin(LOG_TYPE_OTHER, action, true, "", ""); + } + + public void logOtherSucceed(String action, String result){ + logAdmin(LOG_TYPE_OTHER, action, true, result, ""); + } + + + public void logOtherFail(String action, String error){ + logAdmin(LOG_TYPE_OTHER, action, false, error, ""); + } + + public void logAdmin (Integer type, String action, Boolean succeed, String result, String comment){ + LitemallLog log = new LitemallLog(); + + Subject currentUser = SecurityUtils.getSubject(); + if(currentUser != null) { + LitemallAdmin admin = (LitemallAdmin) currentUser.getPrincipal(); + if(admin != null) { + log.setAdmin(admin.getUsername()); + } + else{ + log.setAdmin("匿名用户"); + } + } + else{ + log.setAdmin("匿名用户"); + } + + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + if(request != null) { + log.setIp(IpUtil.getIpAddr(request)); + } + + log.setType(type); + log.setAction(action); + log.setStatus(succeed); + log.setResult(result); + log.setComment(comment); + logService.add(log); + } + +} diff --git a/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminAdminController.java b/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminAdminController.java index ea374536..b18ed640 100644 --- a/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminAdminController.java +++ b/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminAdminController.java @@ -5,6 +5,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.linlinjava.litemall.admin.annotation.RequiresPermissionsDesc; +import org.linlinjava.litemall.admin.service.LogHelper; import org.linlinjava.litemall.core.util.RegexUtil; import org.linlinjava.litemall.core.util.ResponseUtil; import org.linlinjava.litemall.core.util.bcrypt.BCryptPasswordEncoder; @@ -32,6 +33,8 @@ public class AdminAdminController { @Autowired private LitemallAdminService adminService; + @Autowired + private LogHelper logHelper; @RequiresPermissions("admin:admin:list") @RequiresPermissionsDesc(menu={"系统管理" , "管理员管理"}, button="查询") @@ -85,6 +88,7 @@ public class AdminAdminController { String encodedPassword = encoder.encode(rawPassword); admin.setPassword(encodedPassword); adminService.add(admin); + logHelper.logAuthSucceed("添加管理员", username); return ResponseUtil.ok(admin); } @@ -119,6 +123,7 @@ public class AdminAdminController { return ResponseUtil.updatedDataFailed(); } + logHelper.logAuthSucceed("编辑管理员", admin.getUsername()); return ResponseUtil.ok(admin); } @@ -132,6 +137,7 @@ public class AdminAdminController { } adminService.deleteById(anotherAdminId); + logHelper.logAuthSucceed("删除管理员", admin.getUsername()); return ResponseUtil.ok(); } } diff --git a/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminAuthController.java b/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminAuthController.java index c0834414..1e2c1fe2 100644 --- a/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminAuthController.java +++ b/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminAuthController.java @@ -9,12 +9,15 @@ import org.apache.shiro.authc.UnknownAccountException; import org.apache.shiro.authc.UsernamePasswordToken; import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.shiro.subject.Subject; +import org.linlinjava.litemall.admin.service.LogHelper; import org.linlinjava.litemall.admin.util.Permission; import org.linlinjava.litemall.admin.util.PermissionUtil; import org.linlinjava.litemall.core.util.JacksonUtil; import org.linlinjava.litemall.core.util.ResponseUtil; import org.linlinjava.litemall.db.domain.LitemallAdmin; +import org.linlinjava.litemall.db.domain.LitemallLog; import org.linlinjava.litemall.db.service.LitemallAdminService; +import org.linlinjava.litemall.db.service.LitemallLogService; import org.linlinjava.litemall.db.service.LitemallPermissionService; import org.linlinjava.litemall.db.service.LitemallRoleService; import org.springframework.beans.factory.annotation.Autowired; @@ -39,6 +42,8 @@ public class AdminAuthController { private LitemallRoleService roleService; @Autowired private LitemallPermissionService permissionService; + @Autowired + private LogHelper logHelper; /* * { username : value, password : value } @@ -56,13 +61,18 @@ public class AdminAuthController { try { currentUser.login(new UsernamePasswordToken(username, password)); } catch (UnknownAccountException uae) { + logHelper.logAuthFail("登录", "用户帐号或密码不正确"); return ResponseUtil.fail(ADMIN_INVALID_ACCOUNT, "用户帐号或密码不正确"); } catch (LockedAccountException lae) { + logHelper.logAuthFail("登录", "用户帐号已锁定不可用"); return ResponseUtil.fail(ADMIN_INVALID_ACCOUNT, "用户帐号已锁定不可用"); } catch (AuthenticationException ae) { + logHelper.logAuthFail("登录", "认证失败"); return ResponseUtil.fail(ADMIN_INVALID_ACCOUNT, "认证失败"); } + + logHelper.logAuthSucceed("登录"); return ResponseUtil.ok(currentUser.getSession().getId()); } @@ -73,6 +83,8 @@ public class AdminAuthController { @PostMapping("/logout") public Object login() { Subject currentUser = SecurityUtils.getSubject(); + + logHelper.logAuthSucceed("退出"); currentUser.logout(); return ResponseUtil.ok(); } diff --git a/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminLogController.java b/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminLogController.java new file mode 100644 index 00000000..bb72eddf --- /dev/null +++ b/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminLogController.java @@ -0,0 +1,47 @@ +package org.linlinjava.litemall.admin.web; + +import com.github.pagehelper.PageInfo; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.linlinjava.litemall.admin.annotation.RequiresPermissionsDesc; +import org.linlinjava.litemall.core.util.ResponseUtil; +import org.linlinjava.litemall.core.validator.Order; +import org.linlinjava.litemall.core.validator.Sort; +import org.linlinjava.litemall.db.domain.LitemallLog; +import org.linlinjava.litemall.db.service.LitemallLogService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.validation.constraints.NotNull; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/admin/log") +@Validated +public class AdminLogController { + private final Log logger = LogFactory.getLog(AdminLogController.class); + + @Autowired + private LitemallLogService logService; + + @RequiresPermissions("admin:log:list") + @RequiresPermissionsDesc(menu={"系统管理" , "操作日志"}, button="查询") + @GetMapping("/list") + public Object list(String name, + @RequestParam(defaultValue = "1") Integer page, + @RequestParam(defaultValue = "10") Integer limit, + @Sort @RequestParam(defaultValue = "add_time") String sort, + @Order @RequestParam(defaultValue = "desc") String order) { + List logList = logService.querySelective(name, page, limit, sort, order); + long total = PageInfo.of(logList).getTotal(); + Map data = new HashMap<>(); + data.put("total", total); + data.put("items", logList); + + return ResponseUtil.ok(data); + } +} diff --git a/litemall-admin/src/api/log.js b/litemall-admin/src/api/log.js new file mode 100644 index 00000000..0b69a8fb --- /dev/null +++ b/litemall-admin/src/api/log.js @@ -0,0 +1,9 @@ +import request from '@/utils/request' + +export function listLog(query) { + return request({ + url: '/log/list', + method: 'get', + params: query + }) +} diff --git a/litemall-admin/src/router/index.js b/litemall-admin/src/router/index.js index bbc054bd..ab5c8508 100644 --- a/litemall-admin/src/router/index.js +++ b/litemall-admin/src/router/index.js @@ -375,6 +375,16 @@ export const asyncRouterMap = [ noCache: true } }, + { + path: 'log', + component: () => import('@/views/sys/log'), + name: 'log', + meta: { + perms: ['GET /admin/admin/log'], + title: '操作日志', + noCache: true + } + }, { path: 'role', component: () => import('@/views/sys/role'), diff --git a/litemall-admin/src/views/sys/log.vue b/litemall-admin/src/views/sys/log.vue new file mode 100644 index 00000000..e6708be8 --- /dev/null +++ b/litemall-admin/src/views/sys/log.vue @@ -0,0 +1,98 @@ + + + diff --git a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/util/IpUtil.java b/litemall-core/src/main/java/org/linlinjava/litemall/core/util/IpUtil.java similarity index 87% rename from litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/util/IpUtil.java rename to litemall-core/src/main/java/org/linlinjava/litemall/core/util/IpUtil.java index 6774697d..2618bbd8 100644 --- a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/util/IpUtil.java +++ b/litemall-core/src/main/java/org/linlinjava/litemall/core/util/IpUtil.java @@ -1,4 +1,4 @@ -package org.linlinjava.litemall.wx.util; +package org.linlinjava.litemall.core.util; import javax.servlet.http.HttpServletRequest; import java.net.InetAddress; @@ -8,13 +8,6 @@ import java.net.UnknownHostException; * IP地址相关工具类 */ public class IpUtil { - public static String client(HttpServletRequest request) { - String xff = request.getHeader("x-forwarded-for"); - if (xff == null) { - xff = request.getRemoteAddr(); - } - return xff; - } public static String getIpAddr(HttpServletRequest request) { String ipAddress = null; diff --git a/litemall-db/mybatis-generator/generatorConfig.xml b/litemall-db/mybatis-generator/generatorConfig.xml index 6c1502c5..5290ad69 100644 --- a/litemall-db/mybatis-generator/generatorConfig.xml +++ b/litemall-db/mybatis-generator/generatorConfig.xml @@ -174,5 +174,8 @@
+ + +
\ No newline at end of file diff --git a/litemall-db/src/main/java/org/linlinjava/litemall/db/dao/LitemallLogMapper.java b/litemall-db/src/main/java/org/linlinjava/litemall/db/dao/LitemallLogMapper.java new file mode 100644 index 00000000..30da82ea --- /dev/null +++ b/litemall-db/src/main/java/org/linlinjava/litemall/db/dao/LitemallLogMapper.java @@ -0,0 +1,159 @@ +package org.linlinjava.litemall.db.dao; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import org.linlinjava.litemall.db.domain.LitemallLog; +import org.linlinjava.litemall.db.domain.LitemallLogExample; + +public interface LitemallLogMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + */ + long countByExample(LitemallLogExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + */ + int deleteByExample(LitemallLogExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + */ + int deleteByPrimaryKey(Integer id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + */ + int insert(LitemallLog record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + */ + int insertSelective(LitemallLog record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + LitemallLog selectOneByExample(LitemallLogExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + LitemallLog selectOneByExampleSelective(@Param("example") LitemallLogExample example, @Param("selective") LitemallLog.Column ... selective); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + List selectByExampleSelective(@Param("example") LitemallLogExample example, @Param("selective") LitemallLog.Column ... selective); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + */ + List selectByExample(LitemallLogExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + LitemallLog selectByPrimaryKeySelective(@Param("id") Integer id, @Param("selective") LitemallLog.Column ... selective); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + */ + LitemallLog selectByPrimaryKey(Integer id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + LitemallLog selectByPrimaryKeyWithLogicalDelete(@Param("id") Integer id, @Param("andLogicalDeleted") boolean andLogicalDeleted); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") LitemallLog record, @Param("example") LitemallLogExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + */ + int updateByExample(@Param("record") LitemallLog record, @Param("example") LitemallLogExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + */ + int updateByPrimaryKeySelective(LitemallLog record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + */ + int updateByPrimaryKey(LitemallLog record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + int logicalDeleteByExample(@Param("example") LitemallLogExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + int logicalDeleteByPrimaryKey(Integer id); +} \ No newline at end of file diff --git a/litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallLog.java b/litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallLog.java new file mode 100644 index 00000000..6d714482 --- /dev/null +++ b/litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallLog.java @@ -0,0 +1,666 @@ +package org.linlinjava.litemall.db.domain; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Arrays; + +public class LitemallLog { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public static final Boolean NOT_DELETED = false; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public static final Boolean IS_DELETED = true; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_log.id + * + * @mbg.generated + */ + private Integer id; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_log.admin + * + * @mbg.generated + */ + private String admin; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_log.ip + * + * @mbg.generated + */ + private String ip; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_log.type + * + * @mbg.generated + */ + private Integer type; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_log.action + * + * @mbg.generated + */ + private String action; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_log.status + * + * @mbg.generated + */ + private Boolean status; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_log.result + * + * @mbg.generated + */ + private String result; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_log.comment + * + * @mbg.generated + */ + private String comment; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_log.add_time + * + * @mbg.generated + */ + private LocalDateTime addTime; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_log.update_time + * + * @mbg.generated + */ + private LocalDateTime updateTime; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column litemall_log.deleted + * + * @mbg.generated + */ + private Boolean deleted; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_log.id + * + * @return the value of litemall_log.id + * + * @mbg.generated + */ + public Integer getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_log.id + * + * @param id the value for litemall_log.id + * + * @mbg.generated + */ + public void setId(Integer id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_log.admin + * + * @return the value of litemall_log.admin + * + * @mbg.generated + */ + public String getAdmin() { + return admin; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_log.admin + * + * @param admin the value for litemall_log.admin + * + * @mbg.generated + */ + public void setAdmin(String admin) { + this.admin = admin; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_log.ip + * + * @return the value of litemall_log.ip + * + * @mbg.generated + */ + public String getIp() { + return ip; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_log.ip + * + * @param ip the value for litemall_log.ip + * + * @mbg.generated + */ + public void setIp(String ip) { + this.ip = ip; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_log.type + * + * @return the value of litemall_log.type + * + * @mbg.generated + */ + public Integer getType() { + return type; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_log.type + * + * @param type the value for litemall_log.type + * + * @mbg.generated + */ + public void setType(Integer type) { + this.type = type; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_log.action + * + * @return the value of litemall_log.action + * + * @mbg.generated + */ + public String getAction() { + return action; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_log.action + * + * @param action the value for litemall_log.action + * + * @mbg.generated + */ + public void setAction(String action) { + this.action = action; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_log.status + * + * @return the value of litemall_log.status + * + * @mbg.generated + */ + public Boolean getStatus() { + return status; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_log.status + * + * @param status the value for litemall_log.status + * + * @mbg.generated + */ + public void setStatus(Boolean status) { + this.status = status; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_log.result + * + * @return the value of litemall_log.result + * + * @mbg.generated + */ + public String getResult() { + return result; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_log.result + * + * @param result the value for litemall_log.result + * + * @mbg.generated + */ + public void setResult(String result) { + this.result = result; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_log.comment + * + * @return the value of litemall_log.comment + * + * @mbg.generated + */ + public String getComment() { + return comment; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_log.comment + * + * @param comment the value for litemall_log.comment + * + * @mbg.generated + */ + public void setComment(String comment) { + this.comment = comment; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_log.add_time + * + * @return the value of litemall_log.add_time + * + * @mbg.generated + */ + public LocalDateTime getAddTime() { + return addTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_log.add_time + * + * @param addTime the value for litemall_log.add_time + * + * @mbg.generated + */ + public void setAddTime(LocalDateTime addTime) { + this.addTime = addTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_log.update_time + * + * @return the value of litemall_log.update_time + * + * @mbg.generated + */ + public LocalDateTime getUpdateTime() { + return updateTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_log.update_time + * + * @param updateTime the value for litemall_log.update_time + * + * @mbg.generated + */ + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column litemall_log.deleted + * + * @return the value of litemall_log.deleted + * + * @mbg.generated + */ + public Boolean getDeleted() { + return deleted; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column litemall_log.deleted + * + * @param deleted the value for litemall_log.deleted + * + * @mbg.generated + */ + public void setDeleted(Boolean deleted) { + this.deleted = deleted; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + */ + @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(", admin=").append(admin); + sb.append(", ip=").append(ip); + sb.append(", type=").append(type); + sb.append(", action=").append(action); + sb.append(", status=").append(status); + sb.append(", result=").append(result); + sb.append(", comment=").append(comment); + sb.append(", addTime=").append(addTime); + sb.append(", updateTime=").append(updateTime); + sb.append(", deleted=").append(deleted); + sb.append("]"); + return sb.toString(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + */ + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + LitemallLog other = (LitemallLog) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getAdmin() == null ? other.getAdmin() == null : this.getAdmin().equals(other.getAdmin())) + && (this.getIp() == null ? other.getIp() == null : this.getIp().equals(other.getIp())) + && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) + && (this.getAction() == null ? other.getAction() == null : this.getAction().equals(other.getAction())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getResult() == null ? other.getResult() == null : this.getResult().equals(other.getResult())) + && (this.getComment() == null ? other.getComment() == null : this.getComment().equals(other.getComment())) + && (this.getAddTime() == null ? other.getAddTime() == null : this.getAddTime().equals(other.getAddTime())) + && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) + && (this.getDeleted() == null ? other.getDeleted() == null : this.getDeleted().equals(other.getDeleted())); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + */ + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getAdmin() == null) ? 0 : getAdmin().hashCode()); + result = prime * result + ((getIp() == null) ? 0 : getIp().hashCode()); + result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); + result = prime * result + ((getAction() == null) ? 0 : getAction().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((getResult() == null) ? 0 : getResult().hashCode()); + result = prime * result + ((getComment() == null) ? 0 : getComment().hashCode()); + result = prime * result + ((getAddTime() == null) ? 0 : getAddTime().hashCode()); + result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); + result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode()); + return result; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public void andLogicalDeleted(boolean deleted) { + setDeleted(deleted ? IS_DELETED : NOT_DELETED); + } + + /** + * This enum was generated by MyBatis Generator. + * This enum corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public enum Column { + id("id", "id", "INTEGER", false), + admin("admin", "admin", "VARCHAR", true), + ip("ip", "ip", "VARCHAR", false), + type("type", "type", "INTEGER", true), + action("action", "action", "VARCHAR", true), + status("status", "status", "BIT", true), + result("result", "result", "VARCHAR", true), + comment("comment", "comment", "VARCHAR", true), + addTime("add_time", "addTime", "TIMESTAMP", false), + updateTime("update_time", "updateTime", "TIMESTAMP", false), + deleted("deleted", "deleted", "BIT", false); + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + private static final String BEGINNING_DELIMITER = "`"; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + private static final String ENDING_DELIMITER = "`"; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + private final String column; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + private final boolean isColumnNameDelimited; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + private final String javaProperty; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + private final String jdbcType; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public String value() { + return this.column; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public String getValue() { + return this.column; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public String getJavaProperty() { + return this.javaProperty; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public String getJdbcType() { + return this.jdbcType; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + } +} \ No newline at end of file diff --git a/litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallLogExample.java b/litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallLogExample.java new file mode 100644 index 00000000..f2250ba0 --- /dev/null +++ b/litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallLogExample.java @@ -0,0 +1,1918 @@ +package org.linlinjava.litemall.db.domain; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +public class LitemallLogExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_log + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_log + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_log + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + */ + public LitemallLogExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public LitemallLogExample orderBy(String orderByClause) { + this.setOrderByClause(orderByClause); + return this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public LitemallLogExample orderBy(String ... orderByClauses) { + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < orderByClauses.length; i++) { + sb.append(orderByClauses[i]); + if (i < orderByClauses.length - 1) { + sb.append(" , "); + } + } + this.setOrderByClause(sb.toString()); + return this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(this); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public static Criteria newAndCreateCriteria() { + LitemallLogExample example = new LitemallLogExample(); + return example.createCriteria(); + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table litemall_log + * + * @mbg.generated + */ + 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(Integer value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andIdEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("id = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Integer value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andIdNotEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("id <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Integer value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andIdGreaterThanColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("id > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Integer value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andIdGreaterThanOrEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("id >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andIdLessThan(Integer value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andIdLessThanColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("id < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Integer value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andIdLessThanOrEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("id <= ").append(column.getEscapedColumnName()).toString()); + 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(Integer value1, Integer value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Integer value1, Integer value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andAdminIsNull() { + addCriterion("`admin` is null"); + return (Criteria) this; + } + + public Criteria andAdminIsNotNull() { + addCriterion("`admin` is not null"); + return (Criteria) this; + } + + public Criteria andAdminEqualTo(String value) { + addCriterion("`admin` =", value, "admin"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andAdminEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`admin` = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andAdminNotEqualTo(String value) { + addCriterion("`admin` <>", value, "admin"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andAdminNotEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`admin` <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andAdminGreaterThan(String value) { + addCriterion("`admin` >", value, "admin"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andAdminGreaterThanColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`admin` > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andAdminGreaterThanOrEqualTo(String value) { + addCriterion("`admin` >=", value, "admin"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andAdminGreaterThanOrEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`admin` >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andAdminLessThan(String value) { + addCriterion("`admin` <", value, "admin"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andAdminLessThanColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`admin` < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andAdminLessThanOrEqualTo(String value) { + addCriterion("`admin` <=", value, "admin"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andAdminLessThanOrEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`admin` <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andAdminLike(String value) { + addCriterion("`admin` like", value, "admin"); + return (Criteria) this; + } + + public Criteria andAdminNotLike(String value) { + addCriterion("`admin` not like", value, "admin"); + return (Criteria) this; + } + + public Criteria andAdminIn(List values) { + addCriterion("`admin` in", values, "admin"); + return (Criteria) this; + } + + public Criteria andAdminNotIn(List values) { + addCriterion("`admin` not in", values, "admin"); + return (Criteria) this; + } + + public Criteria andAdminBetween(String value1, String value2) { + addCriterion("`admin` between", value1, value2, "admin"); + return (Criteria) this; + } + + public Criteria andAdminNotBetween(String value1, String value2) { + addCriterion("`admin` not between", value1, value2, "admin"); + return (Criteria) this; + } + + public Criteria andIpIsNull() { + addCriterion("ip is null"); + return (Criteria) this; + } + + public Criteria andIpIsNotNull() { + addCriterion("ip is not null"); + return (Criteria) this; + } + + public Criteria andIpEqualTo(String value) { + addCriterion("ip =", value, "ip"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andIpEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("ip = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andIpNotEqualTo(String value) { + addCriterion("ip <>", value, "ip"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andIpNotEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("ip <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andIpGreaterThan(String value) { + addCriterion("ip >", value, "ip"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andIpGreaterThanColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("ip > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andIpGreaterThanOrEqualTo(String value) { + addCriterion("ip >=", value, "ip"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andIpGreaterThanOrEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("ip >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andIpLessThan(String value) { + addCriterion("ip <", value, "ip"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andIpLessThanColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("ip < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andIpLessThanOrEqualTo(String value) { + addCriterion("ip <=", value, "ip"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andIpLessThanOrEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("ip <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andIpLike(String value) { + addCriterion("ip like", value, "ip"); + return (Criteria) this; + } + + public Criteria andIpNotLike(String value) { + addCriterion("ip not like", value, "ip"); + return (Criteria) this; + } + + public Criteria andIpIn(List values) { + addCriterion("ip in", values, "ip"); + return (Criteria) this; + } + + public Criteria andIpNotIn(List values) { + addCriterion("ip not in", values, "ip"); + return (Criteria) this; + } + + public Criteria andIpBetween(String value1, String value2) { + addCriterion("ip between", value1, value2, "ip"); + return (Criteria) this; + } + + public Criteria andIpNotBetween(String value1, String value2) { + addCriterion("ip not between", value1, value2, "ip"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("`type` is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("`type` is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(Integer value) { + addCriterion("`type` =", value, "type"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andTypeEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`type` = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(Integer value) { + addCriterion("`type` <>", value, "type"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andTypeNotEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`type` <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(Integer value) { + addCriterion("`type` >", value, "type"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andTypeGreaterThanColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`type` > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("`type` >=", value, "type"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andTypeGreaterThanOrEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`type` >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andTypeLessThan(Integer value) { + addCriterion("`type` <", value, "type"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andTypeLessThanColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`type` < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(Integer value) { + addCriterion("`type` <=", value, "type"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andTypeLessThanOrEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`type` <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("`type` in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("`type` not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(Integer value1, Integer value2) { + addCriterion("`type` between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(Integer value1, Integer value2) { + addCriterion("`type` not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andActionIsNull() { + addCriterion("`action` is null"); + return (Criteria) this; + } + + public Criteria andActionIsNotNull() { + addCriterion("`action` is not null"); + return (Criteria) this; + } + + public Criteria andActionEqualTo(String value) { + addCriterion("`action` =", value, "action"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andActionEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`action` = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andActionNotEqualTo(String value) { + addCriterion("`action` <>", value, "action"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andActionNotEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`action` <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andActionGreaterThan(String value) { + addCriterion("`action` >", value, "action"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andActionGreaterThanColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`action` > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andActionGreaterThanOrEqualTo(String value) { + addCriterion("`action` >=", value, "action"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andActionGreaterThanOrEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`action` >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andActionLessThan(String value) { + addCriterion("`action` <", value, "action"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andActionLessThanColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`action` < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andActionLessThanOrEqualTo(String value) { + addCriterion("`action` <=", value, "action"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andActionLessThanOrEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`action` <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andActionLike(String value) { + addCriterion("`action` like", value, "action"); + return (Criteria) this; + } + + public Criteria andActionNotLike(String value) { + addCriterion("`action` not like", value, "action"); + return (Criteria) this; + } + + public Criteria andActionIn(List values) { + addCriterion("`action` in", values, "action"); + return (Criteria) this; + } + + public Criteria andActionNotIn(List values) { + addCriterion("`action` not in", values, "action"); + return (Criteria) this; + } + + public Criteria andActionBetween(String value1, String value2) { + addCriterion("`action` between", value1, value2, "action"); + return (Criteria) this; + } + + public Criteria andActionNotBetween(String value1, String value2) { + addCriterion("`action` not between", value1, value2, "action"); + 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(Boolean value) { + addCriterion("`status` =", value, "status"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andStatusEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`status` = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Boolean value) { + addCriterion("`status` <>", value, "status"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andStatusNotEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`status` <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Boolean value) { + addCriterion("`status` >", value, "status"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andStatusGreaterThanColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`status` > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Boolean value) { + addCriterion("`status` >=", value, "status"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andStatusGreaterThanOrEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`status` >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Boolean value) { + addCriterion("`status` <", value, "status"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andStatusLessThanColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`status` < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Boolean value) { + addCriterion("`status` <=", value, "status"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andStatusLessThanOrEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`status` <= ").append(column.getEscapedColumnName()).toString()); + 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(Boolean value1, Boolean value2) { + addCriterion("`status` between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Boolean value1, Boolean value2) { + addCriterion("`status` not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andResultIsNull() { + addCriterion("`result` is null"); + return (Criteria) this; + } + + public Criteria andResultIsNotNull() { + addCriterion("`result` is not null"); + return (Criteria) this; + } + + public Criteria andResultEqualTo(String value) { + addCriterion("`result` =", value, "result"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andResultEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`result` = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andResultNotEqualTo(String value) { + addCriterion("`result` <>", value, "result"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andResultNotEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`result` <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andResultGreaterThan(String value) { + addCriterion("`result` >", value, "result"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andResultGreaterThanColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`result` > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andResultGreaterThanOrEqualTo(String value) { + addCriterion("`result` >=", value, "result"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andResultGreaterThanOrEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`result` >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andResultLessThan(String value) { + addCriterion("`result` <", value, "result"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andResultLessThanColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`result` < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andResultLessThanOrEqualTo(String value) { + addCriterion("`result` <=", value, "result"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andResultLessThanOrEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`result` <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andResultLike(String value) { + addCriterion("`result` like", value, "result"); + return (Criteria) this; + } + + public Criteria andResultNotLike(String value) { + addCriterion("`result` not like", value, "result"); + return (Criteria) this; + } + + public Criteria andResultIn(List values) { + addCriterion("`result` in", values, "result"); + return (Criteria) this; + } + + public Criteria andResultNotIn(List values) { + addCriterion("`result` not in", values, "result"); + return (Criteria) this; + } + + public Criteria andResultBetween(String value1, String value2) { + addCriterion("`result` between", value1, value2, "result"); + return (Criteria) this; + } + + public Criteria andResultNotBetween(String value1, String value2) { + addCriterion("`result` not between", value1, value2, "result"); + return (Criteria) this; + } + + public Criteria andCommentIsNull() { + addCriterion("`comment` is null"); + return (Criteria) this; + } + + public Criteria andCommentIsNotNull() { + addCriterion("`comment` is not null"); + return (Criteria) this; + } + + public Criteria andCommentEqualTo(String value) { + addCriterion("`comment` =", value, "comment"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andCommentEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`comment` = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andCommentNotEqualTo(String value) { + addCriterion("`comment` <>", value, "comment"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andCommentNotEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`comment` <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andCommentGreaterThan(String value) { + addCriterion("`comment` >", value, "comment"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andCommentGreaterThanColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`comment` > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andCommentGreaterThanOrEqualTo(String value) { + addCriterion("`comment` >=", value, "comment"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andCommentGreaterThanOrEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`comment` >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andCommentLessThan(String value) { + addCriterion("`comment` <", value, "comment"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andCommentLessThanColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`comment` < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andCommentLessThanOrEqualTo(String value) { + addCriterion("`comment` <=", value, "comment"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andCommentLessThanOrEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("`comment` <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andCommentLike(String value) { + addCriterion("`comment` like", value, "comment"); + return (Criteria) this; + } + + public Criteria andCommentNotLike(String value) { + addCriterion("`comment` not like", value, "comment"); + return (Criteria) this; + } + + public Criteria andCommentIn(List values) { + addCriterion("`comment` in", values, "comment"); + return (Criteria) this; + } + + public Criteria andCommentNotIn(List values) { + addCriterion("`comment` not in", values, "comment"); + return (Criteria) this; + } + + public Criteria andCommentBetween(String value1, String value2) { + addCriterion("`comment` between", value1, value2, "comment"); + return (Criteria) this; + } + + public Criteria andCommentNotBetween(String value1, String value2) { + addCriterion("`comment` not between", value1, value2, "comment"); + return (Criteria) this; + } + + public Criteria andAddTimeIsNull() { + addCriterion("add_time is null"); + return (Criteria) this; + } + + public Criteria andAddTimeIsNotNull() { + addCriterion("add_time is not null"); + return (Criteria) this; + } + + public Criteria andAddTimeEqualTo(LocalDateTime value) { + addCriterion("add_time =", value, "addTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andAddTimeEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("add_time = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andAddTimeNotEqualTo(LocalDateTime value) { + addCriterion("add_time <>", value, "addTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andAddTimeNotEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("add_time <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andAddTimeGreaterThan(LocalDateTime value) { + addCriterion("add_time >", value, "addTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andAddTimeGreaterThanColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("add_time > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andAddTimeGreaterThanOrEqualTo(LocalDateTime value) { + addCriterion("add_time >=", value, "addTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andAddTimeGreaterThanOrEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("add_time >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andAddTimeLessThan(LocalDateTime value) { + addCriterion("add_time <", value, "addTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andAddTimeLessThanColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("add_time < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andAddTimeLessThanOrEqualTo(LocalDateTime value) { + addCriterion("add_time <=", value, "addTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andAddTimeLessThanOrEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("add_time <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andAddTimeIn(List values) { + addCriterion("add_time in", values, "addTime"); + return (Criteria) this; + } + + public Criteria andAddTimeNotIn(List values) { + addCriterion("add_time not in", values, "addTime"); + return (Criteria) this; + } + + public Criteria andAddTimeBetween(LocalDateTime value1, LocalDateTime value2) { + addCriterion("add_time between", value1, value2, "addTime"); + return (Criteria) this; + } + + public Criteria andAddTimeNotBetween(LocalDateTime value1, LocalDateTime value2) { + addCriterion("add_time not between", value1, value2, "addTime"); + 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(LocalDateTime value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andUpdateTimeEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("update_time = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(LocalDateTime value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andUpdateTimeNotEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("update_time <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(LocalDateTime value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andUpdateTimeGreaterThanColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("update_time > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(LocalDateTime value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andUpdateTimeGreaterThanOrEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("update_time >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(LocalDateTime value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andUpdateTimeLessThanColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("update_time < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(LocalDateTime value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andUpdateTimeLessThanOrEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("update_time <= ").append(column.getEscapedColumnName()).toString()); + 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(LocalDateTime value1, LocalDateTime value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(LocalDateTime value1, LocalDateTime value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andDeletedIsNull() { + addCriterion("deleted is null"); + return (Criteria) this; + } + + public Criteria andDeletedIsNotNull() { + addCriterion("deleted is not null"); + return (Criteria) this; + } + + public Criteria andDeletedEqualTo(Boolean value) { + addCriterion("deleted =", value, "deleted"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDeletedEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("deleted = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDeletedNotEqualTo(Boolean value) { + addCriterion("deleted <>", value, "deleted"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDeletedNotEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("deleted <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDeletedGreaterThan(Boolean value) { + addCriterion("deleted >", value, "deleted"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDeletedGreaterThanColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("deleted > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDeletedGreaterThanOrEqualTo(Boolean value) { + addCriterion("deleted >=", value, "deleted"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDeletedGreaterThanOrEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("deleted >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDeletedLessThan(Boolean value) { + addCriterion("deleted <", value, "deleted"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDeletedLessThanColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("deleted < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDeletedLessThanOrEqualTo(Boolean value) { + addCriterion("deleted <=", value, "deleted"); + return (Criteria) this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andDeletedLessThanOrEqualToColumn(LitemallLog.Column column) { + addCriterion(new StringBuilder("deleted <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDeletedIn(List values) { + addCriterion("deleted in", values, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedNotIn(List values) { + addCriterion("deleted not in", values, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedBetween(Boolean value1, Boolean value2) { + addCriterion("deleted between", value1, value2, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedNotBetween(Boolean value1, Boolean value2) { + addCriterion("deleted not between", value1, value2, "deleted"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table litemall_log + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + private LitemallLogExample example; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + protected Criteria(LitemallLogExample example) { + super(); + this.example = example; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public LitemallLogExample example() { + return this.example; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andIf(boolean ifAdd, ICriteriaAdd add) { + if (ifAdd) { + add.add(this); + } + return this; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public Criteria andLogicalDeleted(boolean deleted) { + return deleted ? andDeletedEqualTo(LitemallLog.IS_DELETED) : andDeletedNotEqualTo(LitemallLog.IS_DELETED); + } + + /** + * This interface was generated by MyBatis Generator. + * This interface corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + public interface ICriteriaAdd { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table litemall_log + * + * @mbg.generated + * @project https://github.com/itfsw/mybatis-generator-plugin + */ + Criteria add(Criteria add); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table litemall_log + * + * @mbg.generated + */ + 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/litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallLogService.java b/litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallLogService.java new file mode 100644 index 00000000..5a59fc10 --- /dev/null +++ b/litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallLogService.java @@ -0,0 +1,46 @@ +package org.linlinjava.litemall.db.service; + +import com.github.pagehelper.PageHelper; +import org.linlinjava.litemall.db.dao.LitemallLogMapper; +import org.linlinjava.litemall.db.domain.LitemallAd; +import org.linlinjava.litemall.db.domain.LitemallLog; +import org.linlinjava.litemall.db.domain.LitemallLogExample; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.util.List; + +@Service +public class LitemallLogService { + @Resource + private LitemallLogMapper logMapper; + + public void deleteById(Integer id) { + logMapper.logicalDeleteByPrimaryKey(id); + } + + public void add(LitemallLog log) { + log.setAddTime(LocalDateTime.now()); + log.setUpdateTime(LocalDateTime.now()); + logMapper.insertSelective(log); + } + + public List querySelective(String name, Integer page, Integer size, String sort, String order) { + LitemallLogExample example = new LitemallLogExample(); + LitemallLogExample.Criteria criteria = example.createCriteria(); + + if (!StringUtils.isEmpty(name)) { + criteria.andAdminLike("%" + name + "%"); + } + criteria.andDeletedEqualTo(false); + + if (!StringUtils.isEmpty(sort) && !StringUtils.isEmpty(order)) { + example.setOrderByClause(sort + " " + order); + } + + PageHelper.startPage(page, size); + return logMapper.selectByExample(example); + } +} diff --git a/litemall-db/src/main/resources/org/linlinjava/litemall/db/dao/LitemallLogMapper.xml b/litemall-db/src/main/resources/org/linlinjava/litemall/db/dao/LitemallLogMapper.xml new file mode 100644 index 00000000..1d59e1a6 --- /dev/null +++ b/litemall-db/src/main/resources/org/linlinjava/litemall/db/dao/LitemallLogMapper.xml @@ -0,0 +1,504 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + id, `admin`, ip, `type`, `action`, `status`, `result`, `comment`, add_time, update_time, + deleted + + + + + + + + + delete from litemall_log + where id = #{id,jdbcType=INTEGER} + + + + delete from litemall_log + + + + + + + + SELECT LAST_INSERT_ID() + + insert into litemall_log (`admin`, ip, `type`, + `action`, `status`, `result`, + `comment`, add_time, update_time, + deleted) + values (#{admin,jdbcType=VARCHAR}, #{ip,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, + #{action,jdbcType=VARCHAR}, #{status,jdbcType=BIT}, #{result,jdbcType=VARCHAR}, + #{comment,jdbcType=VARCHAR}, #{addTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, + #{deleted,jdbcType=BIT}) + + + + + SELECT LAST_INSERT_ID() + + insert into litemall_log + + + `admin`, + + + ip, + + + `type`, + + + `action`, + + + `status`, + + + `result`, + + + `comment`, + + + add_time, + + + update_time, + + + deleted, + + + + + #{admin,jdbcType=VARCHAR}, + + + #{ip,jdbcType=VARCHAR}, + + + #{type,jdbcType=INTEGER}, + + + #{action,jdbcType=VARCHAR}, + + + #{status,jdbcType=BIT}, + + + #{result,jdbcType=VARCHAR}, + + + #{comment,jdbcType=VARCHAR}, + + + #{addTime,jdbcType=TIMESTAMP}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + #{deleted,jdbcType=BIT}, + + + + + + + update litemall_log + + + id = #{record.id,jdbcType=INTEGER}, + + + `admin` = #{record.admin,jdbcType=VARCHAR}, + + + ip = #{record.ip,jdbcType=VARCHAR}, + + + `type` = #{record.type,jdbcType=INTEGER}, + + + `action` = #{record.action,jdbcType=VARCHAR}, + + + `status` = #{record.status,jdbcType=BIT}, + + + `result` = #{record.result,jdbcType=VARCHAR}, + + + `comment` = #{record.comment,jdbcType=VARCHAR}, + + + add_time = #{record.addTime,jdbcType=TIMESTAMP}, + + + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + + + deleted = #{record.deleted,jdbcType=BIT}, + + + + + + + + + update litemall_log + set id = #{record.id,jdbcType=INTEGER}, + `admin` = #{record.admin,jdbcType=VARCHAR}, + ip = #{record.ip,jdbcType=VARCHAR}, + `type` = #{record.type,jdbcType=INTEGER}, + `action` = #{record.action,jdbcType=VARCHAR}, + `status` = #{record.status,jdbcType=BIT}, + `result` = #{record.result,jdbcType=VARCHAR}, + `comment` = #{record.comment,jdbcType=VARCHAR}, + add_time = #{record.addTime,jdbcType=TIMESTAMP}, + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + deleted = #{record.deleted,jdbcType=BIT} + + + + + + + update litemall_log + + + `admin` = #{admin,jdbcType=VARCHAR}, + + + ip = #{ip,jdbcType=VARCHAR}, + + + `type` = #{type,jdbcType=INTEGER}, + + + `action` = #{action,jdbcType=VARCHAR}, + + + `status` = #{status,jdbcType=BIT}, + + + `result` = #{result,jdbcType=VARCHAR}, + + + `comment` = #{comment,jdbcType=VARCHAR}, + + + add_time = #{addTime,jdbcType=TIMESTAMP}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + deleted = #{deleted,jdbcType=BIT}, + + + where id = #{id,jdbcType=INTEGER} + + + + update litemall_log + set `admin` = #{admin,jdbcType=VARCHAR}, + ip = #{ip,jdbcType=VARCHAR}, + `type` = #{type,jdbcType=INTEGER}, + `action` = #{action,jdbcType=VARCHAR}, + `status` = #{status,jdbcType=BIT}, + `result` = #{result,jdbcType=VARCHAR}, + `comment` = #{comment,jdbcType=VARCHAR}, + add_time = #{addTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=TIMESTAMP}, + deleted = #{deleted,jdbcType=BIT} + where id = #{id,jdbcType=INTEGER} + + + + + + update litemall_log set deleted = 1 + + + + + + + update litemall_log set deleted = 1 + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/service/WxOrderService.java b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/service/WxOrderService.java index 4df636d0..a8dafd51 100644 --- a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/service/WxOrderService.java +++ b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/service/WxOrderService.java @@ -25,7 +25,7 @@ import org.linlinjava.litemall.db.service.*; import org.linlinjava.litemall.db.util.CouponUserConstant; import org.linlinjava.litemall.db.util.OrderHandleOption; import org.linlinjava.litemall.db.util.OrderUtil; -import org.linlinjava.litemall.wx.util.IpUtil; +import org.linlinjava.litemall.core.util.IpUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; diff --git a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxAuthController.java b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxAuthController.java index bfd50167..40d0c259 100644 --- a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxAuthController.java +++ b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxAuthController.java @@ -21,7 +21,7 @@ import org.linlinjava.litemall.wx.dao.UserToken; import org.linlinjava.litemall.wx.dao.WxLoginInfo; import org.linlinjava.litemall.wx.service.CaptchaCodeManager; import org.linlinjava.litemall.wx.service.UserTokenManager; -import org.linlinjava.litemall.wx.util.IpUtil; +import org.linlinjava.litemall.core.util.IpUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.StringUtils; import org.springframework.validation.annotation.Validated; @@ -145,7 +145,7 @@ public class WxAuthController { user.setUserLevel((byte) 0); user.setStatus((byte) 0); user.setLastLoginTime(LocalDateTime.now()); - user.setLastLoginIp(IpUtil.client(request)); + user.setLastLoginIp(IpUtil.getIpAddr(request)); userService.add(user); @@ -153,7 +153,7 @@ public class WxAuthController { couponAssignService.assignForRegister(user.getId()); } else { user.setLastLoginTime(LocalDateTime.now()); - user.setLastLoginIp(IpUtil.client(request)); + user.setLastLoginIp(IpUtil.getIpAddr(request)); if (userService.updateById(user) == 0) { return ResponseUtil.updatedDataFailed(); } @@ -293,7 +293,7 @@ public class WxAuthController { user.setUserLevel((byte) 0); user.setStatus((byte) 0); user.setLastLoginTime(LocalDateTime.now()); - user.setLastLoginIp(IpUtil.client(request)); + user.setLastLoginIp(IpUtil.getIpAddr(request)); userService.add(user); // 给新用户发送注册优惠券