package com.cf.imes.module.system.dal.mysql.machine;


import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.cf.imes.module.system.controller.admin.machine.vo.MachineBrandModelRespVO;
import com.cf.imes.module.system.dal.dataobject.machine.MachineBrandDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface MachineBrandMapper extends BaseMapperX<MachineBrandDO> {



    default List<MachineBrandDO> selectListByType(Integer machineType) {
        return selectList(new LambdaQueryWrapperX<MachineBrandDO>()
                .eqIfPresent(MachineBrandDO::getMachineType,machineType));
    }




    default MachineBrandDO selectBrand(String brand,Integer machineType) {
        return selectOne(new LambdaQueryWrapperX<MachineBrandDO>()
                .eqIfPresent(MachineBrandDO::getMachineType,machineType)
                .eqIfPresent(MachineBrandDO::getBrand,brand));
    }


    List<MachineBrandModelRespVO> selectMachineList(@Param("type")  Integer type);

    List<MachineBrandModelRespVO> selectMachineNoDefault();

}
