package io.bdty.modules.cniyv.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import io.bdty.common.constant.Constant;
import io.bdty.common.service.impl.CrudServiceImpl;
import io.bdty.modules.cniyv.dao.CniyvProductDao;
import io.bdty.modules.cniyv.dto.CniyvProductDTO;
import io.bdty.modules.cniyv.entity.CniyvProductEntity;
import io.bdty.modules.cniyv.service.CniyvProductService;
import cn.hutool.core.util.StrUtil;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 产品
 *
 * @author zxj zxj
 * @since 1.0.0 2024-03-12
 */
@Service
public class CniyvProductServiceImpl extends CrudServiceImpl<CniyvProductDao, CniyvProductEntity, CniyvProductDTO> implements CniyvProductService {

    @Override
    public QueryWrapper<CniyvProductEntity> getWrapper(Map<String, Object> params){
    	String id = (String)params.get("id");
        String typeid = (String)params.get("typeid");
//        String orderField = (String)params.get("orderField");
//        String order = (String)params.get("order");
//        boolean isAsc = true;
//        if (order!=null) {
//			if (order.equals(Constant.DESC)) {
//				isAsc = false;
//			} 
//		}

        QueryWrapper<CniyvProductEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StrUtil.isNotBlank(id), "id", id);
        wrapper.eq(StrUtil.isNotBlank(typeid), "typeid", typeid);
       //wrapper.orderBy(StrUtil.isNotBlank(orderField), isAsc, orderField);

        return wrapper;
    }


}