<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xhkjedu.suser.mapper.system.UserUsecretMapper">
    <!--获取密保问题使用频次-->
    <select id="getUseNumByUsId" resultType="java.lang.Integer">
        select count(uu.uusid) from t_user_usecret uu where uu.usid=#{usid}
    </select>
    <!--根据用户id删除关联密保-->
    <delete id="deleteByUserId">
        delete from t_user_usecret where userid=#{userid}
    </delete>
    <!--根据用户id获取关联密保-->
    <select id="listUsecret" resultType="java.util.Map">
        select uu.usid
        ,(select u.sname from t_usecret u where u.usid=uu.usid)sname
        from t_user_usecret uu where uu.userid=#{userid}
    </select>
    <!--获取用户密保答案-->
    <select id="getAnswerById" resultType="java.lang.String">
        select uu.usanswer from t_user_usecret uu where uu.userid=#{userid} and uu.usid=#{usid} limit 1
    </select>
</mapper>
