package com.nmgs.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.nmgs.mapper.Mapper;
import com.nmgs.util.LogUtil;
import com.nmgs.util.PubTools;
import oracle.sql.CLOB;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

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

@Service
public class IntegralStarSetupServiceImpl {
    @Autowired
    public Mapper mapperI;
    private String sql="select " +
            " ist.ID ,ist.BEGIN_VALUE ,ist.END_VALUE ,ist.STAR_LEVEL ," +
            " ist.EQUIT,ist.COUPOTYPE,ist.DISCOUNT/10 AS DISCOUNT,ist.COUPOCOUNT," +
            " ist.SCORE,ist.BAK1,ist.BAK2,ist.PAYTYPE" +
            " from INTEGRAL_STAR_SETUP ist " +
            " where 1=1 ";
    public List getList(String starLevel){
        List list=null;
        String sqlTemp=sql;
        try{
            if(!PubTools.isNull(starLevel)){
                sqlTemp += " and ist.STAR_LEVEL = '"+starLevel+"'";
            }
            list= this.mapperI.selectforlist(sqlTemp);
        }catch (Exception e){
            LogUtil.WriteLog_Error("星级权益查询失败====>"+e.getMessage(),"IntegralStarSetupServiceImpl");
            return list=null;
        }
        return list;

    }
}
