遇到過這樣的問題,根據一些字段查數據庫,數據庫里運行沒問題,但是到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>