Commit f6d2960f authored by sml's avatar sml

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

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