package org.jeecg.modules.dataVue.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.cas.service.IWellboreAuthQuery;
import org.jeecg.modules.dataVue.entity.AFocusjh;
import org.jeecg.modules.dataVue.mapper.MockMapper;
import org.jeecg.modules.dataVue.service.IAFocusjhService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.jeecg.modules.dataVue.mapper.AFocusJhMapper;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class AFocusjhServiceImpl extends ServiceImpl<AFocusJhMapper, AFocusjh>  implements IAFocusjhService {
    @Resource
    private MockMapper mockMapper;
    @Autowired
    IWellboreAuthQuery iWellboreAuthQuery;

    @Override
    public List<Map<String, Object>> querySql(String sqlStr, String reserve) {
        return mockMapper.querySqlA(sqlStr);
    }

    @Override
    public int querySqlCount(String sqlStr, String reserve) {
        return mockMapper.queryCountA(sqlStr);
    }


    public void getList(){
        QueryWrapper<AFocusjh> wrapper= new QueryWrapper<>();

    }

    @Override
    public void updateAFocushJhIsWarn(String id,String isWarn){
        String casAccount = iWellboreAuthQuery.getSessionCasName();
        QueryWrapper<AFocusjh> wrapper= new QueryWrapper<>();
        wrapper.lambda().eq(AFocusjh::getId,id).eq(AFocusjh::getCasUser,casAccount);
        AFocusjh model = this.getOne(wrapper);
        model.setIsWarn(isWarn);
        boolean b = this.update(model,wrapper);

    }

}
