package com.nokia.tsl_data.dao;

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

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface TargetTsRatioMapper {

        @Select("select * from tsl_data.target_ts_ratio where month_id = #{monthId}")
        List<Map<String, Object>> findByMonthId(String monthId);

        @Update("UPDATE tsl_data.target_ts_ratio\n" + //
                        " SET management_target_ratio = #{target} \n" + //
                        " WHERE month_id = #{monthId} and city_name = #{city} ")
        void updateManagementTargetRatio(@Param("monthId") String monthId,
                        @Param("city") String city, @Param("target") double target);

        @Update("UPDATE tsl_data.target_ts_ratio\n" + //
                        " SET service_request_target_ratio = #{target} \n" + //
                        " WHERE month_id = #{monthId} and city_name = #{city} ")
        void updateServiceRequestTargetRatio(@Param("monthId") String monthId,
                        @Param("city") String city, @Param("target") double target);
}
