若依 2.0

This commit is contained in:
RuoYi
2020-06-10 11:31:13 +08:00
committed by 疯狂的狮子li
parent cc50a7c8d1
commit d5d7e9b782
61 changed files with 1306 additions and 305 deletions

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi</artifactId>
<version>1.0.0</version>
<version>2.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -5,7 +5,7 @@
<parent>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-modules</artifactId>
<version>1.0.0</version>
<version>2.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -29,10 +29,10 @@
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!-- SpringCloud Netflix Hystrix -->
<!-- SpringCloud Ailibaba Sentinel -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>
<!-- SpringBoot Web -->

View File

@@ -22,7 +22,7 @@ public class VelocityUtils
private static final String PROJECT_PATH = "main/java";
/** mybatis空间路径 */
private static final String MYBATIS_PATH = "main/resources/mybatis";
private static final String MYBATIS_PATH = "main/resources/mapper";
/**
* 设置模板变量信息

View File

@@ -1,6 +1,8 @@
package ${packageName}.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@@ -11,15 +13,15 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import ${packageName}.domain.${ClassName};
import ${packageName}.service.I${ClassName}Service;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
#if($table.crud)
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.common.core.web.page.TableDataInfo;
#elseif($table.tree)
#end
@@ -30,7 +32,7 @@ import com.ruoyi.framework.web.page.TableDataInfo;
* @date ${datetime}
*/
@RestController
@RequestMapping("/${moduleName}/${businessName}")
@RequestMapping("/${businessName}")
public class ${ClassName}Controller extends BaseController
{
@Autowired
@@ -62,11 +64,11 @@ public class ${ClassName}Controller extends BaseController
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:export')")
@Log(title = "${functionName}", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(${ClassName} ${className})
public void export(HttpServletResponse response, ${ClassName} ${className}) throws IOException
{
List<${ClassName}> list = ${className}Service.select${ClassName}List(${className});
ExcelUtil<${ClassName}> util = new ExcelUtil<${ClassName}>(${ClassName}.class);
return util.exportExcel(list, "${businessName}");
return util.exportExcel(response, list, "${businessName}");
}
/**

View File

@@ -42,12 +42,3 @@ export function del${BusinessName}(${pkColumn.javaField}) {
method: 'delete'
})
}
// 导出${functionName}
export function export${BusinessName}(query) {
return request({
url: '/${moduleName}/${businessName}/export',
method: 'get',
params: query
})
}

View File

@@ -229,7 +229,7 @@
</template>
<script>
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName}, export${BusinessName} } from "@/api/${moduleName}/${businessName}";
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}";
export default {
name: "${BusinessName}",
@@ -422,16 +422,9 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有${functionName}数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return export${BusinessName}(queryParams);
}).then(response => {
this.download(response.msg);
}).catch(function() {});
this.download('${moduleName}/${businessName}/export', {
...this.queryParams
}, `${moduleName}_${businessName}.xlsx`)
}
}
};

View File

@@ -5,7 +5,7 @@
<parent>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-modules</artifactId>
<version>1.0.0</version>
<version>2.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -29,10 +29,10 @@
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!-- SpringCloud Netflix Hystrix -->
<!-- SpringCloud Ailibaba Sentinel -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>
<!-- SpringBoot Web -->

View File

@@ -5,7 +5,7 @@
<parent>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-modules</artifactId>
<version>1.0.0</version>
<version>2.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -29,10 +29,10 @@
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!-- SpringCloud Netflix Hystrix -->
<!-- SpringCloud Ailibaba Sentinel -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>
<!-- SpringBoot Web -->

View File

@@ -0,0 +1,94 @@
package com.ruoyi.system.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.system.domain.SysClientDetails;
import com.ruoyi.system.service.ISysClientDetailsService;
/**
* 终端配置 信息操作处理
*
* @author ruoyi
*/
@RestController
@RequestMapping("/client")
public class SysClientDetailsController extends BaseController
{
@Autowired
private ISysClientDetailsService sysClientDetailsService;
/**
* 查询终端配置列表
*/
@PreAuthorize("@ss.hasPermi('system:client:list')")
@GetMapping("/list")
public TableDataInfo list(SysClientDetails sysClientDetails)
{
startPage();
List<SysClientDetails> list = sysClientDetailsService.selectSysClientDetailsList(sysClientDetails);
return getDataTable(list);
}
/**
* 获取终端配置详细信息
*/
@PreAuthorize("@ss.hasPermi('system:client:query')")
@GetMapping(value = "/{clientId}")
public AjaxResult getInfo(@PathVariable("clientId") String clientId)
{
return AjaxResult.success(sysClientDetailsService.selectSysClientDetailsById(clientId));
}
/**
* 新增终端配置
*/
@PreAuthorize("@ss.hasPermi('system:client:add')")
@Log(title = "终端配置", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SysClientDetails sysClientDetails)
{
String clientId = sysClientDetails.getClientId();
if (StringUtils.isNotNull(sysClientDetailsService.selectSysClientDetailsById(clientId)))
{
return AjaxResult.error("新增终端'" + clientId + "'失败,编号已存在");
}
return toAjax(sysClientDetailsService.insertSysClientDetails(sysClientDetails));
}
/**
* 修改终端配置
*/
@PreAuthorize("@ss.hasPermi('system:client:edit')")
@Log(title = "终端配置", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SysClientDetails sysClientDetails)
{
return toAjax(sysClientDetailsService.updateSysClientDetails(sysClientDetails));
}
/**
* 删除终端配置
*/
@PreAuthorize("@ss.hasPermi('system:client:remove')")
@Log(title = "终端配置", businessType = BusinessType.DELETE)
@DeleteMapping("/{clientIds}")
public AjaxResult remove(@PathVariable String[] clientIds)
{
return toAjax(sysClientDetailsService.deleteSysClientDetailsByIds(clientIds));
}
}

View File

@@ -10,7 +10,11 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.constant.Constants;
import com.ruoyi.common.core.utils.ServletUtils;
import com.ruoyi.common.core.utils.ip.IpUtils;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
@@ -40,7 +44,7 @@ public class SysLogininforController extends BaseController
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
return getDataTable(list);
}
@Log(title = "登陆日志", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:logininfor:export')")
@PostMapping("/export")
@@ -67,4 +71,27 @@ public class SysLogininforController extends BaseController
logininforService.cleanLogininfor();
return AjaxResult.success();
}
@PostMapping
public AjaxResult add(@RequestParam("username") String username, @RequestParam("status") String status,
@RequestParam("message") String message)
{
String ip = IpUtils.getIpAddr(ServletUtils.getRequest());
// 封装对象
SysLogininfor logininfor = new SysLogininfor();
logininfor.setUserName(username);
logininfor.setIpaddr(ip);
logininfor.setMsg(message);
// 日志状态
if (Constants.LOGIN_SUCCESS.equals(status) || Constants.LOGOUT.equals(status))
{
logininfor.setStatus("0");
}
else if (Constants.LOGIN_FAIL.equals(status))
{
logininfor.setStatus("1");
}
return toAjax(logininforService.insertLogininfor(logininfor));
}
}

