package com.hzya.frame.mdm.mdmModule.dao.impl;

import com.hzya.frame.mdm.entity.MdmDataDto;
import com.hzya.frame.mdm.entity.MdmDistributeEntity;
import com.hzya.frame.mdm.entity.MdmDto;
import com.hzya.frame.mdm.entity.MdmQuery;
import com.hzya.frame.mdm.entity.MdmVo;
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao;
import com.hzya.frame.sys.entity.FormmainDeleteDto;
import com.hzya.frame.sys.entity.ModuleDto;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;

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

/**
 * 主数据模版(MdmModule)表数据库访问层
 *
 * @author makejava
 * @since 2023-10-17 15:25:42
 */
@Repository(value = "MdmModuleDaoImpl")
public class MdmModuleDaoImpl extends MybatisGenericDao<MdmModuleEntity, String> implements IMdmModuleDao {

    @Override
    public List<MdmVo> queryMdm(MdmDto entity) {
        List<MdmVo> o = (List<MdmVo>) super.selectList(getSqlIdPrifx() + "queryMdm", entity);
        return o;
    }



    @Override
    public Integer checkTable(Map<String, String> maps) {
        Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "checkTable", maps);
        return o;

    }

    @Override
    public Integer createTable(Map<String, Object> maps) {
        Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "createTable", maps);
        return o;
    }
    @Override
    public Integer createTableDistribute(Map<String, Object> maps) {
        Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "createTableDistribute", maps);
        return o;
    }
    @Override
    public Integer alterTable(Map<String, Object> maps) {
        Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "alterTable", maps);
        return o;
    }

    @Override
    public Integer alterTableName(Map<String, String> maps) {
        Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "alterTableName", maps);
        return o;

    }
    @Override
    public Integer checkData(Map<String, String> maps) {
        Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "checkData", maps);
        return o;

    }
    @Override
    public List<HashMap<String, Object>> querySelectData(MdmDto entity) {
        List<HashMap<String, Object>> o = (List<HashMap<String, Object>>) super.selectList(getSqlIdPrifx() + "querySelectData", entity);
        return o;

    }

    @Override
    public List<HashMap<String, Object>> queryTemplateDataMore(MdmDto entity) {
        List<HashMap<String, Object>> o = (List<HashMap<String, Object>>) super.selectList(getSqlIdPrifx() + "queryTemplateDataMore", entity);
        return o;

    }

    @Override
    public List<HashMap<String, Object>> queryMdmShowData(MdmQuery entity) {
        List<HashMap<String, Object>> o = (List<HashMap<String, Object>>) super.selectList(getSqlIdPrifx() + "queryMdmShowData", entity);
        return o;
    }
    @Override
    public List<HashMap<String, Object>> queryDataAll(MdmDto entity) {
        List<HashMap<String, Object>> o = (List<HashMap<String, Object>>) super.selectList(getSqlIdPrifx() + "queryDataAll", entity);
        return o;
    }

    @Override
    public List<HashMap<String, Object>> queryTemplateData(ModuleDto entity) {
        List<HashMap<String, Object>> o = (List<HashMap<String, Object>>) super.selectList(getSqlIdPrifx() + "queryTemplateData", entity);
        return o;

    }
    @Override
    public Integer updateForm(MdmDataDto mdmDataDto) {
        Integer o = super.update(getSqlIdPrifx() + "updateForm", mdmDataDto);
        return o;

    }
    @Override
    public Integer saveForm(MdmDataDto mdmDataDto) {
        Integer o = super.update(getSqlIdPrifx() + "saveForm", mdmDataDto);
        return o;

    }

    @Override
    public Integer deleteTemplateById(FormmainDeleteDto entity) {
        Integer o = super.delete(getSqlIdPrifx() + "deleteTemplateById", entity);
        return o;

    }

    @Override
    public Integer deleteChilder(FormmainDeleteDto entity) {
        Integer o = super.delete(getSqlIdPrifx() + "deleteChilder", entity);
        return o;

    }

    @Override
    public Integer saveDistribute(MdmDistributeEntity mdmDistributeEntity) {
        Integer o = super.insert(getSqlIdPrifx() + "saveDistribute", mdmDistributeEntity);
        return o;
    }
    @Override
    public Integer updateDistribute(MdmDistributeEntity mdmDistributeEntity) {
        Integer o = super.update(getSqlIdPrifx() + "updateDistribute", mdmDistributeEntity);
        return o;
    }

    @Override
    public HashMap<String, Object> queryTemplateDataOne(MdmDto entity) {
        HashMap<String, Object> o = (HashMap<String, Object>) super.selectOne(getSqlIdPrifx() + "queryTemplateDataOne", entity);
        return o;

    }
}

