package cn.huge.module.bycase.service;
|
|
import cn.huge.base.common.exception.ServiceException;
|
import cn.huge.module.bycase.domain.po.CaseAgent;
|
import cn.huge.module.bycase.dao.mapper.CaseAgentMapper;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.PageImpl;
|
import org.springframework.data.domain.PageRequest;
|
import org.springframework.transaction.annotation.Transactional;
|
|
import java.util.List;
|
import java.util.Map;
|
|
/**
|
* @title: 纠纷代理人表业务逻辑处理
|
* @Description 纠纷代理人表业务逻辑处理
|
* @company hugeinfo
|
* @author liyj
|
* @Time 2024-10-21 08:46:40
|
* @version 1.0.0
|
*/
|
@Slf4j
|
@Service
|
@Transactional(rollbackFor = Exception.class)
|
public class CaseAgentService extends ServiceImpl<CaseAgentMapper, CaseAgent>{
|
|
@Autowired
|
private CaseAgentMapper mapper;
|
|
|
/**
|
* 更新对象
|
* @param entity 对象
|
*/
|
public void updateCaseAgent(CaseAgent entity){
|
try{
|
mapper.updateCaseAgent(entity);
|
}catch (Exception e){
|
log.error("[CaseAgentService.updateCaseAgent]调用失败,异常信息:"+e, e);
|
throw new ServiceException("CaseAgentService.updateCaseAgent", e);
|
}
|
}
|
|
/**
|
* 条件更新对象
|
* @param entity 对象
|
* @param terms 条件
|
*/
|
public void updateCaseAgentTerms(CaseAgent entity, Map<String, Object> terms){
|
try{
|
mapper.updateCaseAgentTerms(entity, terms);
|
}catch (Exception e){
|
log.error("[CaseAgentService.updateCaseAgentTerms]调用失败,异常信息:"+e, e);
|
throw new ServiceException("CaseAgentService.updateCaseAgentTerms", e);
|
}
|
}
|
|
/**
|
* 根据编号物理删除
|
* @param id 查询条件集合
|
*/
|
public void deleteCaseAgent(String id){
|
try{
|
mapper.deleteCaseAgent(id);
|
}catch (Exception e){
|
log.error("[CaseAgentService.deleteCaseAgent]调用失败,异常信息:"+e, e);
|
throw new ServiceException("CaseAgentService.deleteCaseAgent", e);
|
}
|
}
|
|
/**
|
* 按条件查询
|
* @param terms 条件
|
* @return List
|
*/
|
public List<CaseAgent> listTerms(Map<String, Object> terms){
|
return mapper.listTerms(terms);
|
}
|
|
/**
|
* 按条件统计
|
* @param terms 条件
|
* @return long
|
*/
|
public long countTerms(Map<String, Object> terms){
|
return mapper.countTerms(terms);
|
}
|
|
/**
|
* 按条件分页查询
|
* @param page 分页对象
|
* @param terms 条件
|
* @return Page
|
*/
|
public Page<CaseAgent> pageQuery(PageRequest page, Map<String, Object> terms){
|
long total = mapper.countTerms(terms);
|
List<CaseAgent> content = mapper.pageTerms(page, terms);
|
return new PageImpl<CaseAgent>(content, page, total);
|
}
|
|
}
|