在mapper.xml中
<select id="getStationCount1" parameterType="String" resultType="com.ciic.common.pojo.entity.StationAmount">
select new_station_amount,back_station_amount,key_station_amount
from STATION_AMOUNT
where year_id =#{year_id} and month_id =#{month_id} and branch_id = '1001'
</select>
对应的dao层接口:
StationAmount getStationCount1(String branchId);
对应的Service层:
@Override
public Map<String, Object> getStationCount1(){
Map<String, Object> sa = new HashMap<>();
StationAmount saResult = ithemeDao.getStationCount1("1");
sa.put("NewStationAmount", saResult.getNewStationAmount());
sa.put("BackStationAmount", saResult.getBackStationAmount());
sa.put("KeyStationAmount", saResult.getKeyStationAmount());
System.out.println(sa);
return sa;
}
将mapper.xml中year_id =#{year_id} and month_id =#{month_id}写成变量就报控制珍异常
刚开始接触,求大神帮忙