diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BPlanEnterpriseController.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BPlanEnterpriseController.java index 474ea14..37795b8 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BPlanEnterpriseController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BPlanEnterpriseController.java @@ -7,8 +7,11 @@ import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.programManagement.entity.BKeyEnterprise; import com.ruoyi.programManagement.entity.BPlanEnterprise; -import com.ruoyi.programManagement.entity.request.*; +import com.ruoyi.programManagement.entity.request.BPlanEnterprisePageRequest; +import com.ruoyi.programManagement.entity.request.PlanMxRequest; +import com.ruoyi.programManagement.entity.request.checkResultRequest; import com.ruoyi.programManagement.entity.response.BPlanEnterPriseTreeResponse; +import com.ruoyi.programManagement.entity.response.BPlanEnterpriseResponse; import com.ruoyi.programManagement.entity.response.BPlanEnterpriseZhifaResponse; import com.ruoyi.programManagement.mapper.BPlanEnterpriseMapper; import com.ruoyi.programManagement.service.BKeyEnterpriseService; @@ -58,13 +61,14 @@ public class BPlanEnterpriseController extends BaseController { @Resource private IBAdministrativeDivisionService bAdministrativeDivisionService; + /** * 查询计划企业列表 */ - @ApiOperation(value = "查询计划企业列表",response = BPlanEnterprise.class) + @ApiOperation(value = "查询计划企业列表", response = BPlanEnterpriseResponse.class) @GetMapping("/list") public AjaxResult list(BPlanEnterprise bPlanEnterprise) { - List list = bPlanEnterpriseService.selectBPlanEnterpriseList(bPlanEnterprise); + List list = bPlanEnterpriseService.selectBPlanEnterpriseList(bPlanEnterprise); return AjaxResult.success(list); } @@ -88,14 +92,13 @@ public class BPlanEnterpriseController extends BaseController { @GetMapping("/exportpage") public void exportpage(HttpServletResponse response, BPlanEnterprisePageRequest req) { List list = bPlanEnterpriseService.getShouyeList(req); - ExcelUtil util = new ExcelUtil(BPlanEnterPriseTreeResponse. class); + ExcelUtil util = new ExcelUtil(BPlanEnterPriseTreeResponse.class); util.exportExcel(response, list, "行政区划数据"); } - /** * 通过主键查询单条数据 * @@ -178,7 +181,7 @@ public class BPlanEnterpriseController extends BaseController { * @return */ @GetMapping("/getZhifa") - @ApiOperation(value = "执法结果-企业详情",response = BPlanEnterpriseZhifaResponse.class) + @ApiOperation(value = "执法结果-企业详情", response = BPlanEnterpriseZhifaResponse.class) public TableDataInfo getZhifa(@Valid checkResultRequest req) { startPage(); return getDataTable(bPlanEnterpriseService.getZhifa(req)); @@ -191,11 +194,6 @@ public class BPlanEnterpriseController extends BaseController { @PostMapping("/export") public void export(HttpServletResponse response, checkResultRequest req) { List list = bPlanEnterpriseMapper.getZhifa(req); - for (BPlanEnterpriseZhifaResponse a : list) { - String district = a.getDistrict(); - String countyList = bAdministrativeService.getBydistinct(district); - a.setDistrict(countyList); - } ExcelUtil util = new ExcelUtil(BPlanEnterpriseZhifaResponse.class); util.exportExcel(response, list, "导出执法结果"); } @@ -206,14 +204,9 @@ public class BPlanEnterpriseController extends BaseController { @ApiOperation(value = "导出计划管理") @PostMapping("/exportplan") public void exportplan(HttpServletResponse response, BPlanEnterprise bPlanEnterprise) { - List list = bPlanEnterpriseService.selectBPlanEnterpriseList(bPlanEnterprise); - for (BPlanEnterprise a : list) { - String district = a.getDistrict(); - String countyList = bAdministrativeService.getBydistinct(district); - a.setDistrict(countyList); - } - ExcelUtil util = new ExcelUtil(BPlanEnterprise.class); - util.exportExcel(response, list, "计划管理数据"); + List list = bPlanEnterpriseService.selectBPlanEnterpriseList(bPlanEnterprise); + ExcelUtil util = new ExcelUtil(BPlanEnterpriseResponse.class); + util.exportExcel( response,list, "计划管理数据"); } /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/BPlanEnterprise.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/BPlanEnterprise.java index 750c164..d5bebd7 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/BPlanEnterprise.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/BPlanEnterprise.java @@ -10,7 +10,6 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; -import javax.validation.Valid; import java.io.Serializable; import java.util.Date; @@ -55,7 +54,6 @@ public class BPlanEnterprise implements Serializable { /** * 创建时间 */ - @Excel(name = "年份", dateFormat = "yyyy-MM-dd") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd ", timezone = "GMT+8") @DateTimeFormat(pattern = "yyyy-MM-dd") @ApiModelProperty(value = "创建时间") @@ -97,15 +95,6 @@ public class BPlanEnterprise implements Serializable { @ApiModelProperty(value = "部门权限id") private Long deptId; - - /** - * 行政区划 - */ - @ApiModelProperty(value = "行政区划") - @Excel(name = "行政区划") - private String district; - - /** * 计划年份 */ @@ -114,20 +103,20 @@ public class BPlanEnterprise implements Serializable { private String plannedYear; - - /** - * 是否重点企业1:是2:否 + * 计划月份 */ - @ApiModelProperty(value = "是否重点企业1:是2:否") - private Integer isPoint; + @Excel(name = "计划月份") + @ApiModelProperty(value = "计划月份") + private String[] plannedMonth; + /** - * 企业主表名称 + * 行政区划 */ - @TableField(exist = false) - @ApiModelProperty(value = "企业主表名称") - private String entprName; + @ApiModelProperty(value = "行政区划") + @Excel(name = "行政区划") + private String district; /** @@ -139,15 +128,17 @@ public class BPlanEnterprise implements Serializable { /** - * 执法排序 + * 是否重点企业1:是2:否 */ - @ApiModelProperty(value = "执法排序") - private Long lawSort; + @Excel(name = "是否省重点", readConverterExp = "1=是,2=否") + @ApiModelProperty(value = "是否重点企业1:是2:否") + private Integer isPoint; /** * 执法地区 */ + @Excel(name = "执法地区") @ApiModelProperty(value = "执法地区") private String lawAreas; @@ -155,6 +146,7 @@ public class BPlanEnterprise implements Serializable { /** * 执法级别 */ + @Excel(name = "执法级别") @ApiModelProperty(value = "执法级别") private String lawLevel; @@ -162,22 +154,35 @@ public class BPlanEnterprise implements Serializable { /** * 执法层级 */ + @Excel(name = "执法层级") @ApiModelProperty(value = "执法层级") private String lawHierarchy; /** - * 计划月份 + * 0:草稿 1:正式 */ - @ApiModelProperty(value = "计划月份") - private String plannedMonth; + @Excel(name = "状态",readConverterExp = "0=草稿,1=正式") + @ApiModelProperty(value = "0:草稿 1:正式") + private Integer status; + + /** + * 企业主表名称 + */ + @TableField(exist = false) + @ApiModelProperty(value = "企业主表名称") + private String entprName; /** - * 0:草稿 1:正式 + * 执法排序 */ - @ApiModelProperty(value = "0:草稿 1:正式") - private Integer status ; + @ApiModelProperty(value = "执法排序") + private Long lawSort; + + + + /** @@ -208,7 +213,6 @@ public class BPlanEnterprise implements Serializable { private Integer RISK_LEVEL; - /** * 安全风险等级 */ @@ -223,7 +227,6 @@ public class BPlanEnterprise implements Serializable { private String standLevel; - /** * 上次检查时间 */ @@ -231,7 +234,5 @@ public class BPlanEnterprise implements Serializable { private Date examineEndTime; - - } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/response/BPlanEnterpriseResponse.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/response/BPlanEnterpriseResponse.java new file mode 100644 index 0000000..5747f18 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/response/BPlanEnterpriseResponse.java @@ -0,0 +1,238 @@ +package com.ruoyi.programManagement.entity.response; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +/** + * 计划企业响应类 + */ +@Data +@ApiModel("计划企业响应类") +public class BPlanEnterpriseResponse { + + private static final long serialVersionUID = -98531345456142440L; + /** + * 编号 + */ + @ApiModelProperty(value = "编号") + @TableId(type = IdType.AUTO) + private Long id; + + + /** + * 企业id + */ + @ApiModelProperty(value = "企业id") + private String enterpriseId; + + /** + * 创建者ID + */ + @ApiModelProperty(value = "创建者ID") + private Long createId; + + /** + * 创建者 + */ + @ApiModelProperty(value = "创建者") + private String createBy; + + /** + * 创建时间 + */ + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd ", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty(value = "创建时间") + private Date createTime; + + /** + * 更新者ID + */ + @ApiModelProperty(value = "更新者ID") + private Long updateId; + + /** + * 更新者 + */ + @ApiModelProperty(value = "更新者") + private String updateBy; + + /** + * 更新时间 + */ + @ApiModelProperty(value = "更新时间") + private Date updateTime; + + /** + * 备注 + */ + @ApiModelProperty(value = "备注") + private String remark; + + /** + * 用户权限id + */ + @ApiModelProperty(value = "用户权限id") + private Long userId; + + /** + * 部门权限id + */ + @ApiModelProperty(value = "部门权限id") + private Long deptId; + + /** + * 计划年份 + */ + @ApiModelProperty(value = "计划年份") + @Excel(name = "计划年份") + private String plannedYear; + + + /** + * 计划月份 + */ + @Excel(name = "计划月份") + @ApiModelProperty(value = "计划月份") + private String plannedMonth; + + + /** + * 行政区划 + */ + @ApiModelProperty(value = "行政区划") + private String district; + + /** + * 翻译行政区划 + */ + + @Excel(name = "行政区划") + private String districtcounty; + /** + * 企业名称 + */ + @Excel(name = "企业名称") + @ApiModelProperty(value = "企业名称") + private String enterpriseName; + + + /** + * 是否重点企业1:是2:否 + */ + @Excel(name = "是否省重点", readConverterExp = "1=是,2=否") + @ApiModelProperty(value = "是否重点企业1:是2:否") + private Integer isPoint; + + + /** + * 执法地区 + */ + @Excel(name = "执法地区") + @ApiModelProperty(value = "执法地区") + private String lawAreas; + + + /** + * 执法级别 + */ + @Excel(name = "执法级别") + @ApiModelProperty(value = "执法级别") + private String lawLevel; + + + /** + * 执法层级 + */ + @Excel(name = "执法层级") + @ApiModelProperty(value = "执法层级") + private String lawHierarchy; + + + /** + * 0:草稿 1:正式 + */ + @Excel(name = "状态",readConverterExp = "0=草稿,1=正式") + @ApiModelProperty(value = "0:草稿 1:正式") + private Integer status; + + /** + * 企业主表名称 + */ + @TableField(exist = false) + @ApiModelProperty(value = "企业主表名称") + private String entprName; + + + /** + * 执法排序 + */ + @ApiModelProperty(value = "执法排序") + private Long lawSort; + + + + + + + /** + * 0:未检查 1:已检查 + */ + @ApiModelProperty(value = "0:未检查 1:已检查") + private Integer checkStatus; + + + /** + * 检查id + */ + @ApiModelProperty(value = "检查id") + private Integer checkId; + + + /** + * 1当月 2提前 3滞后 + */ + @ApiModelProperty(value = "1当月 2提前 3滞后") + private Integer checkAgeing; + + + /** + * 1当月 2提前 3滞后 + */ + @ApiModelProperty(value = "1当月 2提前 3滞后") + private Integer RISK_LEVEL; + + + /** + * 安全风险等级 + */ + @ApiModelProperty(value = "安全风险等级") + private String riskLevel; + + + /** + * 标准化等级 + */ + @ApiModelProperty(value = "标准化等级") + private String standLevel; + + + /** + * 上次检查时间 + */ + @ApiModelProperty(value = "上次检查时间") + private Date examineEndTime; + + + + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BAdministrativeMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BAdministrativeMapper.java index e6a4864..e16cc1f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BAdministrativeMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BAdministrativeMapper.java @@ -82,11 +82,5 @@ public interface BAdministrativeMapper { List selectBPlanEnterPriseTreeRequestRequestList(@Param("req") BPlanEnterprisePageRequest req); - /** - * 根据乡村,市区查询数据 - * - * @param district 乡村 - * @return - */ - String getBydistinct(@Param("district") String district); + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BPlanEnterpriseMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BPlanEnterpriseMapper.java index 97aa085..14a07de 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BPlanEnterpriseMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BPlanEnterpriseMapper.java @@ -71,7 +71,7 @@ public interface BPlanEnterpriseMapper extends BaseMapper { * @param bPlanEnterprise 计划企业 * @return 计划企业集合 */ - public List selectBPlanEnterpriseList(BPlanEnterprise bPlanEnterprise); + public List selectBPlanEnterpriseList(BPlanEnterprise bPlanEnterprise); /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/quartz/EnterpristQuartz.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/quartz/EnterpristQuartz.java index 14548d1..9bc89b2 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/quartz/EnterpristQuartz.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/quartz/EnterpristQuartz.java @@ -3,6 +3,7 @@ package com.ruoyi.programManagement.quartz; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.programManagement.entity.*; +import com.ruoyi.programManagement.entity.response.BPlanEnterpriseResponse; import com.ruoyi.programManagement.mapper.BEnterpriseNewMapper; import com.ruoyi.programManagement.mapper.BStandardizationMapper; import com.ruoyi.programManagement.mapper.SzsEnterpriseInformationMapper; @@ -127,8 +128,8 @@ public class EnterpristQuartz { @ApiOperation(value = "定时任务修改更新计划表的检查状态、检查id、检查时效字段") public AjaxResult updateExamine() { //查询计划表中的所有数据 - List list = bPlanEnterpriseService.selectBPlanEnterpriseList(null); - for (BPlanEnterprise a:list){ + List list = bPlanEnterpriseService.selectBPlanEnterpriseList(null); + for (BPlanEnterpriseResponse a:list){ BEnterpriseNew bEnterpriseNew = new BEnterpriseNew(); List szEnforExamineList = szEnforExamineService.getByEnterPriseCode(a.getEnterpriseId()); for (SzEnforExamine b:szEnforExamineList) { diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/BPlanEnterpriseService.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/BPlanEnterpriseService.java index debc8a9..8381714 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/BPlanEnterpriseService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/BPlanEnterpriseService.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.programManagement.entity.BPlanEnterprise; import com.ruoyi.programManagement.entity.request.*; import com.ruoyi.programManagement.entity.response.BPlanEnterPriseTreeResponse; +import com.ruoyi.programManagement.entity.response.BPlanEnterpriseResponse; import com.ruoyi.programManagement.entity.response.BPlanEnterpriseZhifaResponse; import com.ruoyi.programManagement.entity.response.zhifaPlanResponse; @@ -26,7 +27,7 @@ public interface BPlanEnterpriseService extends IService { * @param bPlanEnterprise 计划企业 * @return 计划企业集合 */ - public List selectBPlanEnterpriseList(BPlanEnterprise bPlanEnterprise); + public List selectBPlanEnterpriseList(BPlanEnterprise bPlanEnterprise); /** * 根据planId删除计划企业 * diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/IBAdministrativeService.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/IBAdministrativeService.java index a549517..3cd5acc 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/IBAdministrativeService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/IBAdministrativeService.java @@ -66,11 +66,5 @@ public interface IBAdministrativeService { List selectBPlanEnterPriseTreeRequestRequestList(BPlanEnterprisePageRequest req); - /** - * 根据乡村,市区查询数据 - * - * @param district 乡村 - * @return - */ - String getBydistinct(String district); + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BAdministrativeServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BAdministrativeServiceImpl.java index 297a308..949f236 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BAdministrativeServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BAdministrativeServiceImpl.java @@ -97,10 +97,5 @@ public class BAdministrativeServiceImpl implements IBAdministrativeService { - @Override - public String getBydistinct(String district) { - return bAdministrativeMapper.getBydistinct(district); - } - } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BPlanEnterpriseServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BPlanEnterpriseServiceImpl.java index 06a42b4..e1fa89d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BPlanEnterpriseServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BPlanEnterpriseServiceImpl.java @@ -39,7 +39,7 @@ public class BPlanEnterpriseServiceImpl extends ServiceImpl selectBPlanEnterpriseList(BPlanEnterprise bPlanEnterprise) { + public List selectBPlanEnterpriseList(BPlanEnterprise bPlanEnterprise) { return bPlanEnterpriseMapper.selectBPlanEnterpriseList(bPlanEnterprise); } diff --git a/ruoyi-system/src/main/resources/mapper/yingji/BAdministrativeMapper.xml b/ruoyi-system/src/main/resources/mapper/yingji/BAdministrativeMapper.xml index 851b87b..4502861 100644 --- a/ruoyi-system/src/main/resources/mapper/yingji/BAdministrativeMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/yingji/BAdministrativeMapper.xml @@ -110,7 +110,7 @@ ) s diff --git a/ruoyi-system/src/main/resources/mapper/yingji/BEnterpriseNewMapper.xml b/ruoyi-system/src/main/resources/mapper/yingji/BEnterpriseNewMapper.xml index 16e6a3d..1685449 100644 --- a/ruoyi-system/src/main/resources/mapper/yingji/BEnterpriseNewMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/yingji/BEnterpriseNewMapper.xml @@ -47,42 +47,49 @@ diff --git a/ruoyi-system/src/main/resources/mapper/yingji/BPlanEnterpriseMapper.xml b/ruoyi-system/src/main/resources/mapper/yingji/BPlanEnterpriseMapper.xml index ac90b08..af93a98 100644 --- a/ruoyi-system/src/main/resources/mapper/yingji/BPlanEnterpriseMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/yingji/BPlanEnterpriseMapper.xml @@ -34,8 +34,8 @@ - + SELECT a.id, a.enterprise_id, a.create_id, @@ -55,7 +55,7 @@ a.law_areas, a.law_level, a.law_hierarchy, - a.planned_month, + a.planned_month as plannedMonth, a.status, a.check_status, a.check_id, @@ -63,10 +63,12 @@ c.RISK_LEVEL as riskLevel, c.STAND_LEVEL as standLevel, c.EXAMINE_END_TIME as examineEndTime, + CONCAT(d.district,'-', d.county) AS districtcounty, CASE WHEN b.ent_code IS NOT NULL THEN 1 ELSE 2 END AS isPoint FROM b_plan_enterprise a LEFT JOIN b_key_enterprise b ON a.enterprise_id = b.ent_code - LEFT JOIN b_enterprise_new c ON a.enterprise_id = c.enterprise_id COLLATE utf8mb4_unicode_ci + LEFT JOIN b_enterprise_new c ON a.enterprise_id = c.enterprise_id + left join b_administrative_division d on a.district=d.county_code and a.enterprise_id = #{enterpriseId} and a.create_id = #{createId} @@ -76,9 +78,17 @@ and a.district like concat('%', #{district}, '%') and a.planned_year = #{plannedYear} and a.is_point = #{isPoint} + and a.law_hierarchy = #{lawHierarchy} + and a.status = #{status} and a.enterprise_name like concat('%',#{enterpriseName}, '%') + + AND a.planned_month IN + + #{item} + + order by isPoint desc @@ -123,7 +133,7 @@ CASE WHEN b.ent_code IS NOT NULL THEN 1 ELSE 2 END AS isPoint FROM b_plan_enterprise a LEFT JOIN b_key_enterprise b ON a.enterprise_id = b.ent_code - LEFT JOIN b_enterprise_new c ON a.enterprise_id = c.enterprise_id COLLATE utf8mb4_unicode_ci + LEFT JOIN b_enterprise_new c ON a.enterprise_id = c.enterprise_id and a.planned_year =#{req.plannedYear} @@ -247,6 +257,7 @@ #{item} + and status=1 GROUP BY law_areas WITH ROLLUP ORDER BY @@ -277,6 +288,7 @@ and law_areas =#{req.lawAreas} + and status=1 GROUP BY law_hierarchy WITH ROLLUP ORDER BY