package com.ruoyi.adjust.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
        import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.adjust.mapper.DHighValuePubMapper;
import com.ruoyi.adjust.domain.DHighValuePub;
import com.ruoyi.adjust.service.IDHighValuePubService;

/**
 * 高价值对照关联Service业务层处理
 *
 * @author ruoyi
 * @date 2023-04-20
 */
@Service
public class DHighValuePubServiceImpl extends ServiceImpl<DHighValuePubMapper, DHighValuePub> implements IDHighValuePubService {
	@Override
	public List<DHighValuePub> queryListByHvId(Long hvId) {
		// TODO Auto-generated method stub
		DHighValuePub pub=new DHighValuePub();
		pub.setHvId(hvId);
		return queryList(pub);
	}
    /**
     * 查询高价值对照关联列表
     *
     * @param dHighValuePub 高价值对照关联
     * @return 高价值对照关联集合
     * @date 2023-04-20
     */
    @Override
    public List<DHighValuePub> queryList(DHighValuePub dHighValuePub) {
        QueryWrapper<DHighValuePub> queryWrapper = Wrappers.query();
                if (  StringUtils.isNotNull(dHighValuePub.getHvId())){
                    queryWrapper.eq("hv_id", dHighValuePub.getHvId());
                }
                if (  StringUtils.isNotNull(dHighValuePub.getPubId())){
                    queryWrapper.eq("pub_id", dHighValuePub.getPubId());
                }
                if ( StringUtils.isNotEmpty(dHighValuePub.getAppliPub())  ){
                    queryWrapper.eq("appli_pub", dHighValuePub.getAppliPub());
                }
                if ( StringUtils.isNotEmpty(dHighValuePub.getAppliTypePub())  ){
                    queryWrapper.eq("appli_type_pub", dHighValuePub.getAppliTypePub());
                }
                if (  StringUtils.isNotNull(dHighValuePub.getStatus())){
                    queryWrapper.eq("status", dHighValuePub.getStatus());
                }
        queryWrapper.orderByDesc("id");
        return this.list(queryWrapper);
    }

	
}
