|
@@ -125,9 +125,9 @@ public interface StandardMapper {
|
|
|
*/
|
|
|
@SelectProvider(type = SqlProvider.class, method = "selectByIdList")
|
|
|
List<JSONObject> selectByIdList(@Param("tableName") String tableName
|
|
|
- , @Param("pkName") String pkName
|
|
|
- , @Param("idList") List<Long> idList
|
|
|
- , @Param("showData") List<String> showData);
|
|
|
+ , @Param("pkName") String pkName
|
|
|
+ , @Param("idList") List<Long> idList
|
|
|
+ , @Param("showData") List<String> showData);
|
|
|
|
|
|
/**
|
|
|
* 功能描述: 自定义查询,需要查询的字段和value都在condition中
|
|
@@ -143,12 +143,12 @@ public interface StandardMapper {
|
|
|
*/
|
|
|
@SelectProvider(type = SqlProvider.class, method = "selectByCondition")
|
|
|
List<JSONObject> selectByCondition(@Param("tableName") String tableName
|
|
|
- , @Param("condition") JSONObject condition
|
|
|
- , @Param("packCondition") JSONObject packCondition
|
|
|
- , @Param("showData") List<String> showData
|
|
|
- , @Param("orderBy") String orderBy
|
|
|
- , @Param("limit") int limit
|
|
|
- , @Param("offset") int offset);
|
|
|
+ , @Param("condition") JSONObject condition
|
|
|
+ , @Param("packCondition") JSONObject packCondition
|
|
|
+ , @Param("showData") List<String> showData
|
|
|
+ , @Param("orderBy") String orderBy
|
|
|
+ , @Param("limit") int limit
|
|
|
+ , @Param("offset") int offset);
|
|
|
|
|
|
/**
|
|
|
* 功能描述: 自定义查询,需要查询的字段和value都在condition中
|
|
@@ -164,12 +164,12 @@ public interface StandardMapper {
|
|
|
*/
|
|
|
@SelectProvider(type = SqlProvider.class, method = "selectByLeftJoinCondition")
|
|
|
List<JSONObject> selectByLeftJoinCondition(@Param("queryBySql") QueryBySqlDto queryBySql
|
|
|
- , @Param("packCondition") JSONObject packCondition
|
|
|
- , @Param("condition") JSONObject condition
|
|
|
- , @Param("showData") List<String> showData
|
|
|
- , @Param("orderBy") String orderBy
|
|
|
- , @Param("limit") int limit
|
|
|
- , @Param("offset") int offset);
|
|
|
+ , @Param("packCondition") JSONObject packCondition
|
|
|
+ , @Param("condition") JSONObject condition
|
|
|
+ , @Param("showData") List<String> showData
|
|
|
+ , @Param("orderBy") String orderBy
|
|
|
+ , @Param("limit") int limit
|
|
|
+ , @Param("offset") int offset);
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -464,7 +464,7 @@ public interface StandardMapper {
|
|
|
wholeSql.append(" from ").append(tableName);
|
|
|
// 条件
|
|
|
packCondition(packCondition, wholeSql);
|
|
|
- wholeSql.append(" order by ").append(orderBy).append(" limit ").append(limit);
|
|
|
+ wholeSql.append(" order by ").append(orderBy(orderBy)).append(" limit ").append(limit);
|
|
|
if (isNotEmpty(offset)) {
|
|
|
wholeSql.append(", ").append(offset);
|
|
|
}
|
|
@@ -487,7 +487,7 @@ public interface StandardMapper {
|
|
|
|
|
|
// 条件
|
|
|
packCondition(packCondition, wholeSql);
|
|
|
- wholeSql.append(" order by ").append(orderBy).append(" limit ").append(limit);
|
|
|
+ wholeSql.append(" order by ").append(orderBy(orderBy)).append(" limit ").append(limit);
|
|
|
if (isNotEmpty(offset)) {
|
|
|
wholeSql.append(", ").append(offset);
|
|
|
}
|
|
@@ -710,5 +710,9 @@ public interface StandardMapper {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public static String orderBy(String orderBy){
|
|
|
+ return isNullOrEmpty(orderBy) ? " create_time desc " : orderBy;
|
|
|
+ }
|
|
|
}
|
|
|
}
|