package com.yeejoin.amos.boot.module.jxiop.api.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jxiop.api.entity.PersonAccount;
import com.yeejoin.amos.boot.module.jxiop.api.entity.StationPlan;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @description:
 * @author: tw
 * @createDate: 2023/8/10
 */

public interface StationPlanMapper extends BaseMapper<StationPlan> {

//    //获取当年全国没有 完成计划
//     @Select("SELECT monthly ,sum(value) value  from  station_plan where  year= #{year}   GROUP BY monthly ")
//     List<StationPlan> getStationPlanby(@Param("year") String year);
//
//    //获取当年全国没有 完成计划
//
//    @Select("SELECT monthly ,sum(value) value  from  station_plan where  year= #{year}   GROUP BY monthly ")
//    List<StationPlan> getStationPlanbyids(@Param("year") String year);

    @Select("select value from station_plan where station_basic_id=#{stationBasicId} and year= #{year} and monthly= #{monthly}")
    Double getPlanGenByStationIdAndMonth(@Param("stationBasicId") String stationId, @Param("year") String year, @Param("monthly") String monthly);

    @Select("select value,monthly from station_plan where station_basic_id=#{stationBasicId} and year= #{year} ")
    List<StationPlan> getPlanGenByStationIdAndYear(@Param("stationBasicId") String stationId, @Param("year") String year);

    @Select("select value,monthly from station_plan where station_basic_id in (${stationBasicId}) and year= #{year} ")
    List<StationPlan> getPlansGenByStationIdAndYear(@Param("stationBasicId") String stationId, @Param("year") String year);


}

