您的位置:首页 > 运维架构 > Apache

org.apache.ibatis.ognl.OgnlException: source is null for getProperty(null, "mil_id")

2018-01-31 18:12 621 查看
org.apache.ibatis.ognl.OgnlException: source is null for getProperty(null, "mil_id")

今天遇到这个问题,  经过一番探索,  发现是mybatis 查询语句的问题  ,其中我有个条件查询语句  动态写参数, (由于一些原因copy部分代码 )

其中equipmentCode是关联表中的字段,所有我用energyStation对象准备去点出来,原来的代码

<select id="getEquipmentInfoList"  resultMap="equipmentInfoMap">

<where>

            <if test="energyStation.energyStationName != null and energyStation.energyStationName !=''">

                and es.energy_station_name =#{energyStation.energyStationName}

            </if>           

        </where>

</select>

改之后

<select id="getEquipmentInfoList"  resultMap="equipmentInfoMap">

<where>

            <if test="energyStationName != null and energyStationName
!=''">

                and es.energy_station_name =#{energyStationName}

            </if>

           

        </where>

</select>

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  mybatis
相关文章推荐