增加接口
This commit is contained in:
parent
d6c1d03168
commit
7671d3be28
@ -4,6 +4,7 @@
|
||||
|
||||
<resultMap id="departmentUserDTO" type="ink.wgink.pojo.dtos.department.DepartmentUserDTO">
|
||||
<result column="department_id" property="departmentId"/>
|
||||
<result column="department_name" property="departmentName"/>
|
||||
<result column="user_id" property="userId"/>
|
||||
<result column="user_sort" property="userSort"/>
|
||||
<result column="user_username" property="userUsername"/>
|
||||
@ -84,25 +85,32 @@
|
||||
<!-- 机构用户列表 -->
|
||||
<select id="list" parameterType="map" resultMap="departmentUserDTO">
|
||||
SELECT
|
||||
department_id,
|
||||
user_id,
|
||||
user_sort
|
||||
t1.department_id,
|
||||
st1.department_name,
|
||||
t1.user_id,
|
||||
t1.user_sort
|
||||
FROM
|
||||
sys_department_user
|
||||
sys_department_user t1
|
||||
INNER JOIN
|
||||
sys_department st1
|
||||
ON
|
||||
t1.department_id = st1.department_id
|
||||
<where>
|
||||
st1.is_delete = 0
|
||||
<if test="departmentId != null and departmentId != ''">
|
||||
department_id = #{departmentId}
|
||||
AND
|
||||
st1.department_id = #{departmentId}
|
||||
</if>
|
||||
<if test="departmentIds != null and departmentIds.size > 0">
|
||||
AND
|
||||
department_id IN
|
||||
st1.department_id IN
|
||||
<foreach collection="departmentIds" index="index" open="(" separator="," close=")">
|
||||
#{departmentIds[${index}]}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="userIds != null and userIds.size > 0">
|
||||
AND
|
||||
user_id IN
|
||||
t1.user_id IN
|
||||
<foreach collection="userIds" index="index" open="(" separator="," close=")">
|
||||
#{userIds[${index}]}
|
||||
</foreach>
|
||||
@ -112,12 +120,12 @@
|
||||
ORDER BY
|
||||
<trim suffixOverrides=",">
|
||||
<if test="order == 'userSort'">
|
||||
user_sort <if test="sort != null and sort != ''"><if test="sort == 'asc'">ASC</if><if test="sort == 'desc'">DESC</if></if>,
|
||||
t1.user_sort <if test="sort != null and sort != ''"><if test="sort == 'asc'">ASC</if><if test="sort == 'desc'">DESC</if></if>,
|
||||
</if>
|
||||
</trim>
|
||||
<trim suffixOverrides=",">
|
||||
<if test="order == 'userSort'">
|
||||
user_sort <if test="sort != null and sort != ''"><if test="sort == 'asc'">ASC</if><if test="sort == 'desc'">DESC</if></if>,
|
||||
t1.user_sort <if test="sort != null and sort != ''"><if test="sort == 'asc'">ASC</if><if test="sort == 'desc'">DESC</if></if>,
|
||||
</if>
|
||||
</trim>
|
||||
</if>
|
||||
|
@ -4,6 +4,7 @@ import ink.wgink.exceptions.RemoveException;
|
||||
import ink.wgink.exceptions.SaveException;
|
||||
import ink.wgink.exceptions.SearchException;
|
||||
import ink.wgink.interfaces.init.IInitBaseTable;
|
||||
import ink.wgink.pojo.dtos.group.GroupUserDTO;
|
||||
import ink.wgink.pojo.dtos.user.UserDTO;
|
||||
import ink.wgink.pojo.pos.GroupPO;
|
||||
import org.springframework.stereotype.Repository;
|
||||
@ -84,4 +85,6 @@ public interface IGroupUserDao extends IInitBaseTable {
|
||||
* @throws SearchException
|
||||
*/
|
||||
List<GroupPO> listGroupPO(Map<String, Object> params) throws SearchException;
|
||||
|
||||
List<GroupUserDTO> list(Map<String, Object> params);
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package ink.wgink.service.group.service;
|
||||
|
||||
import ink.wgink.interfaces.group.IGroupUserBaseService;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.dtos.group.GroupUserDTO;
|
||||
import ink.wgink.pojo.dtos.user.UserDTO;
|
||||
import ink.wgink.pojo.pos.GroupPO;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
@ -99,4 +100,5 @@ public interface IGroupUserService extends IGroupUserBaseService {
|
||||
*/
|
||||
SuccessResultList<List<UserDTO>> listPageUser(ListPage page);
|
||||
|
||||
List<GroupUserDTO> listByUserIds(List<String> userIds);
|
||||
}
|
||||
|
@ -160,6 +160,13 @@ public class GroupUserServiceImpl extends DefaultBaseService implements IGroupUs
|
||||
return new SuccessResultList<>(userDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GroupUserDTO> listByUserIds(List<String> userIds) {
|
||||
Map<String,Object> params = getHashMap(2);
|
||||
params.put("userIds", userIds);
|
||||
return groupUserDao.list(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> listUserId(String groupId) {
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
|
@ -2,7 +2,11 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="ink.wgink.service.group.dao.IGroupUserDao">
|
||||
|
||||
|
||||
<resultMap id="groupUserDTO" type="ink.wgink.pojo.dtos.group.GroupUserDTO">
|
||||
<result column="group_id" property="groupId"/>
|
||||
<result column="group_name" property="groupName"/>
|
||||
<result column="user_id" property="userId"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 建表 -->
|
||||
<update id="createTable">
|
||||
@ -223,5 +227,27 @@
|
||||
</where>
|
||||
)
|
||||
</select>
|
||||
|
||||
<select id="list" parameterType="map" resultMap="groupUserDTO">
|
||||
SELECT
|
||||
t1.group_id,
|
||||
st1.group_name,
|
||||
t1.user_id
|
||||
FROM
|
||||
sys_group_user t1
|
||||
INNER JOIN
|
||||
sys_group st1
|
||||
ON
|
||||
t1.group_id = st1.group_id
|
||||
WHERE
|
||||
st1.is_delete = 0
|
||||
<if test="userIds != null and userIds.size > 0">
|
||||
AND
|
||||
t1.user_id IN
|
||||
<foreach collection="userIds" index="index" open="(" separator="," close=")">
|
||||
#{userIds[${index}]}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -4,6 +4,7 @@ import ink.wgink.exceptions.RemoveException;
|
||||
import ink.wgink.exceptions.SaveException;
|
||||
import ink.wgink.exceptions.SearchException;
|
||||
import ink.wgink.interfaces.init.IInitBaseTable;
|
||||
import ink.wgink.pojo.dtos.position.PositionUserDTO;
|
||||
import ink.wgink.pojo.dtos.user.UserDTO;
|
||||
import ink.wgink.pojo.pos.PositionPO;
|
||||
import org.springframework.stereotype.Repository;
|
||||
@ -84,4 +85,6 @@ public interface IPositionUserDao extends IInitBaseTable {
|
||||
* @throws SearchException
|
||||
*/
|
||||
List<PositionPO> listPositionPO(Map<String, Object> params) throws SearchException;
|
||||
|
||||
List<PositionUserDTO> list(Map<String, Object> params);
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package ink.wgink.service.position.service;
|
||||
|
||||
import ink.wgink.interfaces.position.IPositionUserBaseService;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.dtos.position.PositionUserDTO;
|
||||
import ink.wgink.pojo.dtos.user.UserDTO;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
|
||||
@ -96,4 +97,6 @@ public interface IPositionUserService extends IPositionUserBaseService {
|
||||
*/
|
||||
SuccessResultList<List<UserDTO>> listPageUser(ListPage page);
|
||||
|
||||
List<PositionUserDTO> listByUserIds(List<String> userIds);
|
||||
|
||||
}
|
||||
|
@ -164,6 +164,13 @@ public class PositionUserServiceImpl extends DefaultBaseService implements IPosi
|
||||
return new SuccessResultList<>(userDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionUserDTO> listByUserIds(List<String> userIds) {
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
params.put("userIds", userIds);
|
||||
return positionUserDao.list(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> listUserId(String positionId) {
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
|
@ -2,7 +2,11 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="ink.wgink.service.position.dao.IPositionUserDao">
|
||||
|
||||
|
||||
<resultMap id="positionUserDTO" type="ink.wgink.pojo.dtos.position.PositionUserDTO">
|
||||
<result column="position_id" property="positionId"/>
|
||||
<result column="position_name" property="positionName"/>
|
||||
<result column="user_id" property="userId"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 建表 -->
|
||||
<update id="createTable">
|
||||
@ -233,4 +237,26 @@
|
||||
)
|
||||
</select>
|
||||
|
||||
<select id="list" parameterType="map" resultMap="positionUserDTO">
|
||||
SELECT
|
||||
t1.position_id,
|
||||
st1.position_name,
|
||||
t1.user_id
|
||||
FROM
|
||||
sys_position_user t1
|
||||
INNER JOIN
|
||||
sys_position st1
|
||||
ON
|
||||
t1.position_id = st1.position_id
|
||||
WHERE
|
||||
st1.is_delete = 0
|
||||
<if test="userIds != null and userIds.size > 0">
|
||||
AND
|
||||
t1.user_id IN
|
||||
<foreach collection="userIds" index="index" open="(" separator="," close=")">
|
||||
#{userIds[${index}]}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -5,6 +5,7 @@ import ink.wgink.exceptions.SaveException;
|
||||
import ink.wgink.exceptions.SearchException;
|
||||
import ink.wgink.interfaces.init.IInitBaseTable;
|
||||
import ink.wgink.pojo.dtos.department.DepartmentUserDTO;
|
||||
import ink.wgink.pojo.dtos.role.RoleUserDTO;
|
||||
import ink.wgink.pojo.dtos.user.UserDTO;
|
||||
import ink.wgink.pojo.pos.RolePO;
|
||||
import ink.wgink.service.user.pojo.pos.UserPO;
|
||||
@ -104,4 +105,6 @@ public interface IRoleUserDao extends IInitBaseTable {
|
||||
* @throws SearchException
|
||||
*/
|
||||
List<RolePO> listRolePO(Map<String, Object> params) throws SearchException;
|
||||
|
||||
List<RoleUserDTO> list(Map<String, Object> params);
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package ink.wgink.service.role.service;
|
||||
import ink.wgink.interfaces.role.IRoleUserBaseService;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.dtos.department.DepartmentUserDTO;
|
||||
import ink.wgink.pojo.dtos.role.RoleUserDTO;
|
||||
import ink.wgink.pojo.dtos.user.UserDTO;
|
||||
import ink.wgink.pojo.pos.RolePO;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
@ -141,4 +142,10 @@ public interface IRoleUserService extends IRoleUserBaseService {
|
||||
*/
|
||||
List<UserPO> listUserPOByRoleIds(List<String> roleIds);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param userIds
|
||||
* @return
|
||||
*/
|
||||
List<RoleUserDTO> listByUserIds(List<String> userIds);
|
||||
}
|
||||
|
@ -344,6 +344,16 @@ public class RoleUserServiceImpl extends DefaultBaseService implements IRoleUser
|
||||
return listUserPO(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RoleUserDTO> listByUserIds(List<String> userIds) {
|
||||
if (userIds.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
params.put("userIds", userIds);
|
||||
return roleUserDao.list(params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新mongo
|
||||
*
|
||||
|
@ -2,10 +2,9 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="ink.wgink.service.role.dao.IRoleUserDao">
|
||||
|
||||
|
||||
|
||||
<resultMap id="roleUserDTO" type="ink.wgink.pojo.dtos.role.RoleUserDTO" extends="ink.wgink.service.user.dao.IUserDao.userDTO">
|
||||
<result column="role_id" property="roleId"/>
|
||||
<result column="role_name" property="roleName"/>
|
||||
<result column="user_id" property="userId"/>
|
||||
</resultMap>
|
||||
|
||||
@ -513,4 +512,26 @@
|
||||
)
|
||||
</select>
|
||||
|
||||
<select id="list" parameterType="map" resultMap="roleUserDTO">
|
||||
SELECT
|
||||
t1.role_id,
|
||||
st1.role_name,
|
||||
t1.user_id
|
||||
FROM
|
||||
sys_role_user t1
|
||||
INNER JOIN
|
||||
sys_role st1
|
||||
ON
|
||||
t1.role_id = st1.role_id
|
||||
WHERE
|
||||
st1.is_delete = 0
|
||||
<if test="userIds != null and userIds.size > 0">
|
||||
AND
|
||||
t1.user_id IN
|
||||
<foreach collection="userIds" index="index" open="(" separator="," close=")">
|
||||
#{userIds[${index}]}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user