为排序字段添加白名单验证

This commit is contained in:
jishenghua
2026-01-30 11:44:08 +08:00
parent b8758fb3f2
commit 1065be3c47

View File

@@ -276,7 +276,12 @@
order by oper_time desc,number desc order by oper_time desc,number desc
</if> </if>
<if test="column != 'createTime'"> <if test="column != 'createTime'">
order by ${column} ${order} <if test="column == 'barCode' or column == 'operNumber' or column == 'unitPrice' or column == 'allPrice' or column == 'taxMoney'">
order by ${column}
<if test="order == 'asc' or order == 'desc'">
${order}
</if>
</if>
</if> </if>
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
limit #{offset},#{rows} limit #{offset},#{rows}