update 标准排序字段更改
This commit is contained in:
@@ -49,8 +49,8 @@ public class FieldCommon {
|
|||||||
);
|
);
|
||||||
|
|
||||||
public static final String MODULE = "module"; // 表名标识
|
public static final String MODULE = "module"; // 表名标识
|
||||||
public static final String ORDER_BY = "orderBy"; // 升序还是倒序标识
|
public static final String ORDER_BY = "order"; // 升序还是倒序标识
|
||||||
public static final String ORDER_BY_FIELD = "orderByField"; // 排序字段
|
public static final String ORDER_BY_FIELD = "column"; // 排序字段
|
||||||
|
|
||||||
// "str_to_date('" + sdf.format(new Date()) + "','%Y-%m-%d %H:%i:%s')"
|
// "str_to_date('" + sdf.format(new Date()) + "','%Y-%m-%d %H:%i:%s')"
|
||||||
public static final String STR_TO_DATE_PREFIX = "str_to_date('"; // 格式化时间格式的前缀
|
public static final String STR_TO_DATE_PREFIX = "str_to_date('"; // 格式化时间格式的前缀
|
||||||
|
|||||||
+4
-4
@@ -1774,9 +1774,9 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
|||||||
* @Description: 给拼装的查询条件排序
|
* @Description: 给拼装的查询条件排序
|
||||||
**/
|
**/
|
||||||
private void orderBySort(Map<String, Object> parameterMap, StringBuilder selectCondition) {
|
private void orderBySort(Map<String, Object> parameterMap, StringBuilder selectCondition) {
|
||||||
if ("1".equals(parameterMap.get(FieldCommon.ORDER_BY))) {
|
if ("asc".equals(parameterMap.get(FieldCommon.ORDER_BY))) {
|
||||||
selectCondition.append(" asc"); //正序
|
selectCondition.append(" asc"); //正序
|
||||||
} else if ("2".equals(parameterMap.get(FieldCommon.ORDER_BY))) {
|
} else if ("desc".equals(parameterMap.get(FieldCommon.ORDER_BY))) {
|
||||||
selectCondition.append(" desc"); //倒序
|
selectCondition.append(" desc"); //倒序
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1787,11 +1787,11 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
|||||||
* @Description: 给拼装的查询条件排序(多日期)
|
* @Description: 给拼装的查询条件排序(多日期)
|
||||||
**/
|
**/
|
||||||
private void orderBySortDateMany(Map<String, Object> parameterMap, StringBuilder selectCondition) {
|
private void orderBySortDateMany(Map<String, Object> parameterMap, StringBuilder selectCondition) {
|
||||||
if ("1".equals(parameterMap.get(FieldCommon.ORDER_BY))) {
|
if ("asc".equals(parameterMap.get(FieldCommon.ORDER_BY))) {
|
||||||
selectCondition.append(" order by STR_TO_DATE(SUBSTRING_INDEX(" +
|
selectCondition.append(" order by STR_TO_DATE(SUBSTRING_INDEX(" +
|
||||||
parameterMap.get(FieldCommon.ORDER_BY_FIELD) + ", ',', 1), '%Y-%m-%d')");
|
parameterMap.get(FieldCommon.ORDER_BY_FIELD) + ", ',', 1), '%Y-%m-%d')");
|
||||||
selectCondition.append(" asc"); //正序
|
selectCondition.append(" asc"); //正序
|
||||||
} else if ("2".equals(parameterMap.get(FieldCommon.ORDER_BY))) {
|
} else if ("desc".equals(parameterMap.get(FieldCommon.ORDER_BY))) {
|
||||||
selectCondition.append(" order by STR_TO_DATE(SUBSTRING_INDEX(" +
|
selectCondition.append(" order by STR_TO_DATE(SUBSTRING_INDEX(" +
|
||||||
parameterMap.get(FieldCommon.ORDER_BY_FIELD) + ", ',', -1), '%Y-%m-%d')");
|
parameterMap.get(FieldCommon.ORDER_BY_FIELD) + ", ',', -1), '%Y-%m-%d')");
|
||||||
selectCondition.append(" desc"); //倒序
|
selectCondition.append(" desc"); //倒序
|
||||||
|
|||||||
Reference in New Issue
Block a user