package com.limap.demo.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.limap.common.utils.StringUtils;
import com.limap.demo.mapper.DemoSchoolMapper;
import com.limap.demo.domain.DemoSchool;
import com.limap.demo.service.IDemoSchoolService;

/**
 * 树表演示Service业务层处理
 * 
 * @author metaee
 * @date 2023-02-28
 */
@Service
public class DemoSchoolServiceImpl extends ServiceImpl<DemoSchoolMapper, DemoSchool> implements IDemoSchoolService {
    @Autowired
    private DemoSchoolMapper demoSchoolMapper;
    
    /**
     * 查询树表演示列表
     * 
     * @param demoSchool 树表演示
     * @return 树表演示
     */
    @Override
    public List<DemoSchool> selectDemoSchoolList(DemoSchool demoSchool) {
    	LambdaQueryWrapper<DemoSchool> queryWrapper = Wrappers.lambdaQuery();
        if (StringUtils.isNotEmpty(demoSchool.getSchoolName())) {
			queryWrapper.like(DemoSchool::getSchoolName, demoSchool.getSchoolName());
		}
        if (StringUtils.isNotEmpty(demoSchool.getStatus())) {
			queryWrapper.eq(DemoSchool::getStatus, demoSchool.getStatus());
		}
        return demoSchoolMapper.selectList(queryWrapper);
    }
}
