package com.javaweb.geo.service.impl;
|
|
import java.util.List;
|
import com.javaweb.common.utils.DateUtils;
|
import com.javaweb.geo.domain.HoleMedia;
|
import com.javaweb.geo.mapper.HoleMediaMapper;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
import com.javaweb.geo.mapper.HoleQutuMapper;
|
import com.javaweb.geo.domain.HoleQutu;
|
import com.javaweb.geo.service.IHoleQutuService;
|
import com.javaweb.common.core.text.Convert;
|
import org.springframework.util.ObjectUtils;
|
|
/**
|
* 记录- 取土Service业务层处理
|
*
|
* @author zmk
|
* @date 2022-10-20
|
*/
|
@Service
|
public class HoleQutuServiceImpl implements IHoleQutuService
|
{
|
@Autowired
|
private HoleQutuMapper holeQutuMapper;
|
|
@Autowired
|
private HoleMediaMapper holeMediaMapper;
|
|
/**
|
* 查询记录- 取土
|
*
|
* @param ids 记录- 取土ID
|
* @return 记录- 取土
|
*/
|
@Override
|
public HoleQutu selectHoleQutuById(String ids)
|
{
|
return holeQutuMapper.selectHoleQutuById(ids);
|
}
|
|
/**
|
* 查询记录- 取土列表
|
*
|
* @param holeQutu 记录- 取土
|
* @return 记录- 取土
|
*/
|
@Override
|
public List<HoleQutu> selectHoleQutuList(HoleQutu holeQutu)
|
{
|
return holeQutuMapper.selectHoleQutuList(holeQutu);
|
}
|
|
/**
|
* 新增记录- 取土
|
*
|
* @param holeQutu 记录- 取土
|
* @return 结果
|
*/
|
@Override
|
public int insertHoleQutu(HoleQutu holeQutu)
|
{
|
holeQutu.setCreateTime(DateUtils.getNowDate());
|
return holeQutuMapper.insertHoleQutu(holeQutu);
|
}
|
|
/**
|
* 修改记录- 取土
|
*
|
* @param holeQutu 记录- 取土
|
* @return 结果
|
*/
|
@Override
|
public int updateHoleQutu(HoleQutu holeQutu)
|
{
|
return holeQutuMapper.updateHoleQutu(holeQutu);
|
}
|
|
/**
|
* 删除记录- 取土对象
|
*
|
* @param ids 需要删除的数据ID
|
* @return 结果
|
*/
|
@Override
|
public int deleteHoleQutuByIds(String ids)
|
{
|
// 批量删除关联的媒体表
|
String[] strings = Convert.toStrArray(ids);
|
for (String id : strings) {
|
|
HoleMedia holeMedia = new HoleMedia();
|
holeMedia.setRecordId(id);
|
List<HoleMedia> list = holeMediaMapper.selectHoleMediaList(holeMedia);
|
|
if (!ObjectUtils.isEmpty(list)){
|
for (HoleMedia item : list) {
|
holeMediaMapper.deleteHoleMediaById(item.getIds());
|
}
|
}
|
}
|
|
return holeQutuMapper.deleteHoleQutuByIds(Convert.toStrArray(ids));
|
}
|
|
/**
|
* 删除记录- 取土信息
|
*
|
* @param ids 记录- 取土ID
|
* @return 结果
|
*/
|
@Override
|
public int deleteHoleQutuById(String ids)
|
{
|
return holeQutuMapper.deleteHoleQutuById(ids);
|
}
|
}
|