package com.zt.life.modules.mainPart.basicInfo.service; 
 | 
  
 | 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 
 | 
import com.zt.common.constant.Constant; 
 | 
import com.zt.common.service.BaseService; 
 | 
import com.zt.common.utils.TreeUtils; 
 | 
import com.zt.life.modules.mainPart.basicInfo.dao.TyProductModelDao; 
 | 
import com.zt.life.modules.mainPart.basicInfo.model.TyProductModel; 
 | 
import org.springframework.stereotype.Service; 
 | 
import com.zt.common.db.query.QueryFilter; 
 | 
  
 | 
import java.util.List; 
 | 
  
 | 
  
 | 
/** 
 | 
 * product_model_common 
 | 
 * 
 | 
 * @author zt generator 
 | 
 * @since 1.0.0 2024-02-28 
 | 
 */ 
 | 
@Service 
 | 
public class TyProductModelService extends BaseService<TyProductModelDao, TyProductModel> { 
 | 
  
 | 
    /** 
 | 
     * 分页查询 
 | 
     * 
 | 
     * @param queryFilter 
 | 
     * @return 
 | 
     */ 
 | 
    public List<TyProductModel> page(QueryFilter queryFilter) { 
 | 
        List<TyProductModel> list = baseDao.getList(queryFilter.getQueryParams()); 
 | 
        return list; 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 删除 
 | 
     * 
 | 
     * @param ids 
 | 
     */ 
 | 
    public void delete(Long[] ids) { 
 | 
        super.deleteLogic(ids); 
 | 
    } 
 | 
  
 | 
    public List<TyProductModel> getProductList() { 
 | 
        return baseDao.getProductList(); 
 | 
    } 
 | 
  
 | 
    public List<TyProductModel> getAllTree() { 
 | 
        List<TyProductModel> productList = baseDao.selectList(new QueryWrapper<TyProductModel>().eq(Constant.TableColumn.IS_DELETE, 
 | 
                Constant.Bool.NO).orderByAsc("node_type").orderByAsc(Constant.TableColumn.SORT)); 
 | 
        return TreeUtils.build(productList); 
 | 
    } 
 | 
  
 | 
    public Integer getNo(Long pid, String nodeType) { 
 | 
        Integer no = baseDao.getNo(pid, nodeType); 
 | 
        if (no == null) { 
 | 
            return 0; 
 | 
        } 
 | 
        return baseDao.getNo(pid, nodeType); 
 | 
    } 
 | 
} 
 |