Skip to content
java
public class TxQueryDto{

    ...
    private int[] txType;
    ...
java
IPage<TxClearing> selectRecordByCondition(Page page, @Param("tableName") String tableName, @Param("condition") TxQueryDto condition);
java
    public List<TxClearing> queryRecordByCondition(TxQueryDto txQueryDto) {
        Page page = new Page(txQueryDto.getPidx(), DEFAULT_PAGE_SIZE);
        IPage<TxClearing> txClearings = managementMapper.selectRecordByCondition(
                page, DbTableNameUtils.retTableNameByMonth(txQueryDto.getMonth()) + "_002", txQueryDto);
        return txClearings.getRecords();
    }
xml
<select id="selectRecordByCondition" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List"/>
    from ${tableName}
    where cid=#{condition.cid,jdbcType=BIGINT}

    <if test="condition.txType != null">
        AND tx_type IN
        <foreach collection="condition.txType" index="index" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
    </if>
</select>

文章来源于自己总结和网络转载,内容如有任何问题,请大佬斧正!联系我