mybatisplus select foreach in 的查询

2023-07-02 17:33:41 浏览数 (2)

mapper代码

代码语言:javascript复制
List<X2DRetailEntity> getAppletBWareOrderByDepotId(@Param("allDepotId") List<String> allDepotId,@Param("selectField") String selectField);

xml代码

代码语言:javascript复制
    <select id="getAppletBWareOrderByDepotId" resultType="com.ellassay.x2.sync.entity.X2DRetailEntity">

        select ${selectField} from X6_BILLS_GLS.D_RETAIL where setdepot_id in

        <foreach  collection="allDepotId" item="ids" open="(" separator="," close=")">

            #{ids}

        </foreach>

        and  setdepot_id = original_depot_id and bills_tag IS NOT NULL

    </select>

0 人点赞