package com.bofeng.service;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.bofeng.dao.QzTaskDao;
import com.bofeng.dao.RbMapper;
import com.bofeng.entity.QzTask;
import com.bofeng.entity.SysUptownHouse;
import com.bofeng.entity.sysUptownUnit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;


@Service
public class RbService {

    @Autowired
    private RbMapper rbMapper;

    public List<sysUptownUnit> selectAll (Long userId) {
        List<sysUptownUnit> sysUptownHouses = rbMapper.selectDY(userId);
        return sysUptownHouses;
    }

    public List<SysUptownHouse> selectXq (Long str) {
//        userId = 1224706869998772226L;
//        List<SysUptownHouse> sysUptownHouses = rbMapper.selectList(new EntityWrapper<SysUptownHouse>().eq("ridgepole",ridgepole).eq("unit",unit));
        Date date = new Date();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        String dateStr = simpleDateFormat.format(date);
        List<SysUptownHouse> sysUptownHouses = rbMapper.selectMp(str,dateStr);
        return sysUptownHouses;
    }
}
