原來的代碼如下:
<select id="findByGoodsUid" resultType="com.pisen.cloud.luna.ms.goods.base.domain.GoodsConfigQuery" parameterType="java.util.List"> SELECT * FROM goods_config_query WHERE goods_uid IN <foreach collection="list" item="item" index="index" open="(" separator="," close=")"> #{item} </foreach> </select>
應該指定查詢出來的字段分別對應到實體中的各個字段,解決代碼如下:
<select id="findByGoodsUid" resultType="com.pisen.cloud.luna.ms.goods.base.domain.GoodsConfigQuery" parameterType="java.util.List"> SELECT goods_uid goodsUid, tenement_id tenementId, inner_frist innerFrist, inner_normal innerNormal, inner_danger innerDanger FROM goods_config_query WHERE goods_uid IN <foreach collection="list" item="item" index="index" open="(" separator="," close=")"> #{item} </foreach> </select>