package io.renren.modules.app.service.impl;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import io.renren.modules.app.dao.XzdyFwxxSdDao;
import io.renren.modules.app.entity.XlkEntity;
import io.renren.modules.app.entity.XzdyFwxxSdEntity;
import io.renren.modules.app.service.XzdyFwxxSdService;
import java.util.ArrayList;
import java.util.List;
import org.springframework.stereotype.Service;

@Service("XzdyFwxxSdService")
public class XzdyFwxxSdServiceImpl extends ServiceImpl<XzdyFwxxSdDao, XzdyFwxxSdEntity> implements XzdyFwxxSdService {

	@Override
	public void updateBymh(XzdyFwxxSdEntity xzdyFwxxSdEntity) {
		baseMapper.updatebymh(xzdyFwxxSdEntity);

	}

	@Override
	public List<XlkEntity> selectxlk(String id) {
		List<XlkEntity> list = new ArrayList<XlkEntity>();
		if ("01".equals(id)) {
			list = baseMapper.selectxq();
		} else if ("02".equals(id)) {
			list = baseMapper.selectxm();
		} else if ("03".equals(id)) {
			list = baseMapper.selectlz();
		} else {
			list = baseMapper.selectdy();
		}
		return list;
	}
	
	 /**
     * 分页模糊查询
     * @param pageNum
     * @param pageSize
     * @param fwxxEntity
     * @return
     */
    @Override
    public PageInfo<XzdyFwxxSdEntity> queryByPage(Integer pageNum, Integer pageSize, XzdyFwxxSdEntity xzdyFwxxSdEntity) {
        PageHelper.startPage(pageNum, pageSize);
        List<XzdyFwxxSdEntity> xzdyFwxxSdEntitys = baseMapper.queryByPage(xzdyFwxxSdEntity);
        PageInfo<XzdyFwxxSdEntity> pageInfo = new PageInfo<XzdyFwxxSdEntity>(xzdyFwxxSdEntitys);
        return pageInfo;
    }

}