View File

@@ -0,0 +1,197 @@
package com.ruoyi.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.web.domain.BaseEntity;
/**
* 终端配置表 sys_oauth_client_details
*
* @author ruoyi
*/
public class SysClientDetails extends BaseEntity
{
private static final long serialVersionUID = 1L;
/**
* 终端编号
*/
private String clientId;
/**
* 资源ID标识
*/
private String resourceIds;
/**
* 终端安全码
*/
private String clientSecret;
/**
* 终端授权范围
*/
private String scope;
/**
* 终端授权类型
*/
private String authorizedGrantTypes;
/**
* 服务器回调地址
*/
private String webServerRedirectUri;
/**
* 访问资源所需权限
*/
private String authorities;
/**
* 设定终端的access_token的有效时间值
*/
private Integer accessTokenValidity;
/**
* 设定终端的refresh_token的有效时间值
*/
private Integer refreshTokenValidity;
/**
* 附加信息
*/
private String additionalInformation;
/**
* 是否登录时跳过授权
*/
private String autoapprove;
public String getClientId()
{
return clientId;
}
public void setClientId(String clientId)
{
this.clientId = clientId;
}
public String getResourceIds()
{
return resourceIds;
}
public void setResourceIds(String resourceIds)
{
this.resourceIds = resourceIds;
}
public String getClientSecret()
{
return clientSecret;
}
public void setClientSecret(String clientSecret)
{
this.clientSecret = clientSecret;
}
public String getScope()
{
return scope;
}
public void setScope(String scope)
{
this.scope = scope;
}
public String getAuthorizedGrantTypes()
{
return authorizedGrantTypes;
}
public void setAuthorizedGrantTypes(String authorizedGrantTypes)
{
this.authorizedGrantTypes = authorizedGrantTypes;
}
public String getWebServerRedirectUri()
{
return webServerRedirectUri;
}
public void setWebServerRedirectUri(String webServerRedirectUri)
{
this.webServerRedirectUri = webServerRedirectUri;
}
public String getAuthorities()
{
return authorities;
}
public void setAuthorities(String authorities)
{
this.authorities = authorities;
}
public Integer getAccessTokenValidity()
{
return accessTokenValidity;
}
public void setAccessTokenValidity(Integer accessTokenValidity)
{
this.accessTokenValidity = accessTokenValidity;
}
public Integer getRefreshTokenValidity()
{
return refreshTokenValidity;
}
public void setRefreshTokenValidity(Integer refreshTokenValidity)
{
this.refreshTokenValidity = refreshTokenValidity;
}
public String getAdditionalInformation()
{
return additionalInformation;
}
public void setAdditionalInformation(String additionalInformation)
{
this.additionalInformation = additionalInformation;
}
public String getAutoapprove()
{
return autoapprove;
}
public void setAutoapprove(String autoapprove)
{
this.autoapprove = autoapprove;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("clientId", getClientId())
.append("resourceIds", getResourceIds())
.append("clientSecret", getClientSecret())
.append("scope", getScope())
.append("authorizedGrantTypes", getAuthorizedGrantTypes())
.append("webServerRedirectUri", getWebServerRedirectUri())
.append("authorities", getAuthorities())
.append("accessTokenValidity", getAccessTokenValidity())
.append("refreshTokenValidity", getRefreshTokenValidity())
.append("additionalInformation", getAdditionalInformation())
.append("autoapprove", getAutoapprove())
.toString();
}
}

