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 list(Page page)throws Exception{ return imgfilesMapper.datalistPage(page); } /**列表(全部) * @param pd * @throws Exception */ public List 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 listAllByIds(PageData pd)throws Exception{ return imgfilesMapper.listAllByIds(pd); } /** * 根据标识 和 类型获取 附件信息 * @param key * @param type * @return * @throws Exception */ public List 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 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 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<>(); } }