Commit 10804573 by zhanghj

V1.2.0--选择收货账号,增加用户类型过滤

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@21985 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 49a71d54
......@@ -1142,13 +1142,13 @@ public class UserController extends BaseController {
*/
@RequestMapping(value = "/getAllIndentUserList", method = {RequestMethod.GET, RequestMethod.POST})
@ResponseBody
public ResultObject getAllIndentUserList(Integer pageIndex, Integer pageSize, String queryContent) {
public ResultObject getAllIndentUserList(Integer pageIndex, Integer pageSize, Integer userType, String queryContent) {
Map<String, Object> result = new HashMap<String, Object>(16);
Page page = null;
if (pageIndex != null && pageSize != null) {
page = new Page(pageIndex, pageSize);
}
List<SysManager> list = sysUserService.getAllIndentUserList(queryContent, page);
List<SysManager> list = sysUserService.getAllIndentUserList(userType, queryContent, page);
if (page != null) {
com.github.pagehelper.Page<SysManager> pages = (com.github.pagehelper.Page<SysManager>) list;
page.setTotalCount((int) pages.getTotal());
......
......@@ -158,7 +158,7 @@ public interface SysUserMapper {
* List<SysManager>
*
*/
List<SysManager> getAllIndentUserList(@Param("queryContent") String queryContent);
List<SysManager> getAllIndentUserList(@Param("userType")Integer userType, @Param("queryContent") String queryContent);
Integer getMechanicSP(@Param("userId")Integer userId);
}
\ No newline at end of file
......@@ -322,7 +322,7 @@ public interface SysUserService {
*/
List<SysUser> getMechanicBelongService(Integer userId);
List<SysManager> getAllIndentUserList(String queryContent, Page page);
List<SysManager> getAllIndentUserList(Integer userType, String queryContent, Page page);
/**
*
......
......@@ -900,12 +900,12 @@ public class SysUserServiceImpl implements SysUserService {
}
@Override
public List<SysManager> getAllIndentUserList(String queryContent, Page page) {
public List<SysManager> getAllIndentUserList(Integer userType, String queryContent, Page page) {
// TODO Auto-generated method stub
if (page != null) {
PageHelper.startPage(page.getPageIndex(), page.getPageSize(), true);
}
return sysUserMapper.getAllIndentUserList(queryContent);
return sysUserMapper.getAllIndentUserList(userType, queryContent);
}
@Override
......
......@@ -1342,21 +1342,43 @@
SELECT
* FROM
(
SELECT
su.id, su.username, so.`name` as orgName, su.phone_number, su.user_type
FROM sys_user su
LEFT JOIN sys_organization so ON su.org_id = so.id
WHERE su.user_type = 1
and su.user_status = 'sys_user_status_normal'
UNION
SELECT
su.id, su.username, so.`name` as orgName, su.phone_number, su.user_type
from sys_user su
LEFT JOIN sys_organization so ON su.org_id = so.id
LEFT JOIN sys_mechanic sm ON su.id = sm.user_id
WHERE su.user_type = 3
and su.user_status = 'sys_user_status_normal'
AND sm.send_type = 2
<choose>
<when test="userType != null and userType == 1">
SELECT
su.id, su.username, so.`name` as orgName, su.phone_number, su.user_type
FROM sys_user su
LEFT JOIN sys_organization so ON su.org_id = so.id
WHERE su.user_type = 1
and su.user_status = 'sys_user_status_normal'
</when>
<when test="userType != null and userType == 3">
SELECT
su.id, su.username, so.`name` as orgName, su.phone_number, su.user_type
from sys_user su
LEFT JOIN sys_organization so ON su.org_id = so.id
LEFT JOIN sys_mechanic sm ON su.id = sm.user_id
WHERE su.user_type = 3
and su.user_status = 'sys_user_status_normal'
AND sm.send_type = 2
</when>
<otherwise>
SELECT
su.id, su.username, so.`name` as orgName, su.phone_number, su.user_type
FROM sys_user su
LEFT JOIN sys_organization so ON su.org_id = so.id
WHERE su.user_type = 1
and su.user_status = 'sys_user_status_normal'
UNION
SELECT
su.id, su.username, so.`name` as orgName, su.phone_number, su.user_type
from sys_user su
LEFT JOIN sys_organization so ON su.org_id = so.id
LEFT JOIN sys_mechanic sm ON su.id = sm.user_id
WHERE su.user_type = 3
and su.user_status = 'sys_user_status_normal'
AND sm.send_type = 2
</otherwise>
</choose>
)t
<where>
<if test="queryContent != null and queryContent != ''">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!