View File

@@ -23,34 +23,22 @@ public class SysLogininfor extends BaseEntity
@Excel(name = "用户账号")
private String userName;
/** 登录状态 0成功 1失败 */
@Excel(name = "登录状态", readConverterExp = "0=成功,1=失败")
/** 状态 0成功 1失败 */
@Excel(name = "状态", readConverterExp = "0=成功,1=失败")
private String status;
/** 登录IP地址 */
@Excel(name = "登录地址")
/** 地址 */
@Excel(name = "地址")
private String ipaddr;
/** 登录地点 */
@Excel(name = "登录地点")
private String loginLocation;
/** 浏览器类型 */
@Excel(name = "浏览器")
private String browser;
/** 操作系统 */
@Excel(name = "操作系统")
private String os;
/** 提示消息 */
@Excel(name = "提示消息")
/** 描述 */
@Excel(name = "描述")
private String msg;
/** 访问时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "访问时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date loginTime;
private Date accessTime;
public Long getInfoId()
{
@@ -92,36 +80,6 @@ public class SysLogininfor extends BaseEntity
this.ipaddr = ipaddr;
}
public String getLoginLocation()
{
return loginLocation;
}
public void setLoginLocation(String loginLocation)
{
this.loginLocation = loginLocation;
}
public String getBrowser()
{
return browser;
}
public void setBrowser(String browser)
{
this.browser = browser;
}
public String getOs()
{
return os;
}
public void setOs(String os)
{
this.os = os;
}
public String getMsg()
{
return msg;
@@ -132,13 +90,13 @@ public class SysLogininfor extends BaseEntity
this.msg = msg;
}
public Date getLoginTime()
public Date getAccessTime()
{
return loginTime;
return accessTime;
}
public void setLoginTime(Date loginTime)
public void setAccessTime(Date accessTime)
{
this.loginTime = loginTime;
this.accessTime = accessTime;
}
}

View File

@@ -0,0 +1,60 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.SysClientDetails;
/**
* 终端配置Mapper接口
*
* @author ruoyi
*/
public interface SysClientDetailsMapper
{
/**
* 查询终端配置
*
* @param clientId 终端配置ID
* @return 终端配置
*/
public SysClientDetails selectSysClientDetailsById(String clientId);
/**
* 查询终端配置列表
*
* @param sysClientDetails 终端配置
* @return 终端配置集合
*/
public List<SysClientDetails> selectSysClientDetailsList(SysClientDetails sysClientDetails);
/**
* 新增终端配置
*
* @param sysClientDetails 终端配置
* @return 结果
*/
public int insertSysClientDetails(SysClientDetails sysClientDetails);
/**
* 修改终端配置
*
* @param sysClientDetails 终端配置
* @return 结果
*/
public int updateSysClientDetails(SysClientDetails sysClientDetails);
/**
* 删除终端配置
*
* @param clientId 终端配置ID
* @return 结果
*/
public int deleteSysClientDetailsById(String clientId);
/**
* 批量删除终端配置
*
* @param clientIds 需要删除的数据ID
* @return 结果
*/
public int deleteSysClientDetailsByIds(String[] clientIds);
}

View File

@@ -15,7 +15,7 @@ public interface SysLogininforMapper
*
* @param logininfor 访问日志对象
*/
public void insertLogininfor(SysLogininfor logininfor);
public int insertLogininfor(SysLogininfor logininfor);
/**
* 查询系统登录日志集合

View File

@@ -0,0 +1,60 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.SysClientDetails;
/**
* 终端配置Service接口
*
* @author ruoyi
*/
public interface ISysClientDetailsService
{
/**
* 查询终端配置
*
* @param clientId 终端配置ID
* @return 终端配置
*/
public SysClientDetails selectSysClientDetailsById(String clientId);
/**
* 查询终端配置列表
*
* @param sysClientDetails 终端配置
* @return 终端配置集合
*/
public List<SysClientDetails> selectSysClientDetailsList(SysClientDetails sysClientDetails);
/**
* 新增终端配置
*
* @param sysClientDetails 终端配置
* @return 结果
*/
public int insertSysClientDetails(SysClientDetails sysClientDetails);
/**
* 修改终端配置
*
* @param sysClientDetails 终端配置
* @return 结果
*/
public int updateSysClientDetails(SysClientDetails sysClientDetails);
/**
* 批量删除终端配置
*
* @param clientIds 需要删除的终端配置ID
* @return 结果
*/
public int deleteSysClientDetailsByIds(String[] clientIds);
/**
* 删除终端配置信息
*
* @param clientId 终端配置ID
* @return 结果
*/
public int deleteSysClientDetailsById(String clientId);
}

View File

