package com.uas.account.service;

import com.uas.account.entity.MasterInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by hejq on 2017-11-29.
 */
@Service
public class MasterInfoServiceImpl implements MasterInfoService {

	@Autowired
	private JdbcTemplate jdbcTemplate;

	@Override
	public List<MasterInfo> findByUU(Long uu) {
		String sql = "select * from masters where (platform = 'SAAS' or (platform = 'ERP' and install_type = 'uas1.0')) and uu =" + uu;
		return jdbcTemplate.query(sql, new BeanPropertyRowMapper<MasterInfo>(MasterInfo.class));
	}
}
