Browse Source

Merge remote-tracking branch 'cloud-schoolapi/ywx'

tags/正式3.2.0
王宁 2 years ago
parent
commit
1f93a753ad

+ 96
- 0
suser/src/main/java/com/xhkjedu/suser/controller/system/UsecretController.java View File

@@ -0,0 +1,96 @@
1
+package com.xhkjedu.suser.controller.system;
2
+
3
+import com.github.pagehelper.PageHelper;
4
+import com.github.pagehelper.PageInfo;
5
+import com.xhkjedu.suser.model.system.TUsecret;
6
+import com.xhkjedu.suser.service.system.UsecretService;
7
+import com.xhkjedu.utils.N_Utils;
8
+import com.xhkjedu.utils.PageUtil;
9
+import com.xhkjedu.vo.PageResult;
10
+import com.xhkjedu.vo.ResultVo;
11
+import org.springframework.web.bind.annotation.PostMapping;
12
+import org.springframework.web.bind.annotation.RequestBody;
13
+import org.springframework.web.bind.annotation.RequestMapping;
14
+import org.springframework.web.bind.annotation.RestController;
15
+
16
+import javax.annotation.Resource;
17
+import java.util.List;
18
+import java.util.Map;
19
+
20
+@RestController
21
+@RequestMapping("usecret")
22
+public class UsecretController {
23
+    @Resource
24
+    private UsecretService usecretService;
25
+
26
+    /**
27
+      * 添加
28
+      * @param [usecret]
29
+      * @author ywx
30
+      * @date 2022/3/30 11:33
31
+      * @return com.xhkjedu.vo.ResultVo
32
+      */
33
+    @PostMapping("/add")
34
+    public ResultVo add(@RequestBody TUsecret usecret) {
35
+        usecretService.save(usecret);
36
+        return new ResultVo(0,"保存成功");
37
+    }
38
+
39
+    /**
40
+      * 修改
41
+      * @param [usecret]
42
+      * @author ywx
43
+      * @date 2022/3/30 11:33
44
+      * @return com.xhkjedu.vo.ResultVo
45
+      */
46
+    @PostMapping("/update")
47
+    public ResultVo update(@RequestBody TUsecret usecret) {
48
+        N_Utils.validation(new Object[]{usecret.getUsid(), "密保问题id", 1});
49
+        return usecretService.update(usecret);
50
+    }
51
+
52
+    /**
53
+      * 删除
54
+      * @param [usecret]
55
+      * @author ywx
56
+      * @date 2022/3/30 11:33
57
+      * @return com.xhkjedu.vo.ResultVo
58
+      */
59
+    @PostMapping("/delete")
60
+    public ResultVo delete(@RequestBody TUsecret usecret) {
61
+        Integer usid = usecret.getUsid();
62
+        N_Utils.validation(new Object[]{usid, "密保问题id"});
63
+        return usecretService.deleteById(usid);
64
+    }
65
+
66
+    /**
67
+      * 列表
68
+      * @param [usecret]
69
+      * @author ywx
70
+      * @date 2022/3/30 11:34
71
+      * @return com.xhkjedu.vo.ResultVo
72
+      */
73
+    @PostMapping("/list")
74
+    public ResultVo list(@RequestBody TUsecret usecret) {
75
+        N_Utils.validation(new Object[]{usecret.getPage(), "显示页码", 1, usecret.getPageSize(), "显示条数", 1, usecret.getSchoolid(), "学校id", 1});
76
+        PageHelper.startPage(usecret.getPage(),usecret.getPageSize());
77
+        List<Map> list = usecretService.findAll(usecret);
78
+        PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
79
+        return new ResultVo(0,"获取列表成功",pageResult);
80
+    }
81
+
82
+    /**
83
+     * 选择表
84
+     * @param [usecret]
85
+     * @author ywx
86
+     * @date 2022/3/30 13:17
87
+     * @return com.xhkjedu.vo.ResultVo
88
+     */
89
+    @PostMapping("/list_sel")
90
+    public ResultVo listForSel(@RequestBody TUsecret usecret) {
91
+        Integer schoolid = usecret.getSchoolid();
92
+        N_Utils.validation(new Object[]{schoolid, "学校id", 1});
93
+        List<Map> list = usecretService.listForSel(schoolid);
94
+        return new ResultVo(0,"获取列表成功",list);
95
+    }
96
+}

+ 96
- 0
suser/src/main/java/com/xhkjedu/suser/controller/system/UserController.java View File

