| | |
| | | } |
| | | |
| | | @Override |
| | | public LuckySponsors getSponsorByAccount(String account) { |
| | | LuckySponsorQuery query = new LuckySponsorQuery(); |
| | | query.account = account; |
| | | query.count = 1; |
| | | |
| | | List<LuckySponsors> list = luckySponsorsMapper.list(query); |
| | | if (list == null || list.size() == 0) { |
| | | return null; |
| | | } |
| | | return list.get(0); |
| | | } |
| | | |
| | | @Override |
| | | public long countSponsor(String key, Integer state) { |
| | | LuckySponsorQuery query = new LuckySponsorQuery(); |
| | | query.key = key; |
| | |
| | | |
| | | @Validated |
| | | @Override |
| | | public Long addSponsor(LuckySponsors sponsor) throws ParamsException,LuckySponsorException { |
| | | public Long addSponsor(LuckySponsors sponsor) throws ParamsException, LuckySponsorException { |
| | | LuckySponsorQuery query = new LuckySponsorQuery(); |
| | | query.account = sponsor.getAccount(); |
| | | query.start=0; |
| | | query.count=1; |
| | | query.start = 0; |
| | | query.count = 1; |
| | | List<LuckySponsors> list = luckySponsorsMapper.list(query); |
| | | if (list != null && list.size() > 0) { |
| | | throw new LuckySponsorException(LuckySponsorException.CODE_EXIST, "账号已经存在"); |