qa-prevention-gwj/src/main/java/com/zcloud/service/bus/impl/ImgFilesServiceImpl.java

157 lines
3.4 KiB
Java
Raw Normal View History

2023-11-07 09:32:12 +08:00
package com.zcloud.service.bus.impl;
import java.util.ArrayList;
import java.util.List;
import com.zcloud.util.Tools;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.bus.ImgFilesMapper;
import com.zcloud.service.bus.ImgFilesService;
/**
*
* luoxiaobao
* 2020-12-24
* www.zcloudchina.com
*/
@Service
@Transactional //开启事物
public class ImgFilesServiceImpl implements ImgFilesService{
@Autowired
private ImgFilesMapper imgfilesMapper;
/**
* @param pd
* @throws Exception
*/
public void save(PageData pd)throws Exception{
imgfilesMapper.save(pd);
}
/**
* @param pd
* @throws Exception
*/
public void delete(PageData pd)throws Exception{
imgfilesMapper.delete(pd);
}
/**
* @param pd
* @throws Exception
*/
public void deleteList(PageData pd)throws Exception{
imgfilesMapper.deleteList(pd);
}
/**
* @param pd
* @throws Exception
*/
public void edit(PageData pd)throws Exception{
imgfilesMapper.edit(pd);
}
/**
* @param page
* @throws Exception
*/
public List<PageData> list(Page page)throws Exception{
return imgfilesMapper.datalistPage(page);
}
/**()
* @param pd
* @throws Exception
*/
public List<PageData> listAll(PageData pd)throws Exception{
return imgfilesMapper.listAll(pd);
}
/**id
* @param pd
* @throws Exception
*/
public PageData findById(PageData pd)throws Exception{
return imgfilesMapper.findById(pd);
}
/**
* @param ArrayDATA_IDS
* @throws Exception
*/
public void deleteAll(String[] ArrayDATA_IDS)throws Exception{
imgfilesMapper.deleteAll(ArrayDATA_IDS);
}
/**()
* @param pd
* @throws Exception
*/
public List<PageData> listAllByIds(PageData pd)throws Exception{
return imgfilesMapper.listAllByIds(pd);
}
/**
*
* @param key
* @param type
* @return
* @throws Exception
*/
public List<PageData> getListByKeyAndType (Object key ,String type) throws Exception{
if(!Tools.isEmpty(key)){
PageData pd = new PageData();
pd.put("FOREIGN_KEY",key);
pd.put("TYPE", type);
return imgfilesMapper.listAll(pd);
}
return new ArrayList<>();
}
/**
*
* @param key
* @param type
* @return
* @throws Exception
*/
public List<PageData> getListByKeyAndTypeV2 (PageData pd, String key ,String type) throws Exception{
if(!Tools.isEmpty(pd)){
PageData img = new PageData();
pd.put("FOREIGN_KEY",pd.get(key));
pd.put("TYPE", type);
return imgfilesMapper.listAll(pd);
}
return null;
}
@Override
public void deleteInspectionHiddenFile(PageData pd) throws Exception {
imgfilesMapper.deleteInspectionHiddenFile(pd);
}
@Override
public void deleteByPath(PageData pd) throws Exception {
imgfilesMapper.deleteByPath(pd);
}
@Override
public void hideImg(PageData forward) {
imgfilesMapper.hideImg(forward);
}
public List<PageData> getListByKeyAndType (Object key) throws Exception{
if(!Tools.isEmpty(key)){
PageData pd = new PageData();
pd.put("FOREIGN_KEY",key);
return imgfilesMapper.listAll(pd);
}
return new ArrayList<>();
}
}