@@ -2,6 +2,7 @@ package com.xhkjedu.suser.controller.system;
2 2
 
3 3
 import com.alibaba.fastjson.JSON;
4 4
 import com.xhkjedu.suser.model.system.TUser;
5
+import com.xhkjedu.suser.model.system.TUserUsecret;
5 6
 import com.xhkjedu.suser.service.system.UserService;
6 7
 import com.xhkjedu.suser.utils.UserUtil;
7 8
 import com.xhkjedu.suser.vo.assess.AssessParams;
@@ -404,4 +405,99 @@ public class UserController {
404 405
         Integer headtime = userService.getHeadTime(userid);
405 406
         return new ResultVo(0, "获取头像是否可以修改成功", headtime);
406 407
     }
408
+
409
+    /**
410
+     * 绑定密保
411
+     *
412
+     * @param [usecrets]
413
+     * @return com.xhkjedu.vo.ResultVo
414
+     * @author ywx
415
+     * @date 2022/3/30 12:47
416
+     */
417
+    @PostMapping("/bind_usecert")
418
+    public ResultVo bindUseCert(@RequestBody List<TUserUsecret> usecrets) {
419
+        if (N_Utils.isListEmpty(usecrets)) {
420
+            return new ResultVo(1, "密保问题不能为空");
421
+        }
422
+        userService.bindUseCert(usecrets);
423
+        return new ResultVo(0, "绑定密保成功");
424
+    }
425
+
426
+    /**
427
+     * 绑定手机
428
+     *
429
+     * @param [user]
430
+     * @return com.xhkjedu.vo.ResultVo
431
+     * @author ywx
432
+     * @date 2022/3/30 13:05
433
+     */
434
+    @PostMapping("/bind_userphone")
435
+    public ResultVo bindUserPhone(@RequestBody TUser user) {
436
+        Integer userid = user.getUserid();
437
+        String userphone = user.getUserphone();
438
+        Integer msgcode = user.getMsgcode();
439
+        N_Utils.validation(new Object[]{userid, "用户id", 1, userphone, "手机号", 2, msgcode, "短信验证码", 2});
440
+        return userService.bindUserPhone(userid, userphone, msgcode);
441
+    }
442
+
443
+    /**
444
+      * 验证身份
445
+      * @param [user]
446
+      * @author ywx
447
+      * @date 2022/3/30 14:00
448
+      * @return com.xhkjedu.vo.ResultVo
449
+      */
450
+    @PostMapping("/check_user")
451
+    public ResultVo checkUser(@RequestBody TUser user) {
452
+        String loginname = user.getLoginname();
453
+        String username = user.getUsername();
454
+        N_Utils.validation(new Object[]{loginname, "账号", 2, username, "姓名", 2});
455
+        return userService.checkUser(loginname, username);
456
+    }
457
+
458
+    /**
459
+      * 根据用户id获取关联密保
460
+      * @param [user]
461
+      * @author ywx
462
+      * @date 2022/3/30 14:24
463
+      * @return com.xhkjedu.vo.ResultVo
464
+      */
465
+    @PostMapping("/list_usecret")
466
+    public ResultVo listUsecret(@RequestBody TUser user) {
467
+        Integer userid = user.getUserid();
468
+        N_Utils.validation(new Object[]{userid, "用户id", 1});
469
+        List<Map> list = userService.listUsecret(userid);
470
+        return new ResultVo(0, "获取关联密保列表成功", list);
471
+    }
472
+
473
+    /**
474
+     * 根据用户id获取绑定方式
475
+     *
476
+     * @param [user]
477
+     * @return com.xhkjedu.vo.ResultVo
478
+     * @author ywx
479
+     * @date 2022/3/30 14:58
480
+     */
481
+    @PostMapping("/get_bind")
482
+    public ResultVo getBind(@RequestBody TUser user) {
483
+        Integer userid = user.getUserid();
484
+        N_Utils.validation(new Object[]{userid, "用户id", 1});
485
+        Map map = userService.getBind(userid);
486
+        return new ResultVo(0, "根据用户id获取绑定方式成功", map);
487
+    }
488
+
489
+    /**
490
+     * 生成绑定手机码
491
+     *
492
+     * @param [user]
493
+     * @return com.xhkjedu.vo.ResultVo
494
+     * @author ywx
495
+     * @date 2022/3/30 16:34
496
+     */
497
+    @PostMapping("/bind_code")
498
+    public ResultVo bindCode(@RequestBody TUser user) {
499
+        String userphone = user.getUserphone();
500
+        N_Utils.validation(new Object[]{userphone, "手机号", 2});
501
+        return userService.bindCode(userphone);
502
+    }
407 503
 }

