package com.steerinfo.ems.tcm0310.service.impl;

import com.steerinfo.ems.tcm0310.mapper.TCm0310Mapper;
import com.steerinfo.ems.tcm0310.model.TCm0310;
import com.steerinfo.ems.tcm0310.service.ITCm0310Service;
import com.steerinfo.framework.mapper.IBaseMapper;
import com.steerinfo.framework.model.IUpdatePO;
import com.steerinfo.framework.service.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

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

/**
 * TCm0310服务实现：
 * @author 王金涛
 * @version 1.0-SNAPSHORT 2019-10-15
 * 类描述
 * 修订历史：
 * 日期：2019-10-15
 * 作者：王金涛
 * 参考：
 * 描述：TCm0310服务实现
 * @see null
 * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
 */
@Service(value = "tCm0310Service")
public class TCm0310ServiceImpl extends BaseServiceImpl<TCm0310, String> implements ITCm0310Service {

    @Autowired
    private TCm0310Mapper tCm0310Mapper;

    @Override
    protected IBaseMapper<TCm0310, String> getMapper() {
        return tCm0310Mapper;
    }

    public List<TCm0310> getNameAndId(){
        return tCm0310Mapper.getNameAndId();
    }

    public TCm0310 getusestate(Map<String, Object> parameters){
        return tCm0310Mapper.getUseState(parameters);
    }

    synchronized  public Long getmaxsort(){return tCm0310Mapper.getMaxSort();}

    synchronized  public String getMaxId(){
        return tCm0310Mapper.getMaxId();
    }
    /**
     public  TCm0310 getById(Map<String, Object> parameters){
     return tCm0310Mapper.selectByPrimaryKey(parameters);
     }
     @Override
     public TCm0310 modify(TCm0310 t) {
     if (t instanceof IUpdatePO) {
     this.setUpdate((IUpdatePO)t);
     }

     this.getMapper().updateByPrimaryKeySelective(t);
     Map<String, Object> parameters = new HashMap();
     parameters.put("watercode", t.getWatercode());
     parameters.put("sort", t.getSort());
     return tCm0310Mapper.selectByPrimaryKey(parameters);
     }
     */
}
