This commit is contained in:
Junling Bu
2020-02-15 15:06:55 +08:00
parent 5e0bd4c0af
commit 6d35c40efc
12 changed files with 68 additions and 26 deletions

View File

@@ -39,10 +39,8 @@ public class LitemallAddressService {
return addressMapper.updateByPrimaryKeySelective(address);
}
public void delete(Integer userId, Integer id) {
LitemallAddressExample example = new LitemallAddressExample();
example.or().andUserIdEqualTo(userId).andIdEqualTo(id).andDeletedEqualTo(false);
addressMapper.logicalDeleteByExample(example);
public void delete(Integer id) {
addressMapper.logicalDeleteByPrimaryKey(id);
}
public LitemallAddress findDefault(Integer userId) {

View File

@@ -23,6 +23,12 @@ public class LitemallAftersaleService {
return aftersaleMapper.selectByPrimaryKey(id);
}
public LitemallAftersale findById(Integer userId, Integer id) {
LitemallAftersaleExample example = new LitemallAftersaleExample();
example.or().andIdEqualTo(id).andUserIdEqualTo(userId).andDeletedEqualTo(false);
return aftersaleMapper.selectOneByExample(example);
}
public List<LitemallAftersale> queryList(Integer userId, Short status, Integer page, Integer limit, String sort, String order) {
LitemallAftersaleExample example = new LitemallAftersaleExample();
LitemallAftersaleExample.Criteria criteria = example.or();

View File

@@ -57,6 +57,12 @@ public class LitemallCartService {
return cartMapper.selectByPrimaryKey(id);
}
public LitemallCart findById(Integer userId, Integer id) {
LitemallCartExample example = new LitemallCartExample();
example.or().andUserIdEqualTo(userId).andIdEqualTo(id).andDeletedEqualTo(false);
return cartMapper.selectOneByExample(example);
}
public int updateCheck(Integer userId, List<Integer> idsList, Boolean checked) {
LitemallCartExample example = new LitemallCartExample();
example.or().andUserIdEqualTo(userId).andProductIdIn(idsList).andDeletedEqualTo(false);

View File

@@ -28,6 +28,12 @@ public class LitemallFootprintService {
return footprintMapper.selectByPrimaryKey(id);
}
public LitemallFootprint findById(Integer userId, Integer id) {
LitemallFootprintExample example = new LitemallFootprintExample();
example.or().andIdEqualTo(id).andUserIdEqualTo(userId).andDeletedEqualTo(false);
return footprintMapper.selectOneByExample(example);
}
public void deleteById(Integer id) {
footprintMapper.logicalDeleteByPrimaryKey(id);
}

View File

@@ -80,6 +80,19 @@ public class LitemallGrouponService {
return mapper.selectOneByExample(example);
}
/**
* 根据ID查询记录
*
* @param userId
* @param id
* @return
*/
public LitemallGroupon queryById(Integer userId, Integer id) {
LitemallGrouponExample example = new LitemallGrouponExample();
example.or().andIdEqualTo(id).andUserIdEqualTo(id).andDeletedEqualTo(false);
return mapper.selectOneByExample(example);
}
/**
* 返回某个发起的团购参与人数
*