master
parent
c14327b9bd
commit
32379dc6a8
@ -0,0 +1,68 @@ |
||||
package com.hfkj.service.user; |
||||
|
||||
import com.hfkj.entity.BsUserComplaint; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
public interface BsUserComplaintService { |
||||
|
||||
/** |
||||
* @MethodName create |
||||
* @Description: 创建 |
||||
* @param userComplaint |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/7/18 下午5:36 |
||||
*/ |
||||
void create(BsUserComplaint userComplaint); |
||||
|
||||
/** |
||||
* @MethodName update |
||||
* @Description: 更新 |
||||
* @param userComplaint |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/7/18 下午5:36 |
||||
*/ |
||||
void update(BsUserComplaint userComplaint); |
||||
|
||||
/** |
||||
* @MethodName delete |
||||
* @Description: 删除 |
||||
* @param id |
||||
* @param fullDelete |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/7/18 下午5:37 |
||||
*/ |
||||
void delete(Long id , Boolean fullDelete); |
||||
|
||||
/** |
||||
* @MethodName queryDetail |
||||
* @Description: 查询详情 |
||||
* @param id |
||||
* @return: com.hfkj.entity.BsUserComplaint |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/7/18 下午5:37 |
||||
*/ |
||||
BsUserComplaint queryDetail(Long id); |
||||
|
||||
/** |
||||
* @MethodName queryDetailByMap |
||||
* @Description: |
||||
* @param map |
||||
* @return: com.hfkj.entity.BsUserComplaint |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/7/18 下午5:37 |
||||
*/ |
||||
BsUserComplaint queryDetailByMap(Map<String , Object> map); |
||||
|
||||
/** |
||||
* @MethodName getList |
||||
* @Description: 查询列表 |
||||
* @param map |
||||
* @return: java.util.List<com.hfkj.entity.BsUserComplaint> |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/7/18 下午5:37 |
||||
*/ |
||||
List<BsUserComplaint> getList(Map<String , Object> map); |
||||
|
||||
} |
@ -0,0 +1,68 @@ |
||||
package com.hfkj.service.user.impl; |
||||
|
||||
import com.hfkj.dao.BsUserComplaintMapper; |
||||
import com.hfkj.entity.BsUserComplaint; |
||||
import com.hfkj.entity.BsUserComplaintExample; |
||||
import com.hfkj.service.user.BsUserComplaintService; |
||||
import org.apache.commons.collections4.MapUtils; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
@Service("bsUserComplaintService") |
||||
public class BsUserComplaintServiceImpl implements BsUserComplaintService { |
||||
|
||||
@Resource |
||||
private BsUserComplaintMapper bsUserComplaintMapper; |
||||
|
||||
@Override |
||||
public void create(BsUserComplaint userComplaint) { |
||||
bsUserComplaintMapper.insert(userComplaint); |
||||
} |
||||
|
||||
@Override |
||||
public void update(BsUserComplaint userComplaint) { |
||||
bsUserComplaintMapper.updateByPrimaryKeySelective(userComplaint); |
||||
} |
||||
|
||||
@Override |
||||
public void delete(Long id, Boolean fullDelete) { |
||||
if (fullDelete) { |
||||
bsUserComplaintMapper.deleteByPrimaryKey(id); |
||||
} else { |
||||
BsUserComplaint bsUserComplaint = queryDetail(id); |
||||
bsUserComplaint.setUpdateTime(new Date()); |
||||
update(bsUserComplaint); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public BsUserComplaint queryDetail(Long id) { |
||||
return bsUserComplaintMapper.selectByPrimaryKey(id); |
||||
} |
||||
|
||||
@Override |
||||
public BsUserComplaint queryDetailByMap(Map<String, Object> map) { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public List<BsUserComplaint> getList(Map<String, Object> map) { |
||||
BsUserComplaintExample bsUserComplaintExample = new BsUserComplaintExample(); |
||||
BsUserComplaintExample.Criteria criteria = bsUserComplaintExample.createCriteria(); |
||||
|
||||
if (StringUtils.isNotBlank(MapUtils.getString(map, "name"))) { |
||||
criteria.andNameLike("%"+MapUtils.getString(map, "name")+"%"); |
||||
} |
||||
|
||||
if (StringUtils.isNotBlank(MapUtils.getString(map, "phone"))) { |
||||
criteria.andPhoneLike("%"+MapUtils.getString(map, "phone")+"%"); |
||||
} |
||||
|
||||
return bsUserComplaintMapper.selectByExample(bsUserComplaintExample); |
||||
} |
||||
} |
Loading…
Reference in new issue