mybatis 返回值类型是Map

你离开我真会死。 提交于 2020-03-02 04:53:10
<select id="selectByMemberKey"  resultType="java.util.HashMap">
        SELECT member_id ,expire
        FROM member_key_make_up
        WHERE member_key = #{memberKey,jdbcType=VARCHAR}
    </select>
public interface MemberKeyMakeUpMapper {

    HashMap<String,Object> selectByMemberKey(@Param("memberKey")String memberKey);
}
private Long mackUpKeyGet(String memberKey) {
        HashMap<String, Object> map = memberKeyMakeUpMapper.selectByMemberKey(memberKey);
        if (map == null || map.get("MEMBER_ID") == null || map.get("EXPIRE").toString() == null) {
            return null;
        }
        Long memberId = Long.valueOf(map.get("MEMBER_ID").toString());
        Long expire = Long.valueOf(map.get("EXPIRE").toString());
        if (memberId == null || memberId == 0 || expire == null || expire == 0) {
            return null;
        }
        if (System.currentTimeMillis() < expire) {
            return -1L;
        }
        return memberId;
    }

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!