+ 18
- 0
suser/src/main/java/com/xhkjedu/suser/mapper/system/UsecretMapper.java View File

@@ -0,0 +1,18 @@
1
+package com.xhkjedu.suser.mapper.system;
2
+
3
+import com.xhkjedu.suser.base.TkMapper;
4
+import com.xhkjedu.suser.model.system.TUsecret;
5
+import org.apache.ibatis.annotations.Param;
6
+import org.springframework.stereotype.Repository;
7
+
8
+import java.util.List;
9
+import java.util.Map;
10
+
11
+@Repository
12
+public interface UsecretMapper extends TkMapper<TUsecret> {
13
+    //获取密保问题列表
14
+    List<Map> findAll(@Param("usecret") TUsecret usecret);
15
+
16
+    //获取密保问题选择列表
17
+    List<Map> listForSel(Integer schoolid);
18
+}

+ 12
- 0
suser/src/main/java/com/xhkjedu/suser/mapper/system/UserMapper.java View File

@@ -193,4 +193,16 @@ public interface UserMapper extends TkMapper<TUser> {
193 193
 
194 194
     //获取修改头像时间
195 195
     Integer getHeadTime(Integer userid);
196
+
197
+    //绑定密保
198
+    void bindUseCert(Integer userid);
199
+
200
+    //绑定手机
201
+    void bindUserPhone(Integer userid, String userphone);
202
+
203
+    //根据账号获取绑定方式
204
+    Map getBindByName(String loginname);
205
+
206
+    //根据用户id获取绑定方式
207
+    Map getBindById(Integer userid);
196 208
 }

+ 20
- 0
suser/src/main/java/com/xhkjedu/suser/mapper/system/UserUsecretMapper.java View File

@@ -0,0 +1,20 @@
1
+package com.xhkjedu.suser.mapper.system;
2
+
3
+import com.xhkjedu.suser.base.TkMapper;
4
+import com.xhkjedu.suser.model.system.TUserUsecret;
5
+import org.springframework.stereotype.Repository;
6
+
7
+import java.util.List;
8
+import java.util.Map;
9
+
10
+@Repository
11
+public interface UserUsecretMapper extends TkMapper<TUserUsecret> {
12
+    //获取密保问题使用频次
13
+    Integer getUseNumByUsId(Integer usid);
14
+
15
+    //根据用户id删除关联密保
16
+    void deleteByUserId(Integer userid);
17
+
18
+    //根据用户id获取关联密保
19
+    List<Map> listUsecret(Integer userid);
20
+}

+ 30
- 0
suser/src/main/java/com/xhkjedu/suser/model/system/TUsecret.java View File

@@ -0,0 +1,30 @@
1
+package com.xhkjedu.suser.model.system;
2
+
3
+import com.xhkjedu.suser.model.BaseBean;
4
+import lombok.Data;
5
+
6
+import javax.persistence.Id;
7
+import javax.persistence.Table;
8
+
9
+@Table(name = "t_usecret")
10
+@Data
11
+public class TUsecret extends BaseBean {
12
+    //登录帐号密保问题
13
+    @Id
14
+    private Integer usid;
15
+
16
+    //密保名称
17
+    private String sname;
18
+
19
+    //密保问题排序
20
+    private Integer sorder;
21
+
22
+    //创建人id
23
+    private Integer createid;
24
+
25
+    //创建时间
26
+    private Integer createtime;
27
+
28
+    //学校id
29
+    private Integer schoolid;
30
+}

+ 6
- 0
suser/src/main/java/com/xhkjedu/suser/model/system/TUser.java View File

@@ -67,6 +67,12 @@ public class TUser extends BaseBean {
67 67
     //有效期
68 68
     private String usertime;
69 69
 
70
+    //是否绑定手机号0未绑定1已绑定
71
+    private Integer bindphoned;
72
+
73
+    //是否绑定密保0未绑定1已绑定
74
+    private Integer bindsecret;
75
+
70 76
     //创建人id
71 77
     private Integer createid;
72 78
 

+ 27
- 0
suser/src/main/java/com/xhkjedu/suser/model/system/TUserUsecret.java View File

@@ -0,0 +1,27 @@
1
+package com.xhkjedu.suser.model.system;
2
+
3
+import com.xhkjedu.suser.model.BaseBean;
4
+import lombok.Data;
5
+
6
+import javax.persistence.Id;
7
+import javax.persistence.Table;
8
+
9
+@Table(name = "t_user_usecret")
10
+@Data
11
+public class TUserUsecret extends BaseBean {
12
+    //用户密保关联关系表
13
+    @Id
14
+    private Integer uusid;
15
+
16
+    //用户id
17
+    private Integer userid;
18
+
19
+    //密保id
20
+    private Integer usid;
21
+
22
+    //密保答案
23
+    private String usanswer;
24
+
25
+    //创建时间
26
+    private Integer createtime;
27
+}

+ 84
- 0
suser/src/main/java/com/xhkjedu/suser/service/system/UsecretService.java View File

@@ -0,0 +1,84 @@
1
+package com.xhkjedu.suser.service.system;
2
+
3
+import com.xhkjedu.suser.mapper.system.UsecretMapper;
4
+import com.xhkjedu.suser.mapper.system.UserUsecretMapper;
5
+import com.xhkjedu.suser.model.system.TUsecret;
6
+import com.xhkjedu.utils.N_Utils;
7
+import com.xhkjedu.vo.ResultVo;
8
+import org.springframework.stereotype.Service;
9
+
10
+import javax.annotation.Resource;
11
+import java.util.List;
12
+import java.util.Map;
13
+
14
+@Service
15
+public class UsecretService {
16
+    @Resource
17
+    private UsecretMapper usecretMapper;
18
+    @Resource
19
+    private UserUsecretMapper userUsecretMapper;
20
+
21
+    /**
22
+      * 添加
23
+      * @param [usecret]
24
+      * @author ywx
25
+      * @date 2022/3/30 11:41
26
+      * @return void
27
+      */
28
+    public void save(TUsecret usecret) {
29
+        usecret.setCreatetime(N_Utils.getSecondTimestamp());
30
+        usecretMapper.insertSelective(usecret);
31
+    }
32
+
33
+    /**
34
+      * 修改
35
+      * @param [usecret]
36
+      * @author ywx
37
+      * @date 2022/3/30 11:41
38
+      * @return com.xhkjedu.vo.ResultVo
39
+      */
40
+    public ResultVo update(TUsecret usecret) {
41
+        Integer usid = usecret.getUsid();
42
+        Integer usenum = userUsecretMapper.getUseNumByUsId(usid);//获取密保问题使用频次
43
+        if (usenum != 0) return new ResultVo(1,"该密保问题被使用禁止修改");
44
+        usecret.setCreatetime(N_Utils.getSecondTimestamp());
45
+        usecretMapper.updateByPrimaryKeySelective(usecret);
46
+        return new ResultVo(0,"修改成功");
47
+    }
48
+
49
+    /**
50
+      * 删除
51
+      * @param [usid]
52
+      * @author ywx
53
+      * @date 2022/3/30 11:41
54
+      * @return com.xhkjedu.vo.ResultVo
55
+      */
56
+    public ResultVo deleteById(Integer usid) {
57
+        Integer usenum = userUsecretMapper.getUseNumByUsId(usid);//获取密保问题使用频次
58
+        if (usenum != 0) return new ResultVo(1,"该密保问题被使用禁止删除");
59
+        usecretMapper.deleteByPrimaryKey(usid);
60
+        return new ResultVo(0,"删除成功");
61
+    }
62
+
63
+    /**
64
+      * 列表
65
+      * @param [usecret]
66
+      * @author ywx
67
+      * @date 2022/3/30 11:41
68
+      * @return java.util.List<java.util.Map>
69
+      */
70
+    public List<Map> findAll(TUsecret usecret) {
71
+        return usecretMapper.findAll(usecret);
72
+    }
73
+
74
+    /**
75
+      * 选择列表
76
+      * @param [schoolid]
77
+      * @author ywx
78
+      * @date 2022/3/30 13:17
79
+      * @return java.util.List<java.util.Map>
80
+      */
81
+    public List<Map> listForSel(Integer schoolid) {
82
+        return usecretMapper.listForSel(schoolid);
83
+    }
84
+}

+ 95
- 0
suser/src/main/java/com/xhkjedu/suser/service/system/UserService.java View File

@@ -9,10 +9,12 @@ import com.xhkjedu.suser.mapper.gradeclass.SchoolMapper;
9 9
 import com.xhkjedu.suser.mapper.system.MsgMapper;
10 10
 import com.xhkjedu.suser.mapper.system.UserLogMapper;
11 11
 import com.xhkjedu.suser.mapper.system.UserMapper;
12
+import com.xhkjedu.suser.mapper.system.UserUsecretMapper;
12 13
 import com.xhkjedu.suser.model.gradeclass.TClassTeacher;
13 14
 import com.xhkjedu.suser.model.system.TMsg;
14 15
 import com.xhkjedu.suser.model.system.TUser;
15 16
 import com.xhkjedu.suser.model.system.TUserLog;
17
+import com.xhkjedu.suser.model.system.TUserUsecret;
16 18
 import com.xhkjedu.suser.utils.JedisUtil;
17 19
 import com.xhkjedu.suser.utils.PoiUtils;
18 20
 import com.xhkjedu.suser.utils.SMSSender;
@@ -57,6 +59,8 @@ public class UserService extends JedisUtil {
57 59
     private ClassMapper classMapper;
58 60
     @Autowired
59 61
     private ClassTeacherMapper classTeacherMapper;
62
+    @Resource
63
+    private UserUsecretMapper userUsecretMapper;
60 64
 
61 65
     /**
62 66
      * 功能描述  根据登录名和密码获取用户信息
@@ -649,6 +653,8 @@ public class UserService extends JedisUtil {
649 653
             msgtxt += "验证码" + messageCode + ",您正在尝试修改登录密码,请妥善保管账户信息。";
650 654
         } else if ("dlqr".equals(templateCode)) {//登录确认验证码
651 655
             msgtxt += "验证码" + messageCode + ",您正在登录,若非本人操作,请勿泄露。";
656
+        } else if ("bdsj".equals(templateCode)) {//绑定手机验证码
657
+            msgtxt += "验证码" + messageCode + ",您正在绑定手机号,若非本人操作,请勿泄露。";
652 658
         }
653 659
         ZtMsgVo m = new ZtMsgVo();
654 660
         m.setMobile(userphone);
@@ -832,4 +838,93 @@ public class UserService extends JedisUtil {
832 838
     public Integer getHeadTime(Integer userid) {
833 839
         return userMapper.getHeadTime(userid);
834 840
     }
841
+
842
+    /**
843
+     * 绑定密保
844
+     *
845
+     * @param [usecrets]
846
+     * @return void
847
+     * @author ywx
848
+     * @date 2022/3/30 12:47
849
+     */
850
+    @Transactional(rollbackFor = Exception.class)
851
+    public void bindUseCert(List<TUserUsecret> usecrets) {
852
+        Integer userid = usecrets.get(0).getUserid();
853
+        //先删除原来的密保问题
854
+        userUsecretMapper.deleteByUserId(userid);
855
+        usecrets.forEach(uu -> uu.setCreatetime(N_Utils.getSecondTimestamp()));
856
+        userUsecretMapper.insertList(usecrets);
857
+        userMapper.bindUseCert(userid);
858
+    }
859
+
860
+    /**
861
+     * 绑定手机
862
+     *
863
+     * @param [userid, userphone, msgcode]
864
+     * @return com.xhkjedu.vo.ResultVo
865
+     * @author ywx
866
+     * @date 2022/3/30 13:05
867
+     */
868
+    public ResultVo bindUserPhone(Integer userid, String userphone, Integer msgcode) {
869
+        ResultVo resultVo = getCodeResultVo(userphone, msgcode);
870
+        if (resultVo != null) return resultVo;
871
+        userMapper.bindUserPhone(userid, userphone);
872
+        return new ResultVo(0, "绑定手机成功");
873
+    }
874
+
875
+    /**
876
+      * 验证身份
877
+      * @param [loginname, username]
878
+      * @author ywx
879
+      * @date 2022/3/30 13:59
880
+      * @return com.xhkjedu.vo.ResultVo
881
+      */
882
+    public ResultVo checkUser(String loginname, String username) {
883
+        Map map = userMapper.getBindByName(loginname);
884
+        if (N_Utils.isEmpty(map)) {
885
+            return new ResultVo(1, "该账号不存在");
886
+        }
887
+        String username1 = map.get("username").toString();
888
+        if (!username.equals(username1)) {
889
+            return new ResultVo(1, "该账号和姓名不匹配");
890
+        }
891
+        return new ResultVo(0, "验证身份成功",map);
892
+    }
893
+
894
+    /**
895
+      * 根据用户id获取关联密保
896
+      * @param [userid]
897
+      * @author ywx
898
+      * @date 2022/3/30 14:24
899
+      * @return java.util.List<java.util.Map>
900
+      */
901
+    public List<Map> listUsecret(Integer userid) {
902
+        return userUsecretMapper.listUsecret(userid);
903
+    }
904
+
905
+    /**
906
+     * 根据用户id获取绑定方式
907
+     *
908
+     * @param [userid]
909
+     * @return java.util.Map
910
+     * @author ywx
911
+     * @date 2022/3/30 14:57
912
+     */
913
+    public Map getBind(Integer userid) {
914
+        return userMapper.getBindById(userid);
915
+    }
916
+
917
+    /**
918
+     * 生成绑定手机码
919
+     *
920
+     * @param [userphone]
921
+     * @return com.xhkjedu.vo.ResultVo
922
+     * @author ywx
923
+     * @date 2022/3/30 16:34
924
+     */
925
+    public ResultVo bindCode(String userphone) {
926
+        String templateCode = "bdsj";
927
+        if (generateCode(userphone, templateCode)) return new ResultVo(1, "请输入验证码或者在5分钟之后重新点击");
928
+        return new ResultVo(0, "生成绑定手机码成功");
929
+    }
835 930
 }

+ 16
- 0
suser/src/main/resources/mapper/system/UsecertMapper.xml View File

@@ -0,0 +1,16 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.xhkjedu.suser.mapper.system.UsecretMapper">
4
+    <!--获取密保问题列表-->
5
+    <select id="findAll" resultType="java.util.Map">
6
+        select u.usid,u.sname,u.sorder,u.createtime,u2.username createname
7
+        ,(select count(uu.uusid) from t_user_usecret uu where uu.usid=u.usid)usenum
8
+        from t_usecret u left join t_user u2 on u2.userid=u.createid
9
+        where u.schoolid=#{usecret.schoolid}
10
+        order by u.createtime desc
11
+    </select>
12
+    <!--获取密保问题选择列表-->
13
+    <select id="listForSel" resultType="java.util.Map">
14
+        select u.usid,u.sname from t_usecret u where u.schoolid=#{schoolid} order by u.sorder
15
+    </select>
16
+</mapper>

+ 18
- 0
suser/src/main/resources/mapper/system/UserMapper.xml View File

@@ -167,6 +167,24 @@
167 167
         select (case when headtime is null then 1 when headtime+6*30*24*60*60 &lt; unix_timestamp() then 1 else 0 end)
168 168
         from t_user where userid=#{userid}
169 169
     </select>
170
+    <!--绑定密保-->
171
+    <update id="bindUseCert">
172
+        update t_user set bindsecret=1 where userid=#{userid}
173
+    </update>
174
+    <!--绑定手机-->
175
+    <update id="bindUserPhone">
176
+        update t_user set bindphoned=1,userphone=#{userphone} where userid=#{userid}
177
+    </update>
178
+    <!--根据账号获取绑定方式-->
179
+    <select id="getBindByName" resultType="java.util.Map">
180
+        select userid,username,userphone,bindphoned,bindsecret
181
+        from t_user where loginname=#{loginname} limit 1
182
+    </select>
183
+    <!--根据用户id获取绑定方式-->
184
+    <select id="getBindById" resultType="java.util.Map">
185
+        select userphone,bindphoned,bindsecret
186
+        from t_user where userid=#{userid} limit 1
187
+    </select>
170 188
 
171 189
 
172 190
 </mapper>

+ 18
- 0
suser/src/main/resources/mapper/system/UserUsecertMapper.xml View File

@@ -0,0 +1,18 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.xhkjedu.suser.mapper.system.UserUsecretMapper">
4
+    <!--获取密保问题使用频次-->
5
+    <select id="getUseNumByUsId" resultType="java.lang.Integer">
6
+        select count(uu.uusid) from t_user_usecret uu where uu.usid=#{usid}
7
+    </select>
8
+    <!--根据用户id删除关联密保-->
9
+    <delete id="deleteByUserId">
10
+        delete from t_user_usecret where userid=#{userid}
11
+    </delete>
12
+    <!--根据用户id获取关联密保-->
13
+    <select id="listUsecret" resultType="java.util.Map">
14
+        select uu.usid,uu.usanswer
15
+        ,(select u.sname from t_usecret u where u.usid=uu.usid)sname
16
+        from t_user_usecret uu where uu.userid=#{userid}
17
+    </select>
18
+</mapper>

Loading…
Cancel
Save