ServiceTransactionalpublic class OverseasinputService implements IOverseasinputService Resource private OverseasinputMapper overseasinputMapper; Override public ListOverseasinput findOver
@Service @Transactional public class OverseasinputService implements IOverseasinputService {
@Resource
private OverseasinputMapper overseasinputMapper;
// 通过条件查询海外输入数据
@Override
public List<Overseasinput> findOverseasinputByConditions(Overseasinput overseasinputParam) {
return overseasinputMapper.selectOverseasinputByConditions(overseasinputParam);
}
// 查询不同的省份名称
@Override
public List<String> findDistinctProvinceName() {
return overseasinputMapper.selectDistinctProvinceName();
}
// 添加海外输入数据
@Override
public boolean addOverseasinput(Overseasinput overseasinputParam) {
overseasinputParam.setPid(Integer.parseInt(overseasinputParam.getProvinceName()
.split(",")[0]));
overseasinputParam.setProvinceShortName(overseasinputParam.getProvinceName()
.split(",")[1]);
if (overseasinputMapper.selectByPidAndDatetime(overseasinputParam.getPid()
,overseasinputParam.getDatetime())==null){
overseasinputMapper.insertOverseasinput(overseasinputParam);
return true;
}
return false;
}
// 更新海外输入数据
@Override
public void updateOverseasinput(Overseasinput overseasinputParam) {
if (overseasinputMapper.selectByPidAndDatetime(overseasinputParam.getPid()
,overseasinputParam.getDatetime())!=null){
overseasinputMapper.updateOverseasinput(overseasinputParam);
}
}
// 通过省份ID和日期时间查询海外输入数据
@Override
public Overseasinput findByPidAndDatetime(Integer pid, String datetime) {
return overseasinputMapper.selectByPidAndDatetime(pid,datetime);
}
原文地址: https://www.cveoy.top/t/topic/hlmD 著作权归作者所有。请勿转载和采集!