【mybatis】mybatis 中select 查詢 select * 查詢出來的數據,字段值帶不出來 數據不全


原來的代碼如下:

 <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>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM