Commit f6d2960f authored by sml's avatar sml

resultMap子查询分页组件冲突问题解决

parent 880656a1
......@@ -101,7 +101,7 @@ public class DmpMemberController {
* @param dmpMemberRequest
* @return
*/
//@RequestMapping(method = RequestMethod.POST, value = "/delete")
//@RequestMapping(method = RequestMethod.GET, value = "/delete")
//@ApiOperation(value = "删除用户表", notes = "删除用户表")
//@ApiImplicitParam(name = "userId", value = "用户表主键")
public BaseResponse delete(@RequestParam(name = "userId", required = true ) Integer userId, HttpServletRequest httpRequest){
......@@ -121,7 +121,7 @@ public class DmpMemberController {
* @param userId
* @return
*/
@RequestMapping(method = RequestMethod.POST, value = "/softDelete")
@RequestMapping(method = RequestMethod.GET, value = "/softDelete")
@ApiOperation(value = "软删除用户表", notes = "软删除用户表")
@ApiImplicitParam(name = "userId", value = "用户表主键")
public BaseResponse softDelete(@RequestParam(name = "userId", required = true ) Integer userId, HttpServletRequest httpRequest){
......@@ -198,7 +198,7 @@ public class DmpMemberController {
* @param dmpMemberRequest
* @return
*/
@RequestMapping(method = RequestMethod.POST, value = "/switchProj")
@RequestMapping(method = RequestMethod.GET, value = "/switchProj")
@ApiImplicitParam(name = "projectId", value = "项目主键")
@ApiOperation(value = "用户项目切换", notes = "用户项目切换")
public BaseBeanResponse<DmpMember> switchProj(@RequestParam(name = "projectId", required = true) Integer projectId, HttpServletRequest httpRequest){
......@@ -218,7 +218,7 @@ public class DmpMemberController {
* @param dmpMemberRequest
* @return
*/
@RequestMapping(method = RequestMethod.POST, value = "/findListUnChoose")
@RequestMapping(method = RequestMethod.GET, value = "/findListUnChoose")
@ApiOperation(value = "获取项目下不是成员的所有用户", notes = "获取项目下不是成员的所有用户")
@ApiImplicitParam(name = "projectId", value = "项目主键")
public BaseBeanResponse<DmpMemberDto> findListUnChoose(@RequestParam(name = "projectId", required = true) Integer projectId, HttpServletRequest httpRequest){
......
package com.jz.dmp.modules.controller.sys.bean;
import java.io.Serializable;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.jz.dmp.modules.model.DmpMember;
import com.jz.dmp.modules.model.DmpRole;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -14,7 +17,13 @@ import lombok.Data;
*/
@Data
@ApiModel(value = "用户表Dto", description = "用户表Dto")
public class DmpMemberDto extends DmpMember {
@JsonIgnoreProperties(value = {"handler"})
public class DmpMemberDto extends DmpMember implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "项目角色列表")
private List<String> roles;
......
......@@ -7,9 +7,12 @@ import java.util.Collection;
import java.util.Date;
import java.util.List;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import com.fasterxml.jackson.annotation.JsonFormat;
/**用户表
* @author ybz
*
......@@ -56,6 +59,7 @@ public class DmpMember implements UserDetails{
* 最近登录时间
*/
@ApiModelProperty(value = "最近登录时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date loginTime;
/**
......@@ -92,6 +96,7 @@ public class DmpMember implements UserDetails{
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/**
......@@ -104,6 +109,7 @@ public class DmpMember implements UserDetails{
* 修改时间
*/
@ApiModelProperty(value = "修改时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
@ApiModelProperty(value = "用户当前所在工作空间(项目)")
......
......@@ -7,6 +7,8 @@ import java.io.Serializable;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
/**资源表
* @author ybz
*
......@@ -88,6 +90,7 @@ public class DmpPermission implements Serializable {
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/**
......@@ -100,6 +103,7 @@ public class DmpPermission implements Serializable {
* 修改时间
*/
@ApiModelProperty(value = "修改时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
@ApiModelProperty(value = "所有孩子节点")
......
......@@ -6,6 +6,8 @@ import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
/**角色表
* @author ybz
*
......@@ -69,6 +71,7 @@ public class DmpRole implements Serializable{
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/**
......@@ -81,6 +84,7 @@ public class DmpRole implements Serializable{
* 修改时间
*/
@ApiModelProperty(value = "修改时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
public Integer getRoleId() {
......
......@@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.jz.dmp.modules.dao.sys.DmpMemberMapper" >
<resultMap id="BaseResultMap" type="com.jz.dmp.modules.model.DmpMember">
<result column="user_id" property="userId" jdbcType="INTEGER" />
<id column="user_id" property="userId" jdbcType="INTEGER" />
<result column="user_name" property="userName" jdbcType="VARCHAR" />
<result column="user_password" property="userPassword" jdbcType="VARCHAR" />
<result column="real_name" property="realName" jdbcType="VARCHAR" />
......@@ -19,14 +19,23 @@
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
</resultMap>
<!-- <resultMap id="roleMap" type="com.jz.dmp.modules.model.DmpRole">
<result column="role_name" property="roleName" jdbcType="VARCHAR" />
</resultMap> -->
<resultMap id="BaseDtoResultMap" type="com.jz.dmp.modules.controller.sys.bean.DmpMemberDto" extends="BaseResultMap">
<!-- /*$BaseDtoResultMapContent$*/ -->
<collection property="roles" ofType="java.lang.String">
<constructor>
<arg column="role_name" />
</constructor>
<collection property="roles" ofType="java.lang.String" javaType="java.util.List"
column="userId" select="getRoleNamesByUserid">
</collection>
</resultMap>
<!-- 封装用户项目角色信息 -->
<select id="getRoleNamesByUserid" resultType="java.lang.String">
select role.role_name
from dmp_member_project_role mprole left join dmp_role role on mprole.role_id = role.role_id
where mprole.user_id=#{userId,jdbcType=INTEGER}
</select>
<sql id="Base_Column_List">
user_id, user_name, user_password, real_name, user_phone,
......@@ -37,8 +46,7 @@
<sql id="BaseDto_Column_List">
m.user_id, m.user_name, m.user_password, m.real_name, m.user_phone,
m.login_ip, m.login_time, m.login_locked, m.login_errtimes, m.remark,
m.data_status, m.create_user_id, m.create_time, m.update_user_id, m.update_time,
role.role_name
m.data_status, m.create_user_id, m.create_time, m.update_user_id, m.update_time
</sql>
<!-- 根据主键查询用户表 -->
......@@ -271,7 +279,7 @@
<!-- 条件查询用户表 -->
<select id="findList" resultMap="BaseDtoResultMap">
SELECT
SELECT DISTINCT
<include refid="BaseDto_Column_List"/>
FROM dmp_member m
left join dmp_member_project_role mprole on m.user_id=mprole.user_id
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment