| | |
| | | Map<String,String> sortDate = (Map<String, String>) config.get("sort"); |
| | | String field = sortDate.get("field").replaceAll("(?<!^)([A-Z])", "_$1").toLowerCase(); |
| | | String orderBy = sortDate.get("order"); |
| | | System.out.println(field+" "+orderBy); |
| | | |
| | | Map<String,Object> map = new HashMap<>(); |
| | | map.put("data",orderMapper.getOrderList(offset, pageSize, startDate, endDate, order,orderType, field, orderBy)); |
| | |
| | | </update> |
| | | |
| | | <select id="getOrderList"> |
| | | select |
| | | *, |
| | | select * from (select |
| | | o.*, |
| | | ifnull(sum(fgi.quantity_available),0) as goodsQuantity |
| | | from |
| | | sd.`order` as o |
| | |
| | | and o.processing_note REGEXP #{order.processingNote} |
| | | </if> |
| | | group by o.id |
| | | ) as acc |
| | | order by |
| | | <if test="orderBy == 'null' or orderBy == null"> |
| | | o.id desc |
| | | </if> |
| | | <if test="!(orderBy == 'null' or orderBy == null) and orderBy == 'desc'"> |
| | | #{field} desc |
| | | <if test="orderBy == null "> |
| | | id desc |
| | | </if> |
| | | <if test="!(orderBy == 'null' or orderBy == null) and orderBy == 'asc'"> |
| | | #{field} asc |
| | | <if test="orderBy == 'desc'"> |
| | | ${field} desc |
| | | </if> |
| | | |
| | | <if test="orderBy == 'asc'"> |
| | | ${field} |
| | | </if> |
| | | limit #{offset},#{pageSize} |
| | | </select> |
| | | |