package com.panzhihua.service_dangjian.service.impl;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.panzhihua.common.model.dtos.partybuilding.ComPbServiceTeamDTO;
|
import com.panzhihua.common.model.dtos.partybuilding.PageComPbServiceTeamDTO;
|
import com.panzhihua.common.model.vos.R;
|
import com.panzhihua.common.model.vos.community.ComActEasyPhotoCommentVO;
|
import com.panzhihua.common.model.vos.partybuilding.ComPbServiceTeamVO;
|
import com.panzhihua.service_dangjian.dao.ComPbServiceTeamDAO;
|
import com.panzhihua.service_dangjian.model.dos.ComPbServiceTeamDO;
|
import com.panzhihua.service_dangjian.service.ComPbServiceTeamService;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.beans.BeanUtils;
|
import org.springframework.stereotype.Service;
|
|
import javax.annotation.Resource;
|
|
/**
|
* @program: springcloud_k8s_panzhihuazhihuishequ
|
* @description: 服务团队
|
* @author: huang.hongfa weixin hhf9596 qq 959656820
|
* @create: 2021-01-21 17:39
|
**/
|
@Slf4j
|
@Service
|
public class ComPbServiceTeamServiceImpl implements ComPbServiceTeamService {
|
@Resource
|
private ComPbServiceTeamDAO comPbServiceTeamDAO;
|
/**
|
* 新增服务团队人员
|
*
|
* @param comPbServiceTeamDTO 新增内容
|
* @return 新增结果
|
*/
|
@Override
|
public R addServiceTeam(ComPbServiceTeamDTO comPbServiceTeamDTO) {
|
ComPbServiceTeamDO comPbServiceTeamDO=new ComPbServiceTeamDO();
|
BeanUtils.copyProperties(comPbServiceTeamDTO,comPbServiceTeamDO);
|
int insert = comPbServiceTeamDAO.insert(comPbServiceTeamDO);
|
if (insert>0) {
|
return R.ok();
|
}
|
return R.fail();
|
}
|
|
/**
|
* 编辑团队人员
|
*
|
* @param comPbServiceTeamDTO 编辑内容
|
* @return 编辑结果
|
*/
|
@Override
|
public R putServiceTeam(ComPbServiceTeamDTO comPbServiceTeamDTO) {
|
ComPbServiceTeamDO comPbServiceTeamDO=new ComPbServiceTeamDO();
|
BeanUtils.copyProperties(comPbServiceTeamDTO,comPbServiceTeamDO);
|
comPbServiceTeamDAO.updateById(comPbServiceTeamDO);
|
return R.ok();
|
}
|
|
/**
|
* 分页查询服务团队成员
|
*
|
* @param pageComPbServiceTeamDTO 查询参数
|
* @return 查询结果
|
*/
|
@Override
|
public R PageComPbServiceTeamDTO(PageComPbServiceTeamDTO pageComPbServiceTeamDTO) {
|
Page page = new Page<>();
|
Long pageNum = pageComPbServiceTeamDTO.getPageNum();
|
Long pageSize = pageComPbServiceTeamDTO.getPageSize();
|
if (null==pageNum||0==pageNum) {
|
pageNum = 1l;
|
}
|
if (null==pageSize||0==pageSize) {
|
pageSize = 10l;
|
}
|
page.setSize(pageSize);
|
page.setCurrent(pageNum);
|
IPage<ComPbServiceTeamVO> iPage = comPbServiceTeamDAO.PageComPbServiceTeamDTO(page, pageComPbServiceTeamDTO);
|
return R.ok(iPage);
|
}
|
|
/**
|
* 删除服务团队人员
|
*
|
* @param comPbServiceTeamDTO 删除主键
|
* @return 删除结果
|
*/
|
@Override
|
public R deleteServiceTeam(ComPbServiceTeamDTO comPbServiceTeamDTO) {
|
int delete = comPbServiceTeamDAO.deleteById(comPbServiceTeamDTO.getId());
|
if (delete>0) {
|
return R.ok();
|
}
|
return R.fail();
|
}
|
}
|