Search in sources :

Example 6 with TbMemberExample

use of cn.exrick.manager.pojo.TbMemberExample in project xmall by Exrick.

the class MemberServiceImpl method getMemberCount.

@Override
public DataTablesResult getMemberCount() {
    DataTablesResult result = new DataTablesResult();
    TbMemberExample example = new TbMemberExample();
    TbMemberExample.Criteria criteria = example.createCriteria();
    criteria.andStateNotEqualTo(2);
    try {
        result.setRecordsTotal((int) tbMemberMapper.countByExample(example));
    } catch (Exception e) {
        throw new XmallException("统计会员数失败");
    }
    return result;
}
Also used : TbMemberExample(cn.exrick.manager.pojo.TbMemberExample) DataTablesResult(cn.exrick.common.pojo.DataTablesResult) XmallException(cn.exrick.common.exception.XmallException) XmallException(cn.exrick.common.exception.XmallException)

Example 7 with TbMemberExample

use of cn.exrick.manager.pojo.TbMemberExample in project xmall by Exrick.

the class MemberServiceImpl method getMemberByEmail.

@Override
public TbMember getMemberByEmail(String email) {
    List<TbMember> list;
    TbMemberExample example = new TbMemberExample();
    TbMemberExample.Criteria criteria = example.createCriteria();
    criteria.andEmailEqualTo(email);
    try {
        list = tbMemberMapper.selectByExample(example);
    } catch (Exception e) {
        throw new XmallException("Email获取会员信息失败");
    }
    if (!list.isEmpty()) {
        list.get(0).setPassword("");
        return list.get(0);
    }
    return null;
}
Also used : TbMember(cn.exrick.manager.pojo.TbMember) TbMemberExample(cn.exrick.manager.pojo.TbMemberExample) XmallException(cn.exrick.common.exception.XmallException) XmallException(cn.exrick.common.exception.XmallException)

Aggregations

TbMemberExample (cn.exrick.manager.pojo.TbMemberExample)7 XmallException (cn.exrick.common.exception.XmallException)5 TbMember (cn.exrick.manager.pojo.TbMember)5 DataTablesResult (cn.exrick.common.pojo.DataTablesResult)2 Member (cn.exrick.manager.dto.front.Member)1 Gson (com.google.gson.Gson)1