1. 程式人生 > >mybatis 傳入List 並迴圈處理資料總和

mybatis 傳入List 並迴圈處理資料總和

<select id="getProjectInfoCount" resultType="java.lang.Integer" parameterType="java.util.List">
    select sum(one) from (
    <foreach  collection="list" item="tableName" separator="union all">
    select count(1) as one from ${tableName} where del_state = 1
    </foreach>
    ) copyTables
    </select>