package com.hzya.frame.sysnew.comparison.dao.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.sysnew.comparison.dao.IComparisonDao;
import com.hzya.frame.sysnew.comparison.dao.IComparisonDetailsDao;
import com.hzya.frame.sysnew.comparison.entity.ComparisonDetailsEntity;
import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity;
import org.springframework.stereotype.Repository;

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

@Repository(value = "comparisonDetailsDaoImpl")
public class ComparisonDetailsDaoImpl extends MybatisGenericDao<ComparisonDetailsEntity, String> implements IComparisonDetailsDao {

    //保存通用数据子表数据
    @Override
    public ComparisonDetailsEntity saveComparisonDetails(ComparisonDetailsEntity comparisonDetailsEntity) {
        ComparisonDetailsEntity detailsEntity = super.save(getSqlIdPrifx() + "saveComparisonDetails", comparisonDetailsEntity);
        return detailsEntity;
    }

    //更新通用数据子表数据
    @Override
    public Integer updateComparisonDetailsByType(ComparisonDetailsEntity comparisonDetailsEntity) {
        int update = super.update(getSqlIdPrifx()+"updateComparisonDetailsByType", comparisonDetailsEntity);
        return update;
    }

    //删除通用数据子表的数据
    @Override
    public Integer deleteComparisonDetails(ComparisonDetailsEntity comparisonDetailsEntity) {
        int delete = super.delete(getSqlIdPrifx() + "deleteComparisonDetails", comparisonDetailsEntity);
        return delete;
    }

    //分页查询子表数据
    @Override
    public List<Map<String,Object>> queryComparisonDetailsPage(ComparisonDetailsEntity comparisonDetailsEntity) {
        List<Map<String,Object>> query =(List<Map<String, Object>>) super.selectList(getSqlIdPrifx() + "queryComparisonDetailsPage", comparisonDetailsEntity);
        return query;
    }


}
