package cn.hnthyy.thmz.service.impl.his.zd;

import cn.hnthyy.thmz.entity.his.zd.ZdChargeItem;
import cn.hnthyy.thmz.enums.YesNoEnum;
import cn.hnthyy.thmz.mapper.his.zd.ZdChargeItemMapper;
import cn.hnthyy.thmz.pageDto.ZdChargeItemDto;
import cn.hnthyy.thmz.service.his.zd.ZdChargeItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
@Service
public class ZdChargeItemServiceImpl implements ZdChargeItemService {
    @SuppressWarnings("all")
    @Autowired
    private ZdChargeItemMapper zdChargeItemMapper;

    @Override
    public List<ZdChargeItem> queryZdChargeItemWithPage(ZdChargeItemDto zdChargeItemDto) {
        return zdChargeItemMapper.selectZdChargeItemWithPage(zdChargeItemDto);
    }

    @Override
    public int countZdChargeItem(ZdChargeItem zdChargeItem) {
        return zdChargeItemMapper.countZdChargeItem(zdChargeItem);
    }

    @Override
    public ZdChargeItem queryZdChargeItemByCode(String code) {
        return zdChargeItemMapper.selectZdChargeItemByCode(code);
    }

    @Override
    public List<ZdChargeItem> queryZdChargeItemByCodeList(List<String> codes) {
        return zdChargeItemMapper.selectZdChargeItemByCodeList(codes);
    }

    @Override
    public List<String> queryAllHsmName() {
        return zdChargeItemMapper.selectAllHsmName();
    }

    @Override
    public int saveZdChargeItem(ZdChargeItem zdChargeItem) {
        zdChargeItem.setAddDate(new Date());
        zdChargeItem.setDelFlag(YesNoEnum.NO.code);
        return zdChargeItemMapper.insertZdChargeItem(zdChargeItem);
    }

    @Override
    public int modifyZdChargeItem(ZdChargeItem zdChargeItem) {
        return zdChargeItemMapper.updateZdChargeItem(zdChargeItem);
    }

    @Override
    public List<ZdChargeItem> queryAllInUsedZdCharge() {
        return zdChargeItemMapper.selectAllInUsedZdCharge();
    }
}
