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

import com.steerinfo.ems.trmproduct.service.ITRmProductService;
import com.steerinfo.ems.trmworkprocmaterial.model.TRmWorkprocMaterial;
import com.steerinfo.ems.trmworkprocmaterial.service.ITRmWorkprocMaterialService;
import com.steerinfo.framework.controller.RESTfulResult;
import com.steerinfo.framework.mapper.IBaseMapper;
import com.steerinfo.framework.service.impl.BaseServiceImpl;

import io.swagger.annotations.ApiOperation;

import com.steerinfo.ems.trmworkprocproduct.model.TRmWorkprocProduct;
import com.steerinfo.ems.trmworkprocproduct.mapper.TRmWorkprocProductMapper;
import com.steerinfo.ems.trmworkprocproduct.service.ITRmWorkprocProductService;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

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

/**
 * TRmWorkprocProduct服务实现：
 * @author generator
 * @version 1.0-SNAPSHORT 2019-10-18 02:12
 * 类描述
 * 修订历史：
 * 日期：2019-10-18
 * 作者：generator
 * 参考：
 * 描述：TRmWorkprocProduct服务实现
 * @see null
 * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
 */
@Service(value = "tRmWorkprocProductService")
public class TRmWorkprocProductServiceImpl extends BaseServiceImpl<TRmWorkprocProduct, String> implements ITRmWorkprocProductService {

	@Autowired
	private JdbcTemplate jdbcTemplate;
	
    @Autowired
    private TRmWorkprocProductMapper tRmWorkprocProductMapper;

    @Override
    protected IBaseMapper<TRmWorkprocProduct, String> getMapper() {
        return tRmWorkprocProductMapper;
    }

    @Override
    public Set<String> getitemid() {
        return tRmWorkprocProductMapper.getitemid();
    }

    @Override
    public List<TRmWorkprocProduct> getMesItemid(HashMap<String, Object> m) {
        return tRmWorkprocProductMapper.getMesItemid(m);
    }

    @Override
    public List<TRmWorkprocProduct> getIdAndDigits(String itemtype) {
        return tRmWorkprocProductMapper.getIdAndDigits(itemtype);
    }

    @Override
    public String getName(String itemid) {
        return tRmWorkprocProductMapper.getName(itemid);
    }
    
    @Override
    public List<Map<String, Object>> queryFinanceData(){
    	String sql = "select v.id,v.name from t_rm_product v where v.id in (select t.productid from T_RM_WORKPROC_PRODUCT t where t.isfinancedata = '1')";
    	List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
    	return list;
    }

}