@@ -15,7 +15,7 @@ public interface ISysLogininforService
*
* @param logininfor 访问日志对象
*/
public void insertLogininfor(SysLogininfor logininfor);
public int insertLogininfor(SysLogininfor logininfor);
/**
* 查询系统登录日志集合

View File

@@ -0,0 +1,92 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysClientDetailsMapper;
import com.ruoyi.system.domain.SysClientDetails;
import com.ruoyi.system.service.ISysClientDetailsService;
/**
* 终端配置Service业务层处理
*
* @author ruoyi
*/
@Service
public class SysClientDetailsServiceImpl implements ISysClientDetailsService
{
@Autowired
private SysClientDetailsMapper sysClientDetailsMapper;
/**
* 查询终端配置
*
* @param clientId 终端配置ID
* @return 终端配置
*/
@Override
public SysClientDetails selectSysClientDetailsById(String clientId)
{
return sysClientDetailsMapper.selectSysClientDetailsById(clientId);
}
/**
* 查询终端配置列表
*
* @param sysClientDetails 终端配置
* @return 终端配置
*/
@Override
public List<SysClientDetails> selectSysClientDetailsList(SysClientDetails sysClientDetails)
{
return sysClientDetailsMapper.selectSysClientDetailsList(sysClientDetails);
}
/**
* 新增终端配置
*
* @param sysClientDetails 终端配置
* @return 结果
*/
@Override
public int insertSysClientDetails(SysClientDetails sysClientDetails)
{
return sysClientDetailsMapper.insertSysClientDetails(sysClientDetails);
}
/**
* 修改终端配置
*
* @param sysClientDetails 终端配置
* @return 结果
*/
@Override
public int updateSysClientDetails(SysClientDetails sysClientDetails)
{
return sysClientDetailsMapper.updateSysClientDetails(sysClientDetails);
}
/**
* 批量删除终端配置
*
* @param clientIds 需要删除的终端配置ID
* @return 结果
*/
@Override
public int deleteSysClientDetailsByIds(String[] clientIds)
{
return sysClientDetailsMapper.deleteSysClientDetailsByIds(clientIds);
}
/**
* 删除终端配置信息
*
* @param clientId 终端配置ID
* @return 结果
*/
@Override
public int deleteSysClientDetailsById(String clientId)
{
return sysClientDetailsMapper.deleteSysClientDetailsById(clientId);
}
}

View File

