|
|
|
@@ -0,0 +1,53 @@ |
|
|
|
package com.iformall.service.impl; |
|
|
|
|
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import com.iformall.domain.po.WxCouponPassword; |
|
|
|
import com.iformall.mapper.WxCouponPasswordMapper; |
|
|
|
import com.iformall.service.WxCouponPasswordService; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import com.iformall.common.IdWorker; |
|
|
|
|
|
|
|
@Service |
|
|
|
public class WxCouponPasswordServiceImpl implements WxCouponPasswordService { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxCouponPasswordMapper wxCouponPasswordMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public PageInfo<WxCouponPassword> listAsPage(WxCouponPassword record, Integer pageIndex, Integer pageSize) { |
|
|
|
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponPasswordMapper.findList(record)); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public WxCouponPassword getById(Long id) { |
|
|
|
return wxCouponPasswordMapper.selectByPrimaryKey(id); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void saveOrUpdate(WxCouponPassword record) { |
|
|
|
if (record.getId() == null) { |
|
|
|
//record.setId(UUID.randomUUID().toString().replaceAll("-", "")); |
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
record.setId(idWorker.nextId()); |
|
|
|
wxCouponPasswordMapper.insertSelective(record); |
|
|
|
} else { |
|
|
|
wxCouponPasswordMapper.updateByPrimaryKeySelective(record); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void deleteById(Long id) { |
|
|
|
wxCouponPasswordMapper.deleteByPrimaryKey(id); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |