package com.mortals.xhx.module.check.dao.ibatis;

import com.mortals.xhx.module.check.dao.CheckAllRecordDao;
import com.mortals.xhx.module.check.model.CheckAllRecordQuery;
import com.mortals.xhx.module.check.model.vo.CheckAllRecordVo;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 全部类型核查信息Dao
 */
@Repository("checkAllRecordDao")
public class CheckAllRecordDaoImpl extends SqlSessionDaoSupport implements CheckAllRecordDao {

    protected String namespace = this.getClass().getName();

    @Autowired
    public void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory) {
        super.setSqlSessionFactory(sqlSessionFactory);
    }

    protected String getSqlId(String id) {
        return this.namespace + "." + id;
    }

    @Override
    public List<CheckAllRecordVo> getAllCheckRecord(CheckAllRecordQuery checkAllRecordQuery) {

        return this.getSqlSession().selectList(this.getSqlId("getList"), checkAllRecordQuery);
    }
}
