Your Name 2 년 전
부모
커밋
a5371d7e59

+ 15
- 7
src/main/java/com/example/civilizedcity/common/BaseController.java 파일 보기

@@ -8,9 +8,15 @@ import com.example.civilizedcity.service.TaPersonService;
8 8
 import org.springframework.beans.factory.annotation.Autowired;
9 9
 import org.springframework.stereotype.Component;
10 10
 
11
+import javax.annotation.Resource;
12
+import javax.servlet.http.HttpServletRequest;
13
+
11 14
 @Component
12 15
 public class BaseController {
13 16
 
17
+    @Resource
18
+    HttpServletRequest request;
19
+
14 20
     @Autowired
15 21
     protected SysUserService sysUserService;
16 22
 
@@ -23,23 +29,25 @@ public class BaseController {
23 29
             throw new Exception("请先登录");
24 30
         }
25 31
 
26
-        SysUser user = sysUserService.getById(loginId);
32
+        String userId = loginId;
33
+        SysUser user = sysUserService.getById(userId);
27 34
         if (user == null || user.getStatus() == Constants.STATUS_DELETE) {
28
-            throw new Exception("人员不存在");
35
+            return null;
29 36
         }
30 37
 
31 38
         return user;
32 39
     }
33 40
 
34 41
     public TaPerson currentPerson() throws Exception {
35
-        String loginId = StpUtil.getLoginIdAsString();
36
-        if (StringUtils.isEmpty(loginId)) {
37
-            throw new Exception("请先登录");
42
+
43
+        String personId = request.getHeader("x-personId");
44
+        if (StringUtils.isEmpty(personId)) {
45
+            return null;
38 46
         }
39 47
 
40
-        TaPerson taPerson = taPersonService.getById(loginId);
48
+        TaPerson taPerson = taPersonService.getById(personId);
41 49
         if (taPerson == null || taPerson.getStatus() == Constants.STATUS_DELETE) {
42
-            throw new Exception("人员不存在");
50
+            return null;
43 51
         }
44 52
 
45 53
         return taPerson;

+ 19
- 0
src/main/java/com/example/civilizedcity/controller/SysOrgController.java 파일 보기

@@ -82,11 +82,19 @@ public class SysOrgController extends BaseController {
82 82
             return ResponseBean.error("名称不能为空");
83 83
         }
84 84
 
85
+        if (StringUtils.isEmpty(sysOrg.getOrgPId())) {
86
+            return ResponseBean.error("父级节点不能为空");
87
+        }
88
+
85 89
         long i = sysOrgService.countBy("name", sysOrg.getName(), false);
86 90
         if (i > 0) {
87 91
             return ResponseBean.error("名称已存在");
88 92
         }
89 93
 
94
+        // 构造 org 编码
95
+        long maxCode = sysOrgService.getMaxCodeOfParent(sysOrg.getOrgPId());
96
+        sysOrg.setOrgCode(String.valueOf(maxCode + 1));
97
+
90 98
         sysOrg.setOrgId(null);
91 99
         sysOrg.setStatus(Constants.STATUS_NORMAL);
92 100
         sysOrg.setCreateDate(LocalDateTime.now());
@@ -113,6 +121,17 @@ public class SysOrgController extends BaseController {
113 121
             return ResponseBean.error("名称已存在");
114 122
         }
115 123
 
124
+        // 比较是否更新了父节点
125
+        SysOrg origin = sysOrgService.getById(id);
126
+        if (!origin.getOrgPId().equals(sysOrg.getOrgPId())) {
127
+            // 如果更换了
128
+            long maxCode = sysOrgService.getMaxCodeOfParent(sysOrg.getOrgPId());
129
+            String newCode = String.valueOf(maxCode + 1);
130
+            // 当前节点以及子节点,全部更换
131
+            sysOrgService.changeOrgCode(origin.getOrgCode(), newCode);
132
+            sysOrg.setOrgCode(newCode);
133
+        }
134
+
116 135
         sysOrg.setOrgId(id);
117 136
         sysOrgService.updateById(sysOrg);
118 137
         return ResponseBean.success(sysOrg);

+ 3
- 3
src/main/java/com/example/civilizedcity/controller/TaCheckItemQuController.java 파일 보기

@@ -64,7 +64,7 @@ public class TaCheckItemQuController extends BaseController {
64 64
         IPage<TaCheckItemQu> pg = new Page<>(pageNum, pageSize);
65 65
         QueryWrapper<TaCheckItemQu> queryWrapper = new QueryWrapper<>();
66 66
         queryWrapper.eq("item_id", itemId);
67
-        queryWrapper.orderByDesc("sort_no");
67
+        queryWrapper.orderByAsc("sort_no");
68 68
         IPage<TaCheckItemQu> result = taCheckItemQuService.page(pg, queryWrapper);
69 69
 
70 70
         List<TaCheckItemQu> quList = result.getRecords();
@@ -125,8 +125,8 @@ public class TaCheckItemQuController extends BaseController {
125 125
      */
126 126
     @ApiOperation("通过主键删除数据")
127 127
     @DeleteMapping("/taCheckItemQu/{id}")
128
-    public ResponseBean deleteById(@ApiParam("对象ID") @PathVariable Integer id) {
129
-        taCheckItemQuService.removeLogicById(id);
128
+    public ResponseBean deleteById(@ApiParam("对象ID") @PathVariable String id) {
129
+        taCheckItemQuService.removeById(id);
130 130
         return ResponseBean.success("success");
131 131
     }
132 132
 }

+ 28
- 23
src/main/java/com/example/civilizedcity/controller/TdLocTypeController.java 파일 보기

@@ -4,8 +4,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4 4
 import com.baomidou.mybatisplus.core.metadata.IPage;
5 5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6 6
 import com.example.civilizedcity.common.BaseController;
7
+import com.example.civilizedcity.common.Constants;
7 8
 import com.example.civilizedcity.common.ResponseBean;
9
+
8 10
 import java.util.List;
11
+
9 12
 import io.swagger.annotations.Api;
10 13
 import io.swagger.annotations.ApiOperation;
11 14
 import io.swagger.annotations.ApiParam;
@@ -14,8 +17,9 @@ import org.springframework.web.bind.annotation.*;
14 17
 import com.example.civilizedcity.entity.TdLocType;
15 18
 import com.example.civilizedcity.service.TdLocTypeService;
16 19
 
17
- /**
20
+/**
18 21
  * 点位分类;(td_loc_type)表控制层
22
+ *
19 23
  * @author : http://njyunzhi.com
20 24
  * @date : 2022-12-12
21 25
  */
@@ -23,12 +27,12 @@ import com.example.civilizedcity.service.TdLocTypeService;
23 27
 @RestController
24 28
 @RequestMapping("/")
25 29
 public class TdLocTypeController extends BaseController {
26
-    
30
+
27 31
     @Autowired
28 32
     private TdLocTypeService tdLocTypeService;
29
-    
30
-    /** 
31
-     * 通过ID查询单条数据 
33
+
34
+    /**
35
+     * 通过ID查询单条数据
32 36
      *
33 37
      * @param typeId 主键
34 38
      * @return 实例对象
@@ -38,28 +42,29 @@ public class TdLocTypeController extends BaseController {
38 42
     public ResponseBean queryById(@ApiParam("对象ID") @PathVariable String id) throws Exception {
39 43
         return ResponseBean.success(tdLocTypeService.getById(id));
40 44
     }
41
-    
42
-    /** 
45
+
46
+    /**
43 47
      * 分页查询
44 48
      *
45
-     * @param pageNum 当前页码
49
+     * @param pageNum  当前页码
46 50
      * @param pageSize 每页条数
47 51
      * @return 查询结果
48 52
      */
49 53
     @ApiOperation("分页查询")
50 54
     @GetMapping("/tdLocType")
51
-    public ResponseBean list(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
52
-                            @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception {
53
-        
55
+    public ResponseBean list(@ApiParam("页码") @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
56
+                             @ApiParam("单页数据量") @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) throws Exception {
57
+
54 58
         IPage<TdLocType> pg = new Page<>(pageNum, pageSize);
55
-        // QueryWrapper<TdLocType> queryWrapper = new QueryWrapper<>();
56
-        // queryWrapper.orderByDesc("create_date");
57
-        IPage<TdLocType> result = tdLocTypeService.page(pg);
58
-        
59
+        QueryWrapper<TdLocType> queryWrapper = new QueryWrapper<>();
60
+        queryWrapper.gt("status", Constants.STATUS_DELETE);
61
+        queryWrapper.orderByDesc("create_date");
62
+        IPage<TdLocType> result = tdLocTypeService.page(pg, queryWrapper);
63
+
59 64
         return ResponseBean.success(result);
60 65
     }
61
-    
62
-    /** 
66
+
67
+    /**
63 68
      * 新增数据
64 69
      *
65 70
      * @param tdLocType 实例对象
@@ -72,8 +77,8 @@ public class TdLocTypeController extends BaseController {
72 77
         tdLocTypeService.save(tdLocType);
73 78
         return ResponseBean.success(tdLocType);
74 79
     }
75
-    
76
-    /** 
80
+
81
+    /**
77 82
      * 更新数据
78 83
      *
79 84
      * @param tdLocType 实例对象
@@ -82,13 +87,13 @@ public class TdLocTypeController extends BaseController {
82 87
     @ApiOperation("更新数据")
83 88
     @PutMapping("/tdLocType/{id}")
84 89
     public ResponseBean edit(@ApiParam("对象实体") @RequestBody TdLocType tdLocType,
85
-                            @ApiParam("对象ID") @PathVariable String id ) throws Exception {
90
+                             @ApiParam("对象ID") @PathVariable String id) throws Exception {
86 91
         tdLocType.setTypeId(id);
87 92
         tdLocTypeService.updateById(tdLocType);
88 93
         return ResponseBean.success(tdLocType);
89 94
     }
90
-    
91
-    /** 
95
+
96
+    /**
92 97
      * 通过主键删除数据
93 98
      *
94 99
      * @param typeId 主键
@@ -96,7 +101,7 @@ public class TdLocTypeController extends BaseController {
96 101
      */
97 102
     @ApiOperation("通过主键删除数据")
98 103
     @DeleteMapping("/tdLocType/{id}")
99
-    public ResponseBean deleteById(@ApiParam("对象ID") @PathVariable String id){
104
+    public ResponseBean deleteById(@ApiParam("对象ID") @PathVariable String id) {
100 105
         tdLocTypeService.removeLogicById(id);
101 106
         return ResponseBean.success("success");
102 107
     }

+ 31
- 18
src/main/java/com/example/civilizedcity/controller/WxMaController.java 파일 보기

@@ -12,6 +12,7 @@ import com.example.civilizedcity.config.WxMaUitl;
12 12
 import com.example.civilizedcity.entity.SysUser;
13 13
 import com.example.civilizedcity.entity.TaPerson;
14 14
 import com.example.civilizedcity.entity.TaPersonReflect;
15
+import com.example.civilizedcity.service.SysUserDutyService;
15 16
 import com.example.civilizedcity.service.TaPersonReflectService;
16 17
 import com.example.civilizedcity.vo.LoginParam;
17 18
 import io.swagger.annotations.Api;
@@ -22,6 +23,7 @@ import org.springframework.web.bind.annotation.*;
22 23
 
23 24
 import java.time.LocalDateTime;
24 25
 import java.util.HashMap;
26
+import java.util.List;
25 27
 import java.util.Map;
26 28
 
27 29
 @Api(tags = "小程序登入/登出")
@@ -35,6 +37,9 @@ public class WxMaController extends BaseController {
35 37
     @Autowired
36 38
     TaPersonReflectService taPersonReflectService;
37 39
 
40
+    @Autowired
41
+    SysUserDutyService sysUserDutyService;
42
+
38 43
 
39 44
 //    private boolean checkLoginParam(LoginParam loginParam) {
40 45
 //        return !StringUtils.isEmpty(loginParam.getCode())
@@ -84,13 +89,8 @@ public class WxMaController extends BaseController {
84 89
             taPersonService.save(taPerson);
85 90
         }
86 91
 
87
-//        SysUser user = taPersonService.getReflectUser(taPerson);
88
-
89
-        StpUtil.login(taPerson.getPersonId(), "miniapp");
90 92
         Map<String, Object> res = new HashMap<>();
91 93
         res.put("person", taPerson);
92
-//        res.put("user", user);
93
-        res.put("token", StpUtil.getTokenValue());
94 94
         res.put("sessionKey", sessionKey);
95 95
 
96 96
         return ResponseBean.success(res);
@@ -102,31 +102,44 @@ public class WxMaController extends BaseController {
102 102
      * @return
103 103
      * @throws Exception
104 104
      */
105
-    public ResponseBean signin(@ApiParam("登录参数") LoginParam param) throws Exception {
105
+    @PostMapping("/signin")
106
+    @ApiOperation(value="用户登录", notes = "用户登录", httpMethod = "POST", response = ResponseBean.class)
107
+    public ResponseBean signin(@ApiParam("登录参数") @RequestBody LoginParam param) throws Exception {
106 108
 
107 109
         if (StringUtils.isEmpty(param.getAccount()) || StringUtils.isEmpty(param.getPassword())) {
108 110
             return ResponseBean.error("登录用户或者密码不能为空");
109 111
         }
110 112
 
111 113
         SysUser user = sysUserService.login(param);
114
+        List<String> dutyList = sysUserDutyService.getListByUser(user.getUserId());
115
+        user.setDutyList(dutyList);
112 116
 
113
-        TaPerson taPerson = currentPerson();
114
-        TaPerson reflectd = taPersonService.getByUser(user);
117
+        // 登录新用户
118
+        StpUtil.login(user.getUserId(), "miniapp");
115 119
 
116
-        // 如果未绑定
117
-        if (null == reflectd) {
118
-            TaPersonReflect personReflect = new TaPersonReflect();
119
-            taPersonReflectService.save(personReflect);
120
-            reflectd = taPerson;
121
-        }
120
+        Map<String, Object> res = new HashMap<>();
121
+        res.put("user", user);
122
+        res.put("token", StpUtil.getTokenValue());
123
+
124
+        return ResponseBean.success(res);
125
+    }
126
+
127
+    /**
128
+     * 获取当前用户
129
+     * @return
130
+     * @throws Exception
131
+     */
132
+    @GetMapping("/current")
133
+    @ApiOperation(value="获取当前用户", notes = "获取当前用户", httpMethod = "GET", response = ResponseBean.class)
134
+    public ResponseBean current() throws Exception {
135
+        SysUser user = currentUser();
136
+        List<String> dutyList = sysUserDutyService.getListByUser(user.getUserId());
137
+        user.setDutyList(dutyList);
122 138
 
123
-        // 退出原用户
124
-        StpUtil.logout(taPerson.getPersonId(), "miniapp");
125 139
         // 登录新用户
126
-        StpUtil.login(reflectd.getPersonId(), "miniapp");
140
+        StpUtil.login(user.getUserId(), "miniapp");
127 141
 
128 142
         Map<String, Object> res = new HashMap<>();
129
-        res.put("person", reflectd);
130 143
         res.put("user", user);
131 144
         res.put("token", StpUtil.getTokenValue());
132 145
 

+ 4
- 0
src/main/java/com/example/civilizedcity/entity/SysUser.java 파일 보기

@@ -62,4 +62,8 @@ public class SysUser implements Serializable,Cloneable{
62 62
      @ApiModelProperty(name = "资源列表", notes = "")
63 63
      @TableField(exist = false)
64 64
      List<SysResource> resourcesList;
65
+
66
+     @ApiModelProperty(name = "职责列表", notes = "")
67
+     @TableField(exist = false)
68
+     List<String> dutyList;
65 69
 }

+ 5
- 2
src/main/java/com/example/civilizedcity/mapper/SysOrgMapper.java 파일 보기

@@ -12,5 +12,8 @@ import com.example.civilizedcity.entity.SysOrg;
12 12
  */
13 13
 @Mapper
14 14
 public interface SysOrgMapper  extends BaseMapper<SysOrg>{
15
-    
16
-}
15
+
16
+     String sysOrgService(@Param("orgPId") String orgPId);
17
+
18
+     long changeOrgCode(@Param("from") String from, @Param("to") String to);
19
+ }

+ 6
- 3
src/main/java/com/example/civilizedcity/mapper/SysUserDutyMapper.java 파일 보기

@@ -5,12 +5,15 @@ import org.apache.ibatis.annotations.Mapper;
5 5
 import org.apache.ibatis.annotations.Param;
6 6
 import com.example.civilizedcity.entity.SysUserDuty;
7 7
 
8
- /**
8
+import java.util.List;
9
+
10
+/**
9 11
  * 用户身份;(sys_user_duty)表数据库访问层
10 12
  * @author : http://njyunzhi.com
11 13
  * @date : 2022-12-12
12 14
  */
13 15
 @Mapper
14 16
 public interface SysUserDutyMapper  extends BaseMapper<SysUserDuty>{
15
-    
16
-}
17
+
18
+     List<String> getListByUser(@Param("userId") String userId);
19
+ }

+ 5
- 2
src/main/java/com/example/civilizedcity/service/SysOrgService.java 파일 보기

@@ -9,5 +9,8 @@ import com.example.civilizedcity.entity.SysOrg;
9 9
  * @date : 2022-12-12
10 10
  */
11 11
 public interface SysOrgService extends IBaseService<SysOrg> {
12
-    
13
-}
12
+
13
+     long getMaxCodeOfParent(String orgPId);
14
+
15
+     boolean changeOrgCode(String from, String to);
16
+ }

+ 6
- 3
src/main/java/com/example/civilizedcity/service/SysUserDutyService.java 파일 보기

@@ -3,11 +3,14 @@ package com.example.civilizedcity.service;
3 3
 import com.baomidou.mybatisplus.extension.service.IService;
4 4
 import com.example.civilizedcity.entity.SysUserDuty;
5 5
 
6
- /**
6
+import java.util.List;
7
+
8
+/**
7 9
  * 用户身份;(sys_user_duty)表服务接口
8 10
  * @author : http://njyunzhi.com
9 11
  * @date : 2022-12-12
10 12
  */
11 13
 public interface SysUserDutyService extends IBaseService<SysUserDuty> {
12
-    
13
-}
14
+
15
+     List<String> getListByUser(String userId);
16
+ }

+ 27
- 2
src/main/java/com/example/civilizedcity/service/impl/SysOrgServiceImpl.java 파일 보기

@@ -1,16 +1,41 @@
1 1
 package com.example.civilizedcity.service.impl;
2 2
 
3
+import com.example.civilizedcity.common.StringUtils;
3 4
 import org.springframework.beans.factory.annotation.Autowired;
4 5
 import org.springframework.stereotype.Service;
5 6
 import com.example.civilizedcity.entity.SysOrg;
6 7
 import com.example.civilizedcity.mapper.SysOrgMapper;
7 8
 import com.example.civilizedcity.service.SysOrgService;
8
- /**
9
+
10
+/**
9 11
  * 单位表;(sys_org)表服务实现类
12
+ *
10 13
  * @author : http://www.chiner.pro
11 14
  * @date : 2022-12-12
12 15
  */
13 16
 @Service
14 17
 public class SysOrgServiceImpl extends BaseServiceImpl<SysOrgMapper, SysOrg> implements SysOrgService {
15
-    
18
+
19
+    final static String ROOT_ID = "-1";
20
+
21
+    @Override
22
+    public long getMaxCodeOfParent(String orgPId) {
23
+        String maxCode = baseMapper.sysOrgService(orgPId);
24
+        if (StringUtils.isEmpty(maxCode)) {
25
+            if (ROOT_ID.equals(orgPId)) {
26
+                return 100;
27
+            } else {
28
+                SysOrg org = getById(orgPId);
29
+                String childCode = org.getOrgCode() + "000";
30
+                return Long.parseLong(childCode);
31
+            }
32
+        }
33
+
34
+        return Long.parseLong(maxCode);
35
+    }
36
+
37
+    @Override
38
+    public boolean changeOrgCode(String from, String to) {
39
+        return baseMapper.changeOrgCode(from, to) > 0;
40
+    }
16 41
 }

+ 10
- 2
src/main/java/com/example/civilizedcity/service/impl/SysUserDutyServiceImpl.java 파일 보기

@@ -5,12 +5,20 @@ import org.springframework.stereotype.Service;
5 5
 import com.example.civilizedcity.entity.SysUserDuty;
6 6
 import com.example.civilizedcity.mapper.SysUserDutyMapper;
7 7
 import com.example.civilizedcity.service.SysUserDutyService;
8
- /**
8
+
9
+import java.util.List;
10
+
11
+/**
9 12
  * 用户身份;(sys_user_duty)表服务实现类
13
+ *
10 14
  * @author : http://www.chiner.pro
11 15
  * @date : 2022-12-12
12 16
  */
13 17
 @Service
14 18
 public class SysUserDutyServiceImpl extends BaseServiceImpl<SysUserDutyMapper, SysUserDuty> implements SysUserDutyService {
15
-    
19
+
20
+    @Override
21
+    public List<String> getListByUser(String userId) {
22
+        return baseMapper.getListByUser(userId);
23
+    }
16 24
 }

+ 4
- 0
src/main/java/com/example/civilizedcity/service/impl/TaCheckItemAnServiceImpl.java 파일 보기

@@ -32,6 +32,10 @@ public class TaCheckItemAnServiceImpl extends BaseServiceImpl<TaCheckItemAnMappe
32 32
             put("qu_id", quId);
33 33
         }});
34 34
 
35
+        if (null == answerList || answerList.isEmpty()) {
36
+            return true;
37
+        }
38
+
35 39
         for (int i = 0; i < answerList.size(); i ++) {
36 40
             TaCheckItemAn item = answerList.get(i);
37 41
             item.setQuId(quId);

+ 1
- 0
src/main/java/com/example/civilizedcity/service/impl/TaCheckItemQuServiceImpl.java 파일 보기

@@ -21,6 +21,7 @@ public class TaCheckItemQuServiceImpl extends BaseServiceImpl<TaCheckItemQuMappe
21 21
         QueryWrapper<TaCheckItemQu> queryWrapper = new QueryWrapper<>();
22 22
         queryWrapper.eq("item_id", itemId);
23 23
         queryWrapper.orderByDesc("sort_no");
24
+        queryWrapper.last("limit 1");
24 25
 
25 26
         TaCheckItemQu one = getOne(queryWrapper);
26 27
         return null == one ? 0 : one.getSortNo();

+ 1
- 0
src/main/resources/application.yml 파일 보기

@@ -27,6 +27,7 @@ yz:
27 27
       - "/v2/**"
28 28
       - "/static/**"
29 29
       - "/**/login"
30
+      - "/**/signin"
30 31
 
31 32
 wx:
32 33
   miniapp:

+ 19
- 1
src/main/resources/mapper/SysOrgMapper.xml 파일 보기

@@ -2,5 +2,23 @@
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 
4 4
 <mapper namespace="com.example.civilizedcity.mapper.SysOrgMapper">
5
-    
5
+    <update id="changeOrgCode">
6
+        UPDATE sys_org t
7
+        SET t.org_code = INSERT ( t.org_code, 1, LENGTH( #{from} ), #{to} )
8
+        WHERE
9
+            t.org_code LIKE CONCAT(#{from}, '%')
10
+    </update>
11
+
12
+    <select id="sysOrgService" resultType="java.lang.String">
13
+        SELECT
14
+            t.org_code
15
+        FROM
16
+            sys_org t
17
+        WHERE
18
+            t.org_p_id = #{orgPId}
19
+          AND t.`status` &gt; - 1
20
+        ORDER BY
21
+            t.org_code DESC
22
+            LIMIT 1
23
+    </select>
6 24
 </mapper>

+ 9
- 1
src/main/resources/mapper/SysUserDutyMapper.xml 파일 보기

@@ -2,5 +2,13 @@
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 
4 4
 <mapper namespace="com.example.civilizedcity.mapper.SysUserDutyMapper">
5
-    
5
+
6
+    <select id="getListByUser" resultType="java.lang.String">
7
+        SELECT
8
+            t.duty
9
+        FROM
10
+            sys_user_duty t
11
+        WHERE
12
+            t.user_id = #{userId}
13
+    </select>
6 14
 </mapper>