Explorar el Código

发票导出出错

lyhzzz hace 2 años
padre
commit
daffca98f7
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  1. 6 1
      src/main/resources/mapper/manage/InvoiceMapper.xml

+ 6 - 1
src/main/resources/mapper/manage/InvoiceMapper.xml

@@ -122,7 +122,12 @@
         and o.`trade_time` <![CDATA[ <= ]]>  #{param.payTimeEnd}
       </if>
     ) t
-    order by ${param.orderBy} ${param.sortBy}
+    <if test="param.orderBy != null and param.orderBy!='' and param.sortBy !=null and param.sortBy !='' ">
+      order by ${param.orderBy} ${param.sortBy}
+    </if>
+    <if test="param.orderBy == null or param.orderBy=='' ">
+      order by id desc
+    </if>
   </select>
 
 </mapper>