Mybatis的SQL语句根据某些字段查不到值(语法不错)

遇到过这样的问题,根据一些字段查数据库,数据库里运行没问题,但是到mapper.xml就是拿不到

结果我按每个条件试着查,发现其他都没问题,有一个字段作为条件查询时查询不到,

于是试着把#取值换成$取值,好了

<select id="getInventoryByThree" parameterType="com.docc.model.Inventory"
     resultType="com.docc.model.Inventory">
        select * from BUS_INVENTORY 
        where company = #{company,jdbcType=VARCHAR} 
              and reportdate = #{reportdate,jdbcType=CHAR} 
              and type = '${type}' 
    </select>
原文地址:https://www.cnblogs.com/fengnan/p/9967416.html