diff --git a/src/com/engine/organization/common/BaseQueryParam.java b/src/com/engine/organization/common/BaseQueryParam.java index c5defd50..b86d5412 100644 --- a/src/com/engine/organization/common/BaseQueryParam.java +++ b/src/com/engine/organization/common/BaseQueryParam.java @@ -19,4 +19,9 @@ public class BaseQueryParam { //每页数据条数 private Integer pageSize = 10; + + /** + * 排序 + */ + private String sortParams; } diff --git a/src/com/engine/organization/entity/company/param/CompSearchParam.java b/src/com/engine/organization/entity/company/param/CompSearchParam.java index a82c93b3..1134b99c 100644 --- a/src/com/engine/organization/entity/company/param/CompSearchParam.java +++ b/src/com/engine/organization/entity/company/param/CompSearchParam.java @@ -16,7 +16,7 @@ import lombok.NoArgsConstructor; @Builder @AllArgsConstructor @NoArgsConstructor -public class CompSearchParam extends BaseQueryParam { +public class CompSearchParam extends BaseQueryParam { /** * 主键 diff --git a/src/com/engine/organization/mapper/comp/CompMapper.java b/src/com/engine/organization/mapper/comp/CompMapper.java index 29bc23b3..8f10abcc 100644 --- a/src/com/engine/organization/mapper/comp/CompMapper.java +++ b/src/com/engine/organization/mapper/comp/CompMapper.java @@ -19,7 +19,7 @@ public interface CompMapper { * * @return */ - List list(); + List list(@Param("orderSql") String orderSql); /** * 查询所有被引用的ID @@ -33,7 +33,7 @@ public interface CompMapper { * * @return */ - List listByFilter(CompPO compPO); + List listByFilter(@Param("compPO") CompPO compPO, @Param("orderSql") String orderSql); /** * 获取顶级数据 @@ -95,13 +95,13 @@ public interface CompMapper { /** * 根据ID批量查询数据 + * * @param ids * @return */ List getCompsByIds(@Param("ids") Collection ids); - /** * 保存公司/分部基础信息 * @@ -136,6 +136,7 @@ public interface CompMapper { /** * 获取最大排序 + * * @return */ int getMaxShowOrder(); diff --git a/src/com/engine/organization/mapper/comp/CompMapper.xml b/src/com/engine/organization/mapper/comp/CompMapper.xml index 124ed2cc..d22ac668 100644 --- a/src/com/engine/organization/mapper/comp/CompMapper.xml +++ b/src/com/engine/organization/mapper/comp/CompMapper.xml @@ -144,7 +144,7 @@ FROM jcl_org_comp t - WHERE t.delete_type = 0 order by show_order + WHERE t.delete_type = 0 order by ${orderSql} - SELECT FROM jcl_org_comp t WHERE t.delete_type = 0 - - and t.parent_company = #{parentCompany} + + and t.parent_company = #{compPO.parentCompany} - - and t.industry = #{industry} + + and t.industry = #{compPO.industry} - - and t.comp_principal = #{compPrincipal} + + and t.comp_principal = #{compPO.compPrincipal} - - and t.forbidden_tag = #{forbiddenTag} + + and t.forbidden_tag = #{compPO.forbiddenTag} + order by ${orderSql}