@@ -25,9 +25,9 @@ public class SysLogininforServiceImpl implements ISysLogininforService
* @param logininfor 访问日志对象
*/
@Override
public void insertLogininfor(SysLogininfor logininfor)
public int insertLogininfor(SysLogininfor logininfor)
{
logininforMapper.insertLogininfor(logininfor);
return logininforMapper.insertLogininfor(logininfor);
}
/**

View File

@@ -0,0 +1,95 @@
<?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">
<mapper namespace="com.ruoyi.system.mapper.SysClientDetailsMapper">
<resultMap type="SysClientDetails" id="SysClientDetailsResult">
<result property="clientId" column="client_id" />
<result property="resourceIds" column="resource_ids" />
<result property="clientSecret" column="client_secret" />
<result property="scope" column="scope" />
<result property="authorizedGrantTypes" column="authorized_grant_types" />
<result property="webServerRedirectUri" column="web_server_redirect_uri" />
<result property="authorities" column="authorities" />
<result property="accessTokenValidity" column="access_token_validity" />
<result property="refreshTokenValidity" column="refresh_token_validity" />
<result property="additionalInformation" column="additional_information" />
<result property="autoapprove" column="autoapprove" />
</resultMap>
<sql id="selectSysClientDetailsVo">
select client_id, resource_ids, client_secret, scope, authorized_grant_types, web_server_redirect_uri, authorities, access_token_validity, refresh_token_validity, additional_information, autoapprove from sys_oauth_client_details
</sql>
<select id="selectSysClientDetailsList" parameterType="SysClientDetails" resultMap="SysClientDetailsResult">
<include refid="selectSysClientDetailsVo"/>
<where>
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
</where>
</select>
<select id="selectSysClientDetailsById" parameterType="String" resultMap="SysClientDetailsResult">
<include refid="selectSysClientDetailsVo"/>
where client_id = #{clientId}
</select>
<insert id="insertSysClientDetails" parameterType="SysClientDetails">
insert into sys_oauth_client_details
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="clientId != null">client_id,</if>
<if test="resourceIds != null">resource_ids,</if>
<if test="clientSecret != null">client_secret,</if>
<if test="scope != null">scope,</if>
<if test="authorizedGrantTypes != null">authorized_grant_types,</if>
<if test="webServerRedirectUri != null">web_server_redirect_uri,</if>
<if test="authorities != null">authorities,</if>
<if test="accessTokenValidity != null">access_token_validity,</if>
<if test="refreshTokenValidity != null">refresh_token_validity,</if>
<if test="additionalInformation != null">additional_information,</if>
<if test="autoapprove != null">autoapprove,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="clientId != null">#{clientId},</if>
<if test="resourceIds != null">#{resourceIds},</if>
<if test="clientSecret != null">#{clientSecret},</if>
<if test="scope != null">#{scope},</if>
<if test="authorizedGrantTypes != null">#{authorizedGrantTypes},</if>
<if test="webServerRedirectUri != null">#{webServerRedirectUri},</if>
<if test="authorities != null">#{authorities},</if>
<if test="accessTokenValidity != null">#{accessTokenValidity},</if>
<if test="refreshTokenValidity != null">#{refreshTokenValidity},</if>
<if test="additionalInformation != null">#{additionalInformation},</if>
<if test="autoapprove != null ">#{autoapprove},</if>
</trim>
</insert>
<update id="updateSysClientDetails" parameterType="SysClientDetails">
update sys_oauth_client_details
<trim prefix="SET" suffixOverrides=",">
<if test="resourceIds != null">resource_ids = #{resourceIds},</if>
<if test="clientSecret != null">client_secret = #{clientSecret},</if>
<if test="scope != null">scope = #{scope},</if>
<if test="authorizedGrantTypes != null">authorized_grant_types = #{authorizedGrantTypes},</if>
<if test="webServerRedirectUri != null">web_server_redirect_uri = #{webServerRedirectUri},</if>
<if test="authorities != null">authorities = #{authorities},</if>
<if test="accessTokenValidity != null">access_token_validity = #{accessTokenValidity},</if>
<if test="refreshTokenValidity != null">refresh_token_validity = #{refreshTokenValidity},</if>
<if test="additionalInformation != null">additional_information = #{additionalInformation},</if>
<if test="autoapprove != null">autoapprove = #{autoapprove},</if>
</trim>
where client_id = #{clientId}
</update>
<delete id="deleteSysClientDetailsById" parameterType="String">
delete from sys_oauth_client_details where client_id = #{clientId}
</delete>
<delete id="deleteSysClientDetailsByIds" parameterType="String">
delete from sys_oauth_client_details where client_id in
<foreach item="clientId" collection="array" open="(" separator="," close=")">
#{clientId}
</foreach>
</delete>
</mapper>

View File

@@ -9,20 +9,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="userName" column="user_name" />
<result property="status" column="status" />
<result property="ipaddr" column="ipaddr" />
<result property="loginLocation" column="login_location" />
<result property="browser" column="browser" />
<result property="os" column="os" />
<result property="msg" column="msg" />
<result property="loginTime" column="login_time" />
<result property="accessTime" column="access_time" />
</resultMap>
<insert id="insertLogininfor" parameterType="SysLogininfor">
insert into sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time)
values (#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, sysdate())
insert into sys_logininfor (user_name, status, ipaddr, msg, access_time)
values (#{userName}, #{status}, #{ipaddr}, #{msg}, sysdate())
</insert>
<select id="selectLogininforList" parameterType="SysLogininfor" resultMap="SysLogininforResult">
select info_id, user_name, ipaddr, login_location, browser, os, status, msg, login_time from sys_logininfor
select info_id, user_name, ipaddr, status, msg, access_time from sys_logininfor
<where>
<if test="ipaddr != null and ipaddr != ''">
AND ipaddr like concat('%', #{ipaddr}, '%')
@@ -34,10 +31,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND user_name like concat('%', #{userName}, '%')
</if>
<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
and date_format(login_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
and date_format(access_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
</if>
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
and date_format(login_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
and date_format(access_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if>
</where>
order by info_id desc

View File

@@ -15,7 +15,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="deptName" column="dept_name" />
<result property="operUrl" column="oper_url" />
<result property="operIp" column="oper_ip" />
<result property="operLocation" column="oper_location" />
<result property="operParam" column="oper_param" />
<result property="jsonResult" column="json_result" />
<result property="status" column="status" />
@@ -24,13 +23,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectOperLogVo">
select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time
select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_param, json_result, status, error_msg, oper_time
from sys_oper_log
</sql>
<insert id="insertOperlog" parameterType="SysOperLog">
insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time)
values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, sysdate())
insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_param, json_result, status, error_msg, oper_time)
values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, sysdate())
</insert>
<select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult">