Commit c8aa349f by tyfanchz

添加返回状态值、统一异常捕捉

1 parent c2faaa49
package com.glsx.controller; package com.glsx.controller;
import java.util.List;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.glsx.model.PlatformApi;
import com.glsx.model.PlatformApiCall; import com.glsx.model.PlatformApiCall;
import com.glsx.service.ApiCallMgrService; import com.glsx.service.ApiCallMgrService;
import com.glsx.vo.ApiCallVo; import com.glsx.vo.ApiCallVo;
import com.glsx.vo.R; import com.glsx.vo.R;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import org.oreframework.web.ui.Pagination;
import org.oreframework.web.ui.ResponseEntity;
import org.oreframework.web.ui.ResultEntity;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -19,8 +16,6 @@ import org.springframework.web.bind.annotation.RequestMethod; ...@@ -19,8 +16,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Api @Api
@RestController @RestController
@RequestMapping(value = "/apicallmgr") @RequestMapping(value = "/apicallmgr")
...@@ -35,9 +30,9 @@ public class ApiCallMgrController { ...@@ -35,9 +30,9 @@ public class ApiCallMgrController {
@RequestMapping(value = "/getApiCallMgrList", method = RequestMethod.GET) @RequestMapping(value = "/getApiCallMgrList", method = RequestMethod.GET)
@ResponseBody @ResponseBody
public R getApiCallMgrList(Pagination pagination, ApiCallVo apiCallVo) { public R getApiCallMgrList(ApiCallVo apiCallVo) {
//PageHelper注入分页和要分页的查询之前不能有其它查询,不然分页到第一个查询上面 //PageHelper注入分页和要分页的查询之前不能有其它查询,不然分页到第一个查询上面
Page<PlatformApiCall> page = PageHelper.startPage(pagination.getCurrentPage(), pagination.getPageSize(), true); Page<PlatformApiCall> page = PageHelper.startPage(apiCallVo.getCurrentPage(), apiCallVo.getPageSize(), true);
List<PlatformApiCall> apiMgrList = apiCallMgrService.getApiCallMgrList(apiCallVo); List<PlatformApiCall> apiMgrList = apiCallMgrService.getApiCallMgrList(apiCallVo);
......
package com.glsx.controller; package com.glsx.controller;
import java.util.HashMap;
import java.util.List;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.glsx.model.PlatformCustomer;
import com.glsx.model.PlatformDevice; import com.glsx.model.PlatformDevice;
import com.glsx.service.DeviceMgrService; import com.glsx.service.DeviceMgrService;
import com.glsx.vo.DeviceVo; import com.glsx.vo.DeviceVo;
import com.glsx.vo.R; import com.glsx.vo.R;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import org.oreframework.web.ui.Pagination;
import org.oreframework.web.ui.ResponseEntity;
import org.oreframework.web.ui.ResultEntity;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -19,9 +17,6 @@ import org.springframework.web.bind.annotation.RequestMethod; ...@@ -19,9 +17,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List;
@Api @Api
@RestController @RestController
@RequestMapping(value = "/devicemgr") @RequestMapping(value = "/devicemgr")
...@@ -36,9 +31,10 @@ public class DeviceMgrController { ...@@ -36,9 +31,10 @@ public class DeviceMgrController {
@RequestMapping(value = "/getDeviceMgrList", method = RequestMethod.GET) @RequestMapping(value = "/getDeviceMgrList", method = RequestMethod.GET)
@ResponseBody @ResponseBody
public R getDeviceMgrList(Pagination pagination, DeviceVo deviceVo) { public R getDeviceMgrList(DeviceVo deviceVo) {
//PageHelper注入分页和要分页的查询之前不能有其它查询,不然分页到第一个查询上面 //PageHelper注入分页和要分页的查询之前不能有其它查询,不然分页到第一个查询上面
Page<PlatformDevice> page = PageHelper.startPage(pagination.getCurrentPage(), pagination.getPageSize(), true); Page<PlatformDevice> page = PageHelper.startPage(deviceVo.getCurrentPage(),
deviceVo.getPageSize(), true);
List<PlatformDevice> deviceMgrList = deviceMgrService.getDeviceMgrList(deviceVo); List<PlatformDevice> deviceMgrList = deviceMgrService.getDeviceMgrList(deviceVo);
......
package com.glsx.controller; package com.glsx.controller;
import java.util.List;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.glsx.model.PlatformUser; import com.glsx.model.PlatformUser;
...@@ -7,9 +8,6 @@ import com.glsx.service.UserMgrService; ...@@ -7,9 +8,6 @@ import com.glsx.service.UserMgrService;
import com.glsx.vo.R; import com.glsx.vo.R;
import com.glsx.vo.UserVo; import com.glsx.vo.UserVo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import org.oreframework.web.ui.Pagination;
import org.oreframework.web.ui.ResponseEntity;
import org.oreframework.web.ui.ResultEntity;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -18,8 +16,6 @@ import org.springframework.web.bind.annotation.RequestMethod; ...@@ -18,8 +16,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Api @Api
@RestController @RestController
@RequestMapping(value = "/usermgr") @RequestMapping(value = "/usermgr")
...@@ -34,9 +30,10 @@ public class UserMgrController { ...@@ -34,9 +30,10 @@ public class UserMgrController {
@RequestMapping(value = "/getUserMgrList", method = RequestMethod.GET) @RequestMapping(value = "/getUserMgrList", method = RequestMethod.GET)
@ResponseBody @ResponseBody
public R getUserMgrList(Pagination pagination, UserVo userVo) { public R getUserMgrList(UserVo userVo) {
//PageHelper注入分页和要分页的查询之前不能有其它查询,不然分页到第一个查询上面 //PageHelper注入分页和要分页的查询之前不能有其它查询,不然分页到第一个查询上面
Page<PlatformUser> page = PageHelper.startPage(pagination.getCurrentPage(), pagination.getPageSize(), true); Page<PlatformUser> page = PageHelper.startPage(userVo.getCurrentPage(),
userVo.getPageSize(), true);
List<PlatformUser> userMgrList = userMgrService.getUserMgrList(userVo); List<PlatformUser> userMgrList = userMgrService.getUserMgrList(userVo);
......
package com.glsx.enums;
import com.glsx.exception.BusinessException;
/**
* <p>Description:
* <p>Project: open-platform-admin
*
* @author wbh
* @date 2020-12-16
*/
public enum ResultCodeEnum {
SUCCESS(200, "成功"),
SERVER_ERROR(500, "系统异常"),
;
private final Integer code;
private final String msg;
ResultCodeEnum(Integer code, String msg) {
this.code = code;
this.msg = msg;
}
public Integer getCode() {
return code;
}
public String getMsg() {
return msg;
}
public BusinessException exception() {
return new BusinessException(this.code, this.msg);
}
}
package com.glsx.exception;
/**
* <p>Description: 业务异常
* <p>Project: open-platform-admin
*
* @author wbh
* @date 2020-12-16
*/
public class BusinessException extends RuntimeException {
private Integer code;
private String message;
public BusinessException() {}
public BusinessException(Integer code, String message) {
this.code = code;
this.message = message;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public void setMessage(String message) {
this.message = message;
}
@Override
public String getMessage() {
return this.message;
}
}
package com.glsx.exception;
import com.glsx.enums.ResultCodeEnum;
import com.glsx.vo.R;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
/**
* <p>Description:
* <p>Project: open-platform-admin
*
* @author wbh
* @date 2020-12-16
*/
@RestControllerAdvice
public class GlobalExceptionHandler {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@ExceptionHandler({BusinessException.class})
public R handleBusinessException(BusinessException e) {
this.logger.error("!!!! ERROR", e);
return R.error(e.getCode(), e.getMessage());
}
@ExceptionHandler({Throwable.class})
public R handlerOtherException(Throwable e) {
this.logger.error("!!!! ERROR", e);
return R.error(ResultCodeEnum.SERVER_ERROR.getCode(),
ResultCodeEnum.SERVER_ERROR.getMsg());
}
}
package com.glsx.mapper; package com.glsx.mapper;
import java.util.List;
import com.glsx.model.PlatformUser; import com.glsx.model.PlatformUser;
import com.glsx.vo.UserVo; import com.glsx.vo.UserVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* <p>Description: * <p>Description:
* <p>Project: shop * <p>Project: shop
...@@ -41,4 +40,4 @@ public interface PlatformUserMapper { ...@@ -41,4 +40,4 @@ public interface PlatformUserMapper {
int getUserCount(); int getUserCount();
int getUserCountAuth(@Param("customerName") String customerName); int getUserCountAuth(@Param("customerName") String customerName);
}
\ No newline at end of file \ No newline at end of file
}
...@@ -2,6 +2,7 @@ package com.glsx.model; ...@@ -2,6 +2,7 @@ package com.glsx.model;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
/** /**
* <p>Description: * <p>Description:
...@@ -16,6 +17,23 @@ import java.util.Date; ...@@ -16,6 +17,23 @@ import java.util.Date;
*/ */
public class PlatformUser implements Serializable { public class PlatformUser implements Serializable {
/** /**
* 客户名称
*/
private String customerName;
/**
* 省份名称
*/
private String provinceName;
/**
* 城市名称
*/
private String cityName;
/**
* 主键 * 主键
*/ */
private Integer id; private Integer id;
...@@ -51,13 +69,9 @@ public class PlatformUser implements Serializable { ...@@ -51,13 +69,9 @@ public class PlatformUser implements Serializable {
private Integer customerId; private Integer customerId;
/** /**
* 客户名称
*/
private String customerName;
/**
* 最后登录时间 * 最后登录时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date lastLoginTime; private Date lastLoginTime;
/** /**
...@@ -68,11 +82,13 @@ public class PlatformUser implements Serializable { ...@@ -68,11 +82,13 @@ public class PlatformUser implements Serializable {
/** /**
* 创建时间 注册时间 * 创建时间 注册时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime; private Date createTime;
/** /**
* 更新时间 * 更新时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime; private Date updateTime;
/** /**
...@@ -90,6 +106,30 @@ public class PlatformUser implements Serializable { ...@@ -90,6 +106,30 @@ public class PlatformUser implements Serializable {
*/ */
private String remark; private String remark;
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public String getProvinceName() {
return provinceName;
}
public void setProvinceName(String provinceName) {
this.provinceName = provinceName;
}
public String getCityName() {
return cityName;
}
public void setCityName(String cityName) {
this.cityName = cityName;
}
public Integer getId() { public Integer getId() {
return id; return id;
} }
...@@ -202,25 +242,19 @@ public class PlatformUser implements Serializable { ...@@ -202,25 +242,19 @@ public class PlatformUser implements Serializable {
this.remark = remark; this.remark = remark;
} }
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
@Override @Override
public String toString() { public String toString() {
return "PlatformUser{" + return "PlatformUser{" +
"id=" + id + "customerName='" + customerName + '\'' +
", provinceName='" + provinceName + '\'' +
", cityName='" + cityName + '\'' +
", id=" + id +
", nickname='" + nickname + '\'' + ", nickname='" + nickname + '\'' +
", contactNumber='" + contactNumber + '\'' + ", contactNumber='" + contactNumber + '\'' +
", wechatId='" + wechatId + '\'' + ", wechatId='" + wechatId + '\'' +
", province=" + province + ", province=" + province +
", city=" + city + ", city=" + city +
", customerId=" + customerId + ", customerId=" + customerId +
", customerName='" + customerName + '\'' +
", lastLoginTime=" + lastLoginTime + ", lastLoginTime=" + lastLoginTime +
", appAccountId=" + appAccountId + ", appAccountId=" + appAccountId +
", createTime=" + createTime + ", createTime=" + createTime +
...@@ -230,4 +264,4 @@ public class PlatformUser implements Serializable { ...@@ -230,4 +264,4 @@ public class PlatformUser implements Serializable {
", remark='" + remark + '\'' + ", remark='" + remark + '\'' +
'}'; '}';
} }
}
\ No newline at end of file \ No newline at end of file
}
...@@ -2,6 +2,7 @@ package com.glsx.vo; ...@@ -2,6 +2,7 @@ package com.glsx.vo;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import org.oreframework.web.ui.Pagination;
/** /**
* <p>Description: * <p>Description:
...@@ -14,7 +15,7 @@ import java.util.Date; ...@@ -14,7 +15,7 @@ import java.util.Date;
/** /**
* api调用表 * api调用表
*/ */
public class ApiCallVo implements Serializable { public class ApiCallVo extends Pagination implements Serializable {
/** /**
* 访问开始时间 * 访问开始时间
*/ */
...@@ -40,4 +41,4 @@ public class ApiCallVo implements Serializable { ...@@ -40,4 +41,4 @@ public class ApiCallVo implements Serializable {
public void setAccessEndTime(Date accessEndTime) { public void setAccessEndTime(Date accessEndTime) {
this.accessEndTime = accessEndTime; this.accessEndTime = accessEndTime;
} }
}
\ No newline at end of file \ No newline at end of file
}
...@@ -2,6 +2,7 @@ package com.glsx.vo; ...@@ -2,6 +2,7 @@ package com.glsx.vo;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import org.oreframework.web.ui.Pagination;
/** /**
* <p>Description: * <p>Description:
...@@ -14,7 +15,7 @@ import java.util.Date; ...@@ -14,7 +15,7 @@ import java.util.Date;
/** /**
* 设备管理表 * 设备管理表
*/ */
public class DeviceVo implements Serializable { public class DeviceVo extends Pagination implements Serializable {
/** /**
* 客户名称 * 客户名称
*/ */
...@@ -66,4 +67,4 @@ public class DeviceVo implements Serializable { ...@@ -66,4 +67,4 @@ public class DeviceVo implements Serializable {
public void setActivatEndTime(Date activatEndTime) { public void setActivatEndTime(Date activatEndTime) {
this.activatEndTime = activatEndTime; this.activatEndTime = activatEndTime;
} }
}
\ No newline at end of file \ No newline at end of file
}
...@@ -3,6 +3,7 @@ package com.glsx.vo; ...@@ -3,6 +3,7 @@ package com.glsx.vo;
import java.util.Collection; import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import com.glsx.enums.ResultCodeEnum;
/** /**
* 返回数据 * 返回数据
...@@ -16,11 +17,10 @@ public class R extends HashMap<String, Object> { ...@@ -16,11 +17,10 @@ public class R extends HashMap<String, Object> {
private final static String DATA_KEY = "data"; private final static String DATA_KEY = "data";
private final static String LIST_KEY = "list"; private final static String LIST_KEY = "list";
private final static String ITEMS_KEY = "items";
private final static String PAGE_KEY = "page"; private final static String PAGE_KEY = "page";
private final static String TOTAL_PAGES_KEY = "totalPages"; private final static String TOTAL_PAGES_KEY = "totalPages";
private final static String TOTAL_ELEMENTS_KEY = "totalElements"; private final static String TOTAL_ELEMENTS_KEY = "totalElements";
private final static int SUCCESS_CODE = 200; private final static int SUCCESS_CODE = ResultCodeEnum.SUCCESS.getCode();
public R() { public R() {
put(CODE_KEY, SUCCESS_CODE); put(CODE_KEY, SUCCESS_CODE);
...@@ -28,11 +28,11 @@ public class R extends HashMap<String, Object> { ...@@ -28,11 +28,11 @@ public class R extends HashMap<String, Object> {
} }
public static R error() { public static R error() {
return error(500, "未知异常,请联系管理员"); return error(ResultCodeEnum.SERVER_ERROR);
} }
public static R error(String msg) { public static R error(String msg) {
return error(500, msg); return error(ResultCodeEnum.SERVER_ERROR.getCode(), msg);
} }
public static R error(int code, String msg) { public static R error(int code, String msg) {
...@@ -49,6 +49,13 @@ public class R extends HashMap<String, Object> { ...@@ -49,6 +49,13 @@ public class R extends HashMap<String, Object> {
return r; return r;
} }
public static R error(ResultCodeEnum resultCodeEnum) {
R r = new R();
r.put(CODE_KEY, resultCodeEnum.getCode());
r.put(MSG_KEY, resultCodeEnum.getMsg());
return r;
}
public static R ok(String msg) { public static R ok(String msg) {
R r = new R(); R r = new R();
r.put(MSG_KEY, msg); r.put(MSG_KEY, msg);
......
...@@ -2,6 +2,7 @@ package com.glsx.vo; ...@@ -2,6 +2,7 @@ package com.glsx.vo;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import org.oreframework.web.ui.Pagination;
/** /**
* <p>Description: * <p>Description:
...@@ -14,7 +15,11 @@ import java.util.Date; ...@@ -14,7 +15,11 @@ import java.util.Date;
/** /**
* 设备管理表 * 设备管理表
*/ */
public class UserVo implements Serializable { public class UserVo extends Pagination implements Serializable {
/**
* 客户ID
*/
private Integer customerId;
/** /**
* 客户名称 * 客户名称
*/ */
...@@ -66,4 +71,4 @@ public class UserVo implements Serializable { ...@@ -66,4 +71,4 @@ public class UserVo implements Serializable {
public void setRegisterEndTime(Date registerEndTime) { public void setRegisterEndTime(Date registerEndTime) {
this.registerEndTime = registerEndTime; this.registerEndTime = registerEndTime;
} }
}
\ No newline at end of file \ No newline at end of file
}
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glsx.mapper.PlatformUserMapper"> <mapper namespace="com.glsx.mapper.PlatformUserMapper">
<resultMap id="BaseResultMap" type="com.glsx.model.PlatformUser"> <resultMap id="BaseResultMap" type="com.glsx.model.PlatformUser">
<!--@mbg.generated--> <!--@mbg.generated-->
<!--@Table t_platform_user--> <!--@Table t_platform_user-->
<id column="id" jdbcType="INTEGER" property="id" /> <id column="id" jdbcType="INTEGER" property="id"/>
<result column="nickname" jdbcType="VARCHAR" property="nickname" /> <result column="nickname" jdbcType="VARCHAR" property="nickname"/>
<result column="contact_number" jdbcType="VARCHAR" property="contactNumber" /> <result column="contact_number" jdbcType="VARCHAR" property="contactNumber"/>
<result column="wechat_id" jdbcType="VARCHAR" property="wechatId" /> <result column="wechat_id" jdbcType="VARCHAR" property="wechatId"/>
<result column="province" jdbcType="INTEGER" property="province" /> <result column="province" jdbcType="INTEGER" property="province"/>
<result column="city" jdbcType="INTEGER" property="city" /> <result column="city" jdbcType="INTEGER" property="city"/>
<result column="customer_id" jdbcType="INTEGER" property="customerId" /> <result column="customer_id" jdbcType="INTEGER" property="customerId"/>
<result column="customer_name" jdbcType="INTEGER" property="customerName" /> <result column="customer_name" jdbcType="INTEGER" property="customerName"/>
<result column="last_login_time" jdbcType="TIMESTAMP" property="lastLoginTime" /> <result column="last_login_time" jdbcType="TIMESTAMP" property="lastLoginTime"/>
<result column="app_account_id" jdbcType="INTEGER" property="appAccountId" /> <result column="app_account_id" jdbcType="INTEGER" property="appAccountId"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="create_by" jdbcType="INTEGER" property="createBy" /> <result column="create_by" jdbcType="INTEGER" property="createBy"/>
<result column="update_by" jdbcType="INTEGER" property="updateBy" /> <result column="update_by" jdbcType="INTEGER" property="updateBy"/>
<result column="remark" jdbcType="VARCHAR" property="remark" /> <result column="remark" jdbcType="VARCHAR" property="remark"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
<!--@mbg.generated--> <!--@mbg.generated-->
id, nickname, contact_number, wechat_id, province, city, customer_id, last_login_time, id, nickname, contact_number, wechat_id, province, city, customer_id, last_login_time,
app_account_id, create_time, update_time, create_by, update_by, remark app_account_id, create_time, update_time, create_by, update_by, remark
</sql> </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated--> <!--@mbg.generated-->
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from t_platform_user from t_platform_user
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</select> </select>
<select id="getUserMgrList" resultMap="BaseResultMap"> <select id="getUserMgrList" resultMap="BaseResultMap">
select select a.id,
a.id, a.nickname,
a.nickname, a.contact_number,
a.contact_number, a.wechat_id,
a.wechat_id, a.province,
a.province, a.city,
a.city, b.customer_name,
b.customer_name, a.last_login_time,
a.last_login_time, a.app_account_id,
a.app_account_id, a.create_time,
a.create_time, a.update_time,
a.update_time, a.create_by,
a.create_by, a.update_by,
a.update_by, a.remark
a.remark from t_platform_user a
from t_platform_user a left join t_platform_customer b
left join t_platform_customer b on a.customer_id = b.id
on a.customer_id = b.id where 1 = 1
where 1 = 1 <if test="userVo.customerName != null and userVo.customerName != ''">
<if test="userVo.customerName != null and userVo.customerName != '' "> and b.customer_name = #{userVo.customerName,jdbcType=VARCHAR}
and b.customer_name = #{userVo.customerName,jdbcType=VARCHAR} </if>
</if> <if test="userVo.registerStartTime != null and userVo.registerStartTime != ''">
<if test="userVo.registerStartTime != null and userVo.registerStartTime != '' "> and a.create_time &gt;= userVo.registerStartTime
and a.create_time &gt;= userVo.registerStartTime </if>
</if> <if test="userVo.registerEndTime != null and userVo.registerEndTime != ''">
<if test="userVo.registerEndTime != null and userVo.registerEndTime != '' "> and a.create_time &lt;= userVo.registerEndTime
and a.create_time &lt;= userVo.registerEndTime </if>
</if> </select>
</select>
<select id="getUserCount" resultType="java.lang.Integer"> <select id="getUserCount" resultType="java.lang.Integer">
select count(1) select count(1)
from t_platform_user from t_platform_user
</select> </select>
<select id="getUserCountAuth" resultType="java.lang.Integer"> <select id="getUserCountAuth" resultType="java.lang.Integer">
select count(1) select count(1)
from t_platform_user a from t_platform_user a
left join t_platform_customer b left join t_platform_customer b
on a.customer_id = b.id on a.customer_id = b.id
where b.customer_name = #{customerName,jdbcType=VARCHAR} where b.customer_name = #{customerName,jdbcType=VARCHAR}
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated--> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from t_platform_user <!--@mbg.generated-->
where id = #{id,jdbcType=INTEGER} delete
</delete> from t_platform_user
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.glsx.model.PlatformUser" useGeneratedKeys="true"> where id = #{id,jdbcType=INTEGER}
<!--@mbg.generated--> </delete>
insert into t_platform_user (nickname, contact_number, wechat_id, <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.glsx.model.PlatformUser"
province, city, customer_id, useGeneratedKeys="true">
last_login_time, app_account_id, create_time, <!--@mbg.generated-->
update_time, create_by, update_by, insert into t_platform_user (nickname, contact_number, wechat_id,
remark) province, city, customer_id,
values (#{nickname,jdbcType=VARCHAR}, #{contactNumber,jdbcType=VARCHAR}, #{wechatId,jdbcType=VARCHAR}, last_login_time, app_account_id, create_time,
#{province,jdbcType=INTEGER}, #{city,jdbcType=INTEGER}, #{customerId,jdbcType=INTEGER}, update_time, create_by, update_by,
#{lastLoginTime,jdbcType=TIMESTAMP}, #{appAccountId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, remark)
#{updateTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=INTEGER}, #{updateBy,jdbcType=INTEGER}, values (#{nickname,jdbcType=VARCHAR}, #{contactNumber,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR}) #{wechatId,jdbcType=VARCHAR},
</insert> #{province,jdbcType=INTEGER}, #{city,jdbcType=INTEGER},
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.glsx.model.PlatformUser" useGeneratedKeys="true"> #{customerId,jdbcType=INTEGER},
<!--@mbg.generated--> #{lastLoginTime,jdbcType=TIMESTAMP}, #{appAccountId,jdbcType=INTEGER},
insert into t_platform_user #{createTime,jdbcType=TIMESTAMP},
<trim prefix="(" suffix=")" suffixOverrides=","> #{updateTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=INTEGER},
<if test="nickname != null and nickname != ''"> #{updateBy,jdbcType=INTEGER},
nickname, #{remark,jdbcType=VARCHAR})
</if> </insert>
<if test="contactNumber != null and contactNumber != ''"> <insert id="insertSelective" keyColumn="id" keyProperty="id"
contact_number, parameterType="com.glsx.model.PlatformUser" useGeneratedKeys="true">
</if> <!--@mbg.generated-->
<if test="wechatId != null and wechatId != ''"> insert into t_platform_user
wechat_id, <trim prefix="(" suffix=")" suffixOverrides=",">
</if> <if test="nickname != null and nickname != ''">
<if test="province != null"> nickname,
province, </if>
</if> <if test="contactNumber != null and contactNumber != ''">
<if test="city != null"> contact_number,
city, </if>
</if> <if test="wechatId != null and wechatId != ''">
<if test="customerId != null"> wechat_id,
customer_id, </if>
</if> <if test="province != null">
<if test="lastLoginTime != null"> province,
last_login_time, </if>
</if> <if test="city != null">
<if test="appAccountId != null"> city,
app_account_id, </if>
</if> <if test="customerId != null">
<if test="createTime != null"> customer_id,
create_time, </if>
</if> <if test="lastLoginTime != null">
<if test="updateTime != null"> last_login_time,
update_time, </if>
</if> <if test="appAccountId != null">
<if test="createBy != null"> app_account_id,
create_by, </if>
</if> <if test="createTime != null">
<if test="updateBy != null"> create_time,
update_by, </if>
</if> <if test="updateTime != null">
<if test="remark != null and remark != ''"> update_time,
remark, </if>
</if> <if test="createBy != null">
</trim> create_by,
<trim prefix="values (" suffix=")" suffixOverrides=","> </if>
<if test="nickname != null and nickname != ''"> <if test="updateBy != null">
#{nickname,jdbcType=VARCHAR}, update_by,
</if> </if>
<if test="contactNumber != null and contactNumber != ''"> <if test="remark != null and remark != ''">
#{contactNumber,jdbcType=VARCHAR}, remark,
</if> </if>
<if test="wechatId != null and wechatId != ''"> </trim>
#{wechatId,jdbcType=VARCHAR}, <trim prefix="values (" suffix=")" suffixOverrides=",">
</if> <if test="nickname != null and nickname != ''">
<if test="province != null"> #{nickname,jdbcType=VARCHAR},
#{province,jdbcType=INTEGER}, </if>
</if> <if test="contactNumber != null and contactNumber != ''">
<if test="city != null"> #{contactNumber,jdbcType=VARCHAR},
#{city,jdbcType=INTEGER}, </if>
</if> <if test="wechatId != null and wechatId != ''">
<if test="customerId != null"> #{wechatId,jdbcType=VARCHAR},
#{customerId,jdbcType=INTEGER}, </if>
</if> <if test="province != null">
<if test="lastLoginTime != null"> #{province,jdbcType=INTEGER},
#{lastLoginTime,jdbcType=TIMESTAMP}, </if>
</if> <if test="city != null">
<if test="appAccountId != null"> #{city,jdbcType=INTEGER},
#{appAccountId,jdbcType=INTEGER}, </if>
</if> <if test="customerId != null">
<if test="createTime != null"> #{customerId,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, </if>
</if> <if test="lastLoginTime != null">
<if test="updateTime != null"> #{lastLoginTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, </if>
</if> <if test="appAccountId != null">
<if test="createBy != null"> #{appAccountId,jdbcType=INTEGER},
#{createBy,jdbcType=INTEGER}, </if>
</if> <if test="createTime != null">
<if test="updateBy != null"> #{createTime,jdbcType=TIMESTAMP},
#{updateBy,jdbcType=INTEGER}, </if>
</if> <if test="updateTime != null">
<if test="remark != null and remark != ''"> #{updateTime,jdbcType=TIMESTAMP},
#{remark,jdbcType=VARCHAR}, </if>
</if> <if test="createBy != null">
</trim> #{createBy,jdbcType=INTEGER},
</insert> </if>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.model.PlatformUser"> <if test="updateBy != null">
<!--@mbg.generated--> #{updateBy,jdbcType=INTEGER},
update t_platform_user </if>
<set> <if test="remark != null and remark != ''">
<if test="nickname != null and nickname != ''"> #{remark,jdbcType=VARCHAR},
nickname = #{nickname,jdbcType=VARCHAR}, </if>
</if> </trim>
<if test="contactNumber != null and contactNumber != ''"> </insert>
contact_number = #{contactNumber,jdbcType=VARCHAR}, <update id="updateByPrimaryKeySelective" parameterType="com.glsx.model.PlatformUser">
</if> <!--@mbg.generated-->
<if test="wechatId != null and wechatId != ''"> update t_platform_user
wechat_id = #{wechatId,jdbcType=VARCHAR}, <set>
</if> <if test="nickname != null and nickname != ''">
<if test="province != null"> nickname = #{nickname,jdbcType=VARCHAR},
province = #{province,jdbcType=INTEGER}, </if>
</if> <if test="contactNumber != null and contactNumber != ''">
<if test="city != null"> contact_number = #{contactNumber,jdbcType=VARCHAR},
city = #{city,jdbcType=INTEGER}, </if>
</if> <if test="wechatId != null and wechatId != ''">
<if test="customerId != null"> wechat_id = #{wechatId,jdbcType=VARCHAR},
customer_id = #{customerId,jdbcType=INTEGER}, </if>
</if> <if test="province != null">
<if test="lastLoginTime != null"> province = #{province,jdbcType=INTEGER},
last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP}, </if>
</if> <if test="city != null">
<if test="appAccountId != null"> city = #{city,jdbcType=INTEGER},
app_account_id = #{appAccountId,jdbcType=INTEGER}, </if>
</if> <if test="customerId != null">
<if test="createTime != null"> customer_id = #{customerId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP}, </if>
</if> <if test="lastLoginTime != null">
<if test="updateTime != null"> last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}, </if>
</if> <if test="appAccountId != null">
<if test="createBy != null"> app_account_id = #{appAccountId,jdbcType=INTEGER},
create_by = #{createBy,jdbcType=INTEGER}, </if>
</if> <if test="createTime != null">
<if test="updateBy != null"> create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=INTEGER}, </if>
</if> <if test="updateTime != null">
<if test="remark != null and remark != ''"> update_time = #{updateTime,jdbcType=TIMESTAMP},
remark = #{remark,jdbcType=VARCHAR}, </if>
</if> <if test="createBy != null">
</set> create_by = #{createBy,jdbcType=INTEGER},
where id = #{id,jdbcType=INTEGER} </if>
</update> <if test="updateBy != null">
<update id="updateByPrimaryKey" parameterType="com.glsx.model.PlatformUser"> update_by = #{updateBy,jdbcType=INTEGER},
<!--@mbg.generated--> </if>
update t_platform_user <if test="remark != null and remark != ''">
set nickname = #{nickname,jdbcType=VARCHAR}, remark = #{remark,jdbcType=VARCHAR},
contact_number = #{contactNumber,jdbcType=VARCHAR}, </if>
wechat_id = #{wechatId,jdbcType=VARCHAR}, </set>
province = #{province,jdbcType=INTEGER}, where id = #{id,jdbcType=INTEGER}
city = #{city,jdbcType=INTEGER}, </update>
customer_id = #{customerId,jdbcType=INTEGER}, <update id="updateByPrimaryKey" parameterType="com.glsx.model.PlatformUser">
last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP}, <!--@mbg.generated-->
app_account_id = #{appAccountId,jdbcType=INTEGER}, update t_platform_user
create_time = #{createTime,jdbcType=TIMESTAMP}, set nickname = #{nickname,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP}, contact_number = #{contactNumber,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=INTEGER}, wechat_id = #{wechatId,jdbcType=VARCHAR},
update_by = #{updateBy,jdbcType=INTEGER}, province = #{province,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR} city = #{city,jdbcType=INTEGER},
where id = #{id,jdbcType=INTEGER} customer_id = #{customerId,jdbcType=INTEGER},
</update> last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
<update id="updateBatch" parameterType="java.util.List"> app_account_id = #{appAccountId,jdbcType=INTEGER},
<!--@mbg.generated--> create_time = #{createTime,jdbcType=TIMESTAMP},
update t_platform_user update_time = #{updateTime,jdbcType=TIMESTAMP},
<trim prefix="set" suffixOverrides=","> create_by = #{createBy,jdbcType=INTEGER},
<trim prefix="nickname = case" suffix="end,"> update_by = #{updateBy,jdbcType=INTEGER},
<foreach collection="list" index="index" item="item"> remark = #{remark,jdbcType=VARCHAR}
when id = #{item.id,jdbcType=INTEGER} then #{item.nickname,jdbcType=VARCHAR} where id = #{id,jdbcType=INTEGER}
</foreach> </update>
</trim> <update id="updateBatch" parameterType="java.util.List">
<trim prefix="contact_number = case" suffix="end,"> <!--@mbg.generated-->
<foreach collection="list" index="index" item="item"> update t_platform_user
when id = #{item.id,jdbcType=INTEGER} then #{item.contactNumber,jdbcType=VARCHAR} <trim prefix="set" suffixOverrides=",">
</foreach> <trim prefix="nickname = case" suffix="end,">
</trim> <foreach collection="list" index="index" item="item">
<trim prefix="wechat_id = case" suffix="end,"> when id = #{item.id,jdbcType=INTEGER} then #{item.nickname,jdbcType=VARCHAR}
<foreach collection="list" index="index" item="item"> </foreach>
when id = #{item.id,jdbcType=INTEGER} then #{item.wechatId,jdbcType=VARCHAR} </trim>
</foreach> <trim prefix="contact_number = case" suffix="end,">
</trim> <foreach collection="list" index="index" item="item">
<trim prefix="province = case" suffix="end,"> when id = #{item.id,jdbcType=INTEGER}
<foreach collection="list" index="index" item="item"> then #{item.contactNumber,jdbcType=VARCHAR}
when id = #{item.id,jdbcType=INTEGER} then #{item.province,jdbcType=INTEGER} </foreach>
</foreach> </trim>
</trim> <trim prefix="wechat_id = case" suffix="end,">
<trim prefix="city = case" suffix="end,"> <foreach collection="list" index="index" item="item">
<foreach collection="list" index="index" item="item"> when id = #{item.id,jdbcType=INTEGER} then #{item.wechatId,jdbcType=VARCHAR}
when id = #{item.id,jdbcType=INTEGER} then #{item.city,jdbcType=INTEGER} </foreach>
</foreach> </trim>
</trim> <trim prefix="province = case" suffix="end,">
<trim prefix="customer_id = case" suffix="end,"> <foreach collection="list" index="index" item="item">
<foreach collection="list" index="index" item="item"> when id = #{item.id,jdbcType=INTEGER} then #{item.province,jdbcType=INTEGER}
when id = #{item.id,jdbcType=INTEGER} then #{item.customerId,jdbcType=INTEGER} </foreach>
</foreach> </trim>
</trim> <trim prefix="city = case" suffix="end,">
<trim prefix="last_login_time = case" suffix="end,"> <foreach collection="list" index="index" item="item">
<foreach collection="list" index="index" item="item"> when id = #{item.id,jdbcType=INTEGER} then #{item.city,jdbcType=INTEGER}
when id = #{item.id,jdbcType=INTEGER} then #{item.lastLoginTime,jdbcType=TIMESTAMP} </foreach>
</foreach> </trim>
</trim> <trim prefix="customer_id = case" suffix="end,">
<trim prefix="app_account_id = case" suffix="end,"> <foreach collection="list" index="index" item="item">
<foreach collection="list" index="index" item="item"> when id = #{item.id,jdbcType=INTEGER} then #{item.customerId,jdbcType=INTEGER}
when id = #{item.id,jdbcType=INTEGER} then #{item.appAccountId,jdbcType=INTEGER} </foreach>
</foreach> </trim>
</trim> <trim prefix="last_login_time = case" suffix="end,">
<trim prefix="create_time = case" suffix="end,"> <foreach collection="list" index="index" item="item">
<foreach collection="list" index="index" item="item"> when id = #{item.id,jdbcType=INTEGER}
when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP} then #{item.lastLoginTime,jdbcType=TIMESTAMP}
</foreach> </foreach>
</trim> </trim>
<trim prefix="update_time = case" suffix="end,"> <trim prefix="app_account_id = case" suffix="end,">
<foreach collection="list" index="index" item="item"> <foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP} when id = #{item.id,jdbcType=INTEGER} then #{item.appAccountId,jdbcType=INTEGER}
</foreach> </foreach>
</trim> </trim>
<trim prefix="create_by = case" suffix="end,"> <trim prefix="create_time = case" suffix="end,">
<foreach collection="list" index="index" item="item"> <foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=INTEGER} when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
</foreach> </foreach>
</trim> </trim>
<trim prefix="update_by = case" suffix="end,"> <trim prefix="update_time = case" suffix="end,">
<foreach collection="list" index="index" item="item"> <foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=INTEGER} when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
</foreach> </foreach>
</trim> </trim>
<trim prefix="remark = case" suffix="end,"> <trim prefix="create_by = case" suffix="end,">
<foreach collection="list" index="index" item="item"> <foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.remark,jdbcType=VARCHAR} when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=INTEGER}
</foreach> </foreach>
</trim> </trim>
</trim> <trim prefix="update_by = case" suffix="end,">
where id in <foreach collection="list" index="index" item="item">
<foreach close=")" collection="list" item="item" open="(" separator=", "> when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=INTEGER}
#{item.id,jdbcType=INTEGER} </foreach>
</foreach> </trim>
</update> <trim prefix="remark = case" suffix="end,">
<update id="updateBatchSelective" parameterType="java.util.List"> <foreach collection="list" index="index" item="item">
<!--@mbg.generated--> when id = #{item.id,jdbcType=INTEGER} then #{item.remark,jdbcType=VARCHAR}
update t_platform_user </foreach>
<trim prefix="set" suffixOverrides=","> </trim>
<trim prefix="nickname = case" suffix="end,"> </trim>
<foreach collection="list" index="index" item="item"> where id in
<if test="item.nickname != null"> <foreach close=")" collection="list" item="item" open="(" separator=", ">
when id = #{item.id,jdbcType=INTEGER} then #{item.nickname,jdbcType=VARCHAR} #{item.id,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="contact_number = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.contactNumber != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.contactNumber,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="wechat_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.wechatId != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.wechatId,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="province = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.province != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.province,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="city = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.city != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.city,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="customer_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.customerId != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.customerId,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="last_login_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.lastLoginTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.lastLoginTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="app_account_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.appAccountId != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.appAccountId,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="create_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="update_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.updateTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="create_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createBy != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="update_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.updateBy != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=INTEGER}
</if>
</foreach> </foreach>
</trim> </update>
<trim prefix="remark = case" suffix="end,"> <update id="updateBatchSelective" parameterType="java.util.List">
<foreach collection="list" index="index" item="item"> <!--@mbg.generated-->
<if test="item.remark != null"> update t_platform_user
when id = #{item.id,jdbcType=INTEGER} then #{item.remark,jdbcType=VARCHAR} <trim prefix="set" suffixOverrides=",">
</if> <trim prefix="nickname = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.nickname != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.nickname,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="contact_number = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.contactNumber != null">
when id = #{item.id,jdbcType=INTEGER}
then #{item.contactNumber,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="wechat_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.wechatId != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.wechatId,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="province = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.province != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.province,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="city = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.city != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.city,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="customer_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.customerId != null">
when id = #{item.id,jdbcType=INTEGER}
then #{item.customerId,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="last_login_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.lastLoginTime != null">
when id = #{item.id,jdbcType=INTEGER}
then #{item.lastLoginTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="app_account_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.appAccountId != null">
when id = #{item.id,jdbcType=INTEGER}
then #{item.appAccountId,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="create_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createTime != null">
when id = #{item.id,jdbcType=INTEGER}
then #{item.createTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="update_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.updateTime != null">
when id = #{item.id,jdbcType=INTEGER}
then #{item.updateTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="create_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createBy != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="update_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.updateBy != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="remark = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.remark != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.remark,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=INTEGER}
</foreach> </foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=INTEGER}
</foreach>
</update>
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.glsx.model.PlatformUser" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into t_platform_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
nickname,
contact_number,
wechat_id,
province,
city,
customer_id,
last_login_time,
app_account_id,
create_time,
update_time,
create_by,
update_by,
remark,
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
#{nickname,jdbcType=VARCHAR},
#{contactNumber,jdbcType=VARCHAR},
#{wechatId,jdbcType=VARCHAR},
#{province,jdbcType=INTEGER},
#{city,jdbcType=INTEGER},
#{customerId,jdbcType=INTEGER},
#{lastLoginTime,jdbcType=TIMESTAMP},
#{appAccountId,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP},
#{createBy,jdbcType=INTEGER},
#{updateBy,jdbcType=INTEGER},
#{remark,jdbcType=VARCHAR},
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
nickname = #{nickname,jdbcType=VARCHAR},
contact_number = #{contactNumber,jdbcType=VARCHAR},
wechat_id = #{wechatId,jdbcType=VARCHAR},
province = #{province,jdbcType=INTEGER},
city = #{city,jdbcType=INTEGER},
customer_id = #{customerId,jdbcType=INTEGER},
last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
app_account_id = #{appAccountId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=INTEGER},
update_by = #{updateBy,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR},
</trim>
</insert>
<insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id" parameterType="com.glsx.model.PlatformUser" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into t_platform_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="nickname != null and nickname != ''">
nickname,
</if>
<if test="contactNumber != null and contactNumber != ''">
contact_number,
</if>
<if test="wechatId != null and wechatId != ''">
wechat_id,
</if>
<if test="province != null">
province,
</if>
<if test="city != null">
city,
</if>
<if test="customerId != null">
customer_id,
</if>
<if test="lastLoginTime != null">
last_login_time,
</if>
<if test="appAccountId != null">
app_account_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="remark != null and remark != ''">
remark,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="nickname != null and nickname != ''">
#{nickname,jdbcType=VARCHAR},
</if>
<if test="contactNumber != null and contactNumber != ''">
#{contactNumber,jdbcType=VARCHAR},
</if>
<if test="wechatId != null and wechatId != ''">
#{wechatId,jdbcType=VARCHAR},
</if>
<if test="province != null">
#{province,jdbcType=INTEGER},
</if>
<if test="city != null">
#{city,jdbcType=INTEGER},
</if>
<if test="customerId != null">
#{customerId,jdbcType=INTEGER},
</if>
<if test="lastLoginTime != null">
#{lastLoginTime,jdbcType=TIMESTAMP},
</if>
<if test="appAccountId != null">
#{appAccountId,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=INTEGER},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
#{remark,jdbcType=VARCHAR},
</if>
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
<if test="nickname != null and nickname != ''">
nickname = #{nickname,jdbcType=VARCHAR},
</if>
<if test="contactNumber != null and contactNumber != ''">
contact_number = #{contactNumber,jdbcType=VARCHAR},
</if>
<if test="wechatId != null and wechatId != ''">
wechat_id = #{wechatId,jdbcType=VARCHAR},
</if>
<if test="province != null">
province = #{province,jdbcType=INTEGER},
</if>
<if test="city != null">
city = #{city,jdbcType=INTEGER},
</if>
<if test="customerId != null">
customer_id = #{customerId,jdbcType=INTEGER},
</if>
<if test="lastLoginTime != null">
last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
</if>
<if test="appAccountId != null">
app_account_id = #{appAccountId,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
remark = #{remark,jdbcType=VARCHAR},
</if>
</trim>
</insert>
</mapper>
\ No newline at end of file \ No newline at end of file
</update>
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id"
parameterType="com.glsx.model.PlatformUser" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into t_platform_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
nickname,
contact_number,
wechat_id,
province,
city,
customer_id,
last_login_time,
app_account_id,
create_time,
update_time,
create_by,
update_by,
remark,
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
#{nickname,jdbcType=VARCHAR},
#{contactNumber,jdbcType=VARCHAR},
#{wechatId,jdbcType=VARCHAR},
#{province,jdbcType=INTEGER},
#{city,jdbcType=INTEGER},
#{customerId,jdbcType=INTEGER},
#{lastLoginTime,jdbcType=TIMESTAMP},
#{appAccountId,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP},
#{createBy,jdbcType=INTEGER},
#{updateBy,jdbcType=INTEGER},
#{remark,jdbcType=VARCHAR},
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
nickname = #{nickname,jdbcType=VARCHAR},
contact_number = #{contactNumber,jdbcType=VARCHAR},
wechat_id = #{wechatId,jdbcType=VARCHAR},
province = #{province,jdbcType=INTEGER},
city = #{city,jdbcType=INTEGER},
customer_id = #{customerId,jdbcType=INTEGER},
last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
app_account_id = #{appAccountId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=INTEGER},
update_by = #{updateBy,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR},
</trim>
</insert>
<insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id"
parameterType="com.glsx.model.PlatformUser" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into t_platform_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="nickname != null and nickname != ''">
nickname,
</if>
<if test="contactNumber != null and contactNumber != ''">
contact_number,
</if>
<if test="wechatId != null and wechatId != ''">
wechat_id,
</if>
<if test="province != null">
province,
</if>
<if test="city != null">
city,
</if>
<if test="customerId != null">
customer_id,
</if>
<if test="lastLoginTime != null">
last_login_time,
</if>
<if test="appAccountId != null">
app_account_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="remark != null and remark != ''">
remark,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="nickname != null and nickname != ''">
#{nickname,jdbcType=VARCHAR},
</if>
<if test="contactNumber != null and contactNumber != ''">
#{contactNumber,jdbcType=VARCHAR},
</if>
<if test="wechatId != null and wechatId != ''">
#{wechatId,jdbcType=VARCHAR},
</if>
<if test="province != null">
#{province,jdbcType=INTEGER},
</if>
<if test="city != null">
#{city,jdbcType=INTEGER},
</if>
<if test="customerId != null">
#{customerId,jdbcType=INTEGER},
</if>
<if test="lastLoginTime != null">
#{lastLoginTime,jdbcType=TIMESTAMP},
</if>
<if test="appAccountId != null">
#{appAccountId,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=INTEGER},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
#{remark,jdbcType=VARCHAR},
</if>
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
<if test="nickname != null and nickname != ''">
nickname = #{nickname,jdbcType=VARCHAR},
</if>
<if test="contactNumber != null and contactNumber != ''">
contact_number = #{contactNumber,jdbcType=VARCHAR},
</if>
<if test="wechatId != null and wechatId != ''">
wechat_id = #{wechatId,jdbcType=VARCHAR},
</if>
<if test="province != null">
province = #{province,jdbcType=INTEGER},
</if>
<if test="city != null">
city = #{city,jdbcType=INTEGER},
</if>
<if test="customerId != null">
customer_id = #{customerId,jdbcType=INTEGER},
</if>
<if test="lastLoginTime != null">
last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
</if>
<if test="appAccountId != null">
app_account_id = #{appAccountId,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
remark = #{remark,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="
getUserList" resultMap="BaseResultMap">
</select>
</mapper>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!