Commit 95cbb269 by ypenglv

Merge branch 'dev' of http://gitlab.polyhome.net/polysoft-nafmii/polysoft-parent into dev

# Conflicts:
#	nafmii-app/pom.xml
#	nafmii-app/src/main/java/org/nafmii/controller/UserController.java
#	nafmii-app/src/main/java/org/nafmii/service/UserService.java
#	nafmii-app/src/main/java/org/nafmii/service/impl/UserServiceImpl.java
#	nafmii-mbg/src/main/java/org/nafmii/nafmiimbg/model/CenterRole.java
#	nafmii-mbg/src/main/java/org/nafmii/nafmiimbg/model/CenterRoleExample.java
#	nafmii-mbg/src/main/resources/org/nafmii/nafmiimbg/mapper/CenterRoleMapper.xml
2 parents 9292bc5f fa74cfed
......@@ -2,15 +2,13 @@ package org.nafmii.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.nafmii.response.ApiResponse;
import org.nafmii.dto.user.RegisterDto;
import org.nafmii.response.Result;
import org.nafmii.service.UserService;
import org.nafmii.vo.UserVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.web.bind.annotation.*;
/**
* @author:zhoujh
......@@ -21,18 +19,27 @@ import org.springframework.web.bind.annotation.RestController;
* @remark:
*/
@RestController
@RequestMapping("/auth")
@Api(tags = "1.0.0", description = "模拟用户操作")
@RequestMapping("app/nafmii/user")
@Api(tags = "2.0.0", description = "用户登陆注册操作操作【zjh】")
public class UserController {
@Autowired
private UserService userService;
@ApiOperation( value = "登陆",notes = "登陆")
@GetMapping("/login")
@ApiOperation( value = "模拟用户登陆",notes = "模拟用户登陆")
@PostMapping("/login")
@ResponseBody
public ApiResponse<UserVO> login (String ss){
ApiResponse<UserVO> login = userService.login(ss);
public Result<UserVO> login (){
Result<UserVO> login = userService.login();
return login;
}
@ApiOperation( value = "app用户注册接口",notes = "app用户注册接口")
@PostMapping("/register")
@ResponseBody
public Result register (@RequestBody RegisterDto registerDto){
Result register = userService.register(registerDto);
return register;
}
}
package org.nafmii.dto.user;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.Date;
/**
* @author:zhoujh
* @Function:TODO
* @date 2021/4/26 13:39
* @ClassName:
* @version:
* @remark:
*/
@Data
@ApiModel("app用户注册参数对象")
public class RegisterDto {
@NotNull(message = "手机号或登录账号不能为空")
@ApiModelProperty("手机号/登录账号")
private String phone;
@ApiModelProperty("头像图片地址")
private String headPicture;
@NotNull(message = "验证码不能为空")
@ApiModelProperty("验证码")
private String code;
@NotNull(message = "注册密码不能为空")
@ApiModelProperty("登陆密码")
private String loginPwd;
@NotNull(message = "确认密码不能为空")
@ApiModelProperty("确认密码")
private String confirmPwd;
}
package org.nafmii.entity;
package org.nafmii.entity.user;
import io.swagger.annotations.ApiModelProperty;
......
package org.nafmii.enums;
/**
* @author:zhoujh
* @Function:TODO
* @date 2021/4/26 14:23
* @ClassName:用户枚举
* @version:
* @remark:
*/
public enum UserEnum {
/**
* 是否开启人脸识别登录 0 未开启 1 已开启
*/
FACE("1", "已开启"),
NOTFACE("0", "未开启"),
/**
* 是否开启指纹登录 0 未开启 1 已开启
*/
FINGERPRINT("1","已开启"),
NOTFINGERPRINT("0","未开启"),
/**
* 是否有效标识 0 有效用户 1无效用户
*/
ENABLE("0","有效用户"),
NOTENABLE("1","无效用户"),
;
UserEnum(String code, String name){
this.code = code;
this.name = name;
}
private String name;
private String code;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
}
package org.nafmii.mapper.user;
import org.apache.ibatis.annotations.Param;
import org.nafmii.entity.user.AppUser;
import org.nafmii.entity.user.AppUserExample;
import java.util.List;
public interface AppUserMapper {
long countByExample(AppUserExample example);
int deleteByExample(AppUserExample example);
int deleteByPrimaryKey(Long id);
int insert(AppUser record);
int insertSelective(AppUser record);
List<AppUser> selectByExample(AppUserExample example);
AppUser selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") AppUser record, @Param("example") AppUserExample example);
int updateByExample(@Param("record") AppUser record, @Param("example") AppUserExample example);
int updateByPrimaryKeySelective(AppUser record);
int updateByPrimaryKey(AppUser record);
}
\ No newline at end of file
package org.nafmii.service;
import org.nafmii.response.ApiResponse;
import org.nafmii.dto.user.RegisterDto;
import org.nafmii.response.Result;
import org.nafmii.vo.UserVO;
/**
......@@ -12,5 +13,8 @@ import org.nafmii.vo.UserVO;
* @remark:
*/
public interface UserService {
ApiResponse<UserVO> login(String ss);
//模拟用户登陆接口
Result<UserVO> login();
//app注册接口
Result register(RegisterDto registerDto);
}
......@@ -2,30 +2,112 @@ package org.nafmii.service.impl;
import org.nafmii.response.ApiResponse;
import lombok.extern.slf4j.Slf4j;
import org.nafmii.dto.user.RegisterDto;
import org.nafmii.entity.user.AppUser;
import org.nafmii.enums.UserEnum;
import org.nafmii.exception.BusinessException;
import org.nafmii.mapper.user.AppUserMapper;
import org.nafmii.response.Result;
import org.nafmii.service.UserService;
import org.nafmii.utils.GuavaUtil;
import org.nafmii.utils.JwtUtils;
import org.nafmii.utils.SnowFlakeUtil;
import org.nafmii.vo.UserAndRoleVo;
import org.nafmii.vo.UserVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* @author:zhoujh
* @Function:TODO
* @date 2021/4/25 10:20
* @ClassName:
* @ClassName:app用户实现类
* @version:
* @remark:
*/
@Service
@Slf4j
public class UserServiceImpl implements UserService {
@Autowired
private AppUserMapper appUserMapper;
/**
* 模拟用户登陆
* @return
*/
@Override
public ApiResponse<UserVO> login(String ss) {
UserVO vo = new UserVO();
vo.setPassword(ss);
return new ApiResponse<>(vo);
public Result<UserVO> login() {
Result result = new Result();
//假设验证数据通过
UserVO userVO = new UserVO();
userVO.setPassword("zzz");
userVO.setUserName("zzz");
List<UserAndRoleVo> roleList =new ArrayList<>();
UserAndRoleVo roleVo = new UserAndRoleVo();
UserAndRoleVo roleTwoVo = new UserAndRoleVo();
roleVo.setRole("a");
roleList.add(roleVo);
roleTwoVo.setRole("b");
roleList.add(roleTwoVo);
userVO.setAuthorities(roleList);
StringBuilder sbf = new StringBuilder();
for (UserAndRoleVo role:roleList
) {
sbf=sbf.append(role.getRole()+",");
}
//处理字符串
String sRole = sbf.toString();
String substring = sRole.substring(0, sRole.lastIndexOf(","));
String token = JwtUtils.createToken(userVO.getUserName(),substring);
userVO.setToken(token);
result.setData(userVO);
return result;
}
/**
* app用户注册接口
* @param registerDto
* @return
*/
@Override
public Result register(RegisterDto registerDto) {
//用户实体类
AppUser appUser = new AppUser();
appUser.setId(SnowFlakeUtil.nextId());
appUser.setFaceidFalg(UserEnum.NOTFACE.getCode());
appUser.setFigerprintFalg(UserEnum.NOTFINGERPRINT.getCode());
appUser.setHeadPicture(registerDto.getHeadPicture());
appUser.setIsEnable(UserEnum.ENABLE.getCode());
appUser.setPhone(registerDto.getPhone());
//判断注册密码和再次输入密码
if (!registerDto.getLoginPwd().equals(registerDto.getConfirmPwd())){
throw new BusinessException("两次密码输入不相同,请再次输入");
}
appUser.setLoginPwd(registerDto.getLoginPwd());
appUser.setCreateTime(new Date());
appUser.setUpdateTime(new Date());
log.info("用户注册实体==============>"+appUser);
//将验证码放入到缓存当中(过期时间60s)test
// GuavaUtil.putTrackGuava(registerDto.getPhone(),registerDto.getCode());
//重缓存中获取(通过手机号获取)
String code = (String) GuavaUtil.getTrackGuava(registerDto.getPhone());
log.info("冲缓存中获取的验证码===============》{}",code);
if (null == code){
throw new BusinessException("验证码已过期");
}
if (!code.equals(registerDto.getCode())){
throw new BusinessException("验证码错误请重新输入");
}
int i = appUserMapper.insertSelective(appUser);
if (i<0){
return Result.failed("新增失败");
}
return Result.success(null);
}
}
......@@ -156,6 +156,18 @@
<version>3.9</version>
</dependency>
<dependency>
<groupId>javax.cache</groupId>
<artifactId>cache-api</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>27.0-android</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.9</version>
......
package org.nafmii.utils;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import lombok.Synchronized;
import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.concurrent.TimeUnit;
/**
* @Author: zjh
* @Date: 2020/7/8 13:28
* @Description:
*/
public class GuavaUtil {
private static Cache<String, Object> guavaCache;
private static Cache<String, Object> guavaCacheForFaceData;
public GuavaUtil() {
}
/**
* 跟踪连缓存
* @return
*/
public static Cache<String, Object> getGuavaCache() {
if (guavaCache == null) {
guavaCache = CacheBuilder.newBuilder().concurrencyLevel(10)
// 存活时间 10 分钟
.expireAfterWrite(10, TimeUnit.MINUTES).maximumSize(100000000).build();
}
return guavaCache;
}
/**
*
* @return
*/
public static Cache<String, Object> getGuavaCacheForFaceData() {
if (guavaCacheForFaceData == null) {
guavaCacheForFaceData = CacheBuilder.newBuilder().concurrencyLevel(10)
.expireAfterWrite(1, TimeUnit.MINUTES).maximumSize(100000000).build();
}
return guavaCacheForFaceData;
}
@Synchronized
public static Object putTrackGuava(String str, Object obj){
if (guavaCache == null) {
guavaCache = CacheBuilder.newBuilder().concurrencyLevel(10)
.expireAfterWrite(1, TimeUnit.MINUTES).maximumSize(100000000).build();
}
return guavaCache.asMap().put(str,obj);
}
public static Object getTrackGuava(String str){
if (guavaCache == null) {
guavaCache = CacheBuilder.newBuilder().build();
}
return guavaCache.asMap().get(str);
}
public static void deleteTrackGuava(String str){
guavaCache =CacheBuilder.newBuilder().build();
guavaCache.invalidate(str);
}
@Synchronized
public static Object putFaceGuava(String str, Object obj){
return guavaCacheForFaceData.asMap().put(str,obj);
}
public static Object getFaceGuava(String str){
return guavaCacheForFaceData.asMap().get(str);
}
public static void deleteFaceGuava(String str){
guavaCacheForFaceData.invalidate(str);
}
public static void main(String[] args) {
// Cache<String, Object> guavaCache = GuavaUtil.getGuavaCache();
//
// guavaCache.asMap().put("asd","asd");
// String asd = (String) guavaCache.asMap().get("asd");
// System.out.println(asd);
GuavaUtil.putTrackGuava("test","1");
String test = (String) GuavaUtil.getTrackGuava("test");
System.out.println(test);
}
}
package org.nafmii.utils;
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.util.Enumeration;
/**
* @description: 雪花算法
* @author: DINGZIYAO
* @date: 2020/9/14 13:59
* @version: v1.0
*/
public class SnowFlakeUtil {
private final static long TWEPOCH = 12888349746579L;
// 机器标识位数
private final static long WORKER_ID_BITS = 5L;
// 数据中心标识位数
private final static long DATACENTER_ID_BITS = 5L;
// 毫秒内自增位数
private final static long SEQUENCE_BITS = 12L;
// 机器ID偏左移12位
private final static long WORKER_ID_SHIFT = SEQUENCE_BITS;
// 数据中心ID左移17位
private final static long DATACENTER_ID_SHIFT = SEQUENCE_BITS + WORKER_ID_BITS;
// 时间毫秒左移22位
private final static long TIMESTAMP_LEFT_SHIFT = SEQUENCE_BITS + WORKER_ID_BITS + DATACENTER_ID_BITS;
//sequence掩码,确保sequnce不会超出上限
private final static long SEQUENCE_MASK = ~(-1L << SEQUENCE_BITS);
//上次时间戳
private static long lastTimestamp = -1L;
//序列
private long sequence = 0L;
//服务器ID
private long workerId = 1L;
private static final long WORKER_MASK = ~(-1L << WORKER_ID_BITS);
//进程编码
private long processId = 1L;
private static final long PROCESS_MASK = ~(-1L << DATACENTER_ID_BITS);
private static SnowFlakeUtil snowFlake = null;
static{
snowFlake = new SnowFlakeUtil();
}
public static synchronized long nextId(){
return snowFlake.getNextId();
}
private SnowFlakeUtil() {
//获取机器编码
this.workerId=this.getMachineNum();
//获取进程编码
RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean();
this.processId= Long.parseLong(runtimeMXBean.getName().split("@")[0]);
//避免编码超出最大值
this.workerId=workerId & WORKER_MASK;
this.processId=processId & PROCESS_MASK;
}
public synchronized long getNextId() {
//获取时间戳
long timestamp = timeGen();
//如果时间戳小于上次时间戳则报错
if (timestamp < lastTimestamp) {
try {
throw new Exception("Clock moved backwards. Refusing to generate id for " + (lastTimestamp - timestamp) + " milliseconds");
} catch (Exception e) {
e.printStackTrace();
}
}
//如果时间戳与上次时间戳相同
if (lastTimestamp == timestamp) {
// 当前毫秒内,则+1,与sequenceMask确保sequence不会超出上限
sequence = (sequence + 1) & SEQUENCE_MASK;
if (sequence == 0) {
// 当前毫秒内计数满了,则等待下一秒
timestamp = tilNextMillis(lastTimestamp);
}
} else {
sequence = 0;
}
lastTimestamp = timestamp;
// ID偏移组合生成最终的ID,并返回ID
long nextId = ((timestamp - TWEPOCH) << TIMESTAMP_LEFT_SHIFT) | (processId << DATACENTER_ID_SHIFT) | (workerId << WORKER_ID_SHIFT) | sequence;
return nextId;
}
/**
* 再次获取时间戳直到获取的时间戳与现有的不同
* @param lastTimestamp
* @return 下一个时间戳
*/
private long tilNextMillis(final long lastTimestamp) {
long timestamp = this.timeGen();
while (timestamp <= lastTimestamp) {
timestamp = this.timeGen();
}
return timestamp;
}
private long timeGen() {
return System.currentTimeMillis();
}
/**
* 获取机器编码
* @return
*/
private long getMachineNum(){
long machinePiece;
StringBuilder sb = new StringBuilder();
Enumeration<NetworkInterface> e = null;
try {
e = NetworkInterface.getNetworkInterfaces();
} catch (SocketException e1) {
e1.printStackTrace();
}
while (e.hasMoreElements()) {
NetworkInterface ni = e.nextElement();
sb.append(ni.toString());
}
machinePiece = sb.toString().hashCode();
return machinePiece;
}
public static void main(String[] args) {
System.out.println(SnowFlakeUtil.nextId());
// 8073480304000524288
// 8073480926335623168
}
}
package org.nafmii.nafmiimbg.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.nafmii.nafmiimbg.model.CenterRole;
import org.nafmii.nafmiimbg.model.CenterRoleExample;
public interface CenterRoleMapper {
long countByExample(CenterRoleExample example);
int deleteByExample(CenterRoleExample example);
int deleteByPrimaryKey(Long id);
int insert(CenterRole record);
int insertSelective(CenterRole record);
List<CenterRole> selectByExample(CenterRoleExample example);
CenterRole selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") CenterRole record, @Param("example") CenterRoleExample example);
int updateByExample(@Param("record") CenterRole record, @Param("example") CenterRoleExample example);
int updateByPrimaryKeySelective(CenterRole record);
int updateByPrimaryKey(CenterRole record);
}
\ No newline at end of file
......@@ -20,12 +20,6 @@ public class CenterRole implements Serializable {
@ApiModelProperty(value = "启用禁用 0 启用 1禁用")
private String isEnable;
@ApiModelProperty(value = "创建人")
private Long createUserId;
@ApiModelProperty(value = "修改人")
private Long updateUserId;
private static final long serialVersionUID = 1L;
public Long getId() {
......@@ -68,22 +62,6 @@ public class CenterRole implements Serializable {
this.isEnable = isEnable;
}
public Long getCreateUserId() {
return createUserId;
}
public void setCreateUserId(Long createUserId) {
this.createUserId = createUserId;
}
public Long getUpdateUserId() {
return updateUserId;
}
public void setUpdateUserId(Long updateUserId) {
this.updateUserId = updateUserId;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
......@@ -95,8 +73,6 @@ public class CenterRole implements Serializable {
sb.append(", creatTime=").append(creatTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", isEnable=").append(isEnable);
sb.append(", createUserId=").append(createUserId);
sb.append(", updateUserId=").append(updateUserId);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
......
......@@ -424,126 +424,6 @@ public class CenterRoleExample {
addCriterion("IS_ENABLE not between", value1, value2, "isEnable");
return (Criteria) this;
}
public Criteria andCreateUserIdIsNull() {
addCriterion("CREATE_USER_ID is null");
return (Criteria) this;
}
public Criteria andCreateUserIdIsNotNull() {
addCriterion("CREATE_USER_ID is not null");
return (Criteria) this;
}
public Criteria andCreateUserIdEqualTo(Long value) {
addCriterion("CREATE_USER_ID =", value, "createUserId");
return (Criteria) this;
}
public Criteria andCreateUserIdNotEqualTo(Long value) {
addCriterion("CREATE_USER_ID <>", value, "createUserId");
return (Criteria) this;
}
public Criteria andCreateUserIdGreaterThan(Long value) {
addCriterion("CREATE_USER_ID >", value, "createUserId");
return (Criteria) this;
}
public Criteria andCreateUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("CREATE_USER_ID >=", value, "createUserId");
return (Criteria) this;
}
public Criteria andCreateUserIdLessThan(Long value) {
addCriterion("CREATE_USER_ID <", value, "createUserId");
return (Criteria) this;
}
public Criteria andCreateUserIdLessThanOrEqualTo(Long value) {
addCriterion("CREATE_USER_ID <=", value, "createUserId");
return (Criteria) this;
}
public Criteria andCreateUserIdIn(List<Long> values) {
addCriterion("CREATE_USER_ID in", values, "createUserId");
return (Criteria) this;
}
public Criteria andCreateUserIdNotIn(List<Long> values) {
addCriterion("CREATE_USER_ID not in", values, "createUserId");
return (Criteria) this;
}
public Criteria andCreateUserIdBetween(Long value1, Long value2) {
addCriterion("CREATE_USER_ID between", value1, value2, "createUserId");
return (Criteria) this;
}
public Criteria andCreateUserIdNotBetween(Long value1, Long value2) {
addCriterion("CREATE_USER_ID not between", value1, value2, "createUserId");
return (Criteria) this;
}
public Criteria andUpdateUserIdIsNull() {
addCriterion("UPDATE_USER_ID is null");
return (Criteria) this;
}
public Criteria andUpdateUserIdIsNotNull() {
addCriterion("UPDATE_USER_ID is not null");
return (Criteria) this;
}
public Criteria andUpdateUserIdEqualTo(Long value) {
addCriterion("UPDATE_USER_ID =", value, "updateUserId");
return (Criteria) this;
}
public Criteria andUpdateUserIdNotEqualTo(Long value) {
addCriterion("UPDATE_USER_ID <>", value, "updateUserId");
return (Criteria) this;
}
public Criteria andUpdateUserIdGreaterThan(Long value) {
addCriterion("UPDATE_USER_ID >", value, "updateUserId");
return (Criteria) this;
}
public Criteria andUpdateUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("UPDATE_USER_ID >=", value, "updateUserId");
return (Criteria) this;
}
public Criteria andUpdateUserIdLessThan(Long value) {
addCriterion("UPDATE_USER_ID <", value, "updateUserId");
return (Criteria) this;
}
public Criteria andUpdateUserIdLessThanOrEqualTo(Long value) {
addCriterion("UPDATE_USER_ID <=", value, "updateUserId");
return (Criteria) this;
}
public Criteria andUpdateUserIdIn(List<Long> values) {
addCriterion("UPDATE_USER_ID in", values, "updateUserId");
return (Criteria) this;
}
public Criteria andUpdateUserIdNotIn(List<Long> values) {
addCriterion("UPDATE_USER_ID not in", values, "updateUserId");
return (Criteria) this;
}
public Criteria andUpdateUserIdBetween(Long value1, Long value2) {
addCriterion("UPDATE_USER_ID between", value1, value2, "updateUserId");
return (Criteria) this;
}
public Criteria andUpdateUserIdNotBetween(Long value1, Long value2) {
addCriterion("UPDATE_USER_ID not between", value1, value2, "updateUserId");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
......
......@@ -37,7 +37,7 @@
<javaClientGenerator type="XMLMAPPER" targetPackage="org.nafmii.nafmiimbg.mapper"
targetProject="nafmii-mbg\src\main\java"/>
<!--生成全部表tableName设为%-->
<table tableName="CENTER_ROLE">
<table tableName="APP_USER">
<!--<generatedKey column="id" sqlStatement="MySql" identity="true"/>-->
</table>
</context>
......
......@@ -7,8 +7,6 @@
<result column="CREAT_TIME" jdbcType="TIMESTAMP" property="creatTime" />
<result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
<result column="IS_ENABLE" jdbcType="VARCHAR" property="isEnable" />
<result column="CREATE_USER_ID" jdbcType="BIGINT" property="createUserId" />
<result column="UPDATE_USER_ID" jdbcType="BIGINT" property="updateUserId" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
......@@ -69,7 +67,7 @@
</where>
</sql>
<sql id="Base_Column_List">
ID, R_NAME, CREAT_TIME, UPDATE_TIME, IS_ENABLE, CREATE_USER_ID, UPDATE_USER_ID
ID, R_NAME, CREAT_TIME, UPDATE_TIME, IS_ENABLE
</sql>
<select id="selectByExample" parameterType="org.nafmii.nafmiimbg.model.CenterRoleExample" resultMap="BaseResultMap">
select
......@@ -103,11 +101,9 @@
</delete>
<insert id="insert" parameterType="org.nafmii.nafmiimbg.model.CenterRole">
insert into CENTER_ROLE (ID, R_NAME, CREAT_TIME,
UPDATE_TIME, IS_ENABLE, CREATE_USER_ID,
UPDATE_USER_ID)
UPDATE_TIME, IS_ENABLE)
values (#{id,jdbcType=BIGINT}, #{rName,jdbcType=VARCHAR}, #{creatTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{isEnable,jdbcType=VARCHAR}, #{createUserId,jdbcType=BIGINT},
#{updateUserId,jdbcType=BIGINT})
#{updateTime,jdbcType=TIMESTAMP}, #{isEnable,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="org.nafmii.nafmiimbg.model.CenterRole">
insert into CENTER_ROLE
......@@ -127,12 +123,6 @@
<if test="isEnable != null">
IS_ENABLE,
</if>
<if test="createUserId != null">
CREATE_USER_ID,
</if>
<if test="updateUserId != null">
UPDATE_USER_ID,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
......@@ -150,12 +140,6 @@
<if test="isEnable != null">
#{isEnable,jdbcType=VARCHAR},
</if>
<if test="createUserId != null">
#{createUserId,jdbcType=BIGINT},
</if>
<if test="updateUserId != null">
#{updateUserId,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="org.nafmii.nafmiimbg.model.CenterRoleExample" resultType="java.lang.Long">
......@@ -182,12 +166,6 @@
<if test="record.isEnable != null">
IS_ENABLE = #{record.isEnable,jdbcType=VARCHAR},
</if>
<if test="record.createUserId != null">
CREATE_USER_ID = #{record.createUserId,jdbcType=BIGINT},
</if>
<if test="record.updateUserId != null">
UPDATE_USER_ID = #{record.updateUserId,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
......@@ -199,9 +177,7 @@
R_NAME = #{record.rName,jdbcType=VARCHAR},
CREAT_TIME = #{record.creatTime,jdbcType=TIMESTAMP},
UPDATE_TIME = #{record.updateTime,jdbcType=TIMESTAMP},
IS_ENABLE = #{record.isEnable,jdbcType=VARCHAR},
CREATE_USER_ID = #{record.createUserId,jdbcType=BIGINT},
UPDATE_USER_ID = #{record.updateUserId,jdbcType=BIGINT}
IS_ENABLE = #{record.isEnable,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
......@@ -221,12 +197,6 @@
<if test="isEnable != null">
IS_ENABLE = #{isEnable,jdbcType=VARCHAR},
</if>
<if test="createUserId != null">
CREATE_USER_ID = #{createUserId,jdbcType=BIGINT},
</if>
<if test="updateUserId != null">
UPDATE_USER_ID = #{updateUserId,jdbcType=BIGINT},
</if>
</set>
where ID = #{id,jdbcType=BIGINT}
</update>
......@@ -235,9 +205,7 @@
set R_NAME = #{rName,jdbcType=VARCHAR},
CREAT_TIME = #{creatTime,jdbcType=TIMESTAMP},
UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
IS_ENABLE = #{isEnable,jdbcType=VARCHAR},
CREATE_USER_ID = #{createUserId,jdbcType=BIGINT},
UPDATE_USER_ID = #{updateUserId,jdbcType=BIGINT}
IS_ENABLE = #{isEnable,jdbcType=VARCHAR}
where ID = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!