Compare commits
No commits in common. "099079f8907e89d7be97e8f5f97ca4e459246a45" and "6a7762f2d0ef362f0062b5ff28acd6a74196f571" have entirely different histories.
099079f890
...
6a7762f2d0
|
@ -1,162 +0,0 @@
|
|||
package com.nu.modules.directiveTag.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nu.modules.directiveTag.entity.DirectiveTag;
|
||||
import com.nu.modules.directiveTag.service.IDirectiveTagService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 指令标签
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-17
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="指令标签")
|
||||
@RestController
|
||||
@RequestMapping("/directiveTag/directiveTag")
|
||||
@Slf4j
|
||||
public class DirectiveTagController extends JeecgController<DirectiveTag, IDirectiveTagService> {
|
||||
@Autowired
|
||||
private IDirectiveTagService directiveTagService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param directiveTag
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "指令标签-分页列表查询")
|
||||
@ApiOperation(value="指令标签-分页列表查询", notes="指令标签-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<DirectiveTag>> queryPageList(DirectiveTag directiveTag,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
// 自定义查询规则
|
||||
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||
// 自定义多选的查询规则为:LIKE_WITH_OR
|
||||
customeRuleMap.put("izEnabled", QueryRuleEnum.LIKE_WITH_OR);
|
||||
QueryWrapper<DirectiveTag> queryWrapper = QueryGenerator.initQueryWrapper(directiveTag, req.getParameterMap(),customeRuleMap);
|
||||
Page<DirectiveTag> page = new Page<DirectiveTag>(pageNo, pageSize);
|
||||
IPage<DirectiveTag> pageList = directiveTagService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param directiveTag
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "指令标签-添加")
|
||||
@ApiOperation(value="指令标签-添加", notes="指令标签-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody DirectiveTag directiveTag) {
|
||||
directiveTagService.save(directiveTag);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param directiveTag
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "指令标签-编辑")
|
||||
@ApiOperation(value="指令标签-编辑", notes="指令标签-编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody DirectiveTag directiveTag) {
|
||||
directiveTagService.updateById(directiveTag);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "指令标签-通过id删除")
|
||||
@ApiOperation(value="指令标签-通过id删除", notes="指令标签-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
directiveTagService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "指令标签-批量删除")
|
||||
@ApiOperation(value="指令标签-批量删除", notes="指令标签-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.directiveTagService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "指令标签-通过id查询")
|
||||
@ApiOperation(value="指令标签-通过id查询", notes="指令标签-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<DirectiveTag> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
DirectiveTag directiveTag = directiveTagService.getById(id);
|
||||
if(directiveTag==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(directiveTag);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param directiveTag
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, DirectiveTag directiveTag) {
|
||||
return super.exportXls(request, directiveTag, DirectiveTag.class, "指令标签");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, DirectiveTag.class);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,78 +0,0 @@
|
|||
package com.nu.modules.directiveTag.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import org.jeecg.common.constant.ProvinceCityArea;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description: 指令标签
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-17
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("config_directive_tag")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="config_directive_tag对象", description="指令标签")
|
||||
public class DirectiveTag implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.String id;
|
||||
/**标签名称*/
|
||||
@Excel(name = "标签名称", width = 15)
|
||||
@ApiModelProperty(value = "标签名称")
|
||||
private java.lang.String tagName;
|
||||
/**排序*/
|
||||
@Excel(name = "排序", width = 15)
|
||||
@ApiModelProperty(value = "排序")
|
||||
private java.lang.Integer sort;
|
||||
/**是否启用 0启用 1未启用*/
|
||||
@Excel(name = "是否启用", width = 15, dicCode = "iz_enabled")
|
||||
@Dict(dicCode = "iz_enabled")
|
||||
@ApiModelProperty(value = "是否启用")
|
||||
private java.lang.String izEnabled;
|
||||
/**是否删除 0未删除 1删除*/
|
||||
@Excel(name = "是否删除", width = 15)
|
||||
@ApiModelProperty(value = "是否删除")
|
||||
@TableLogic
|
||||
private java.lang.String delFlag;
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private java.lang.String createBy;
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private java.lang.String updateBy;
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
/**所属部门*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private java.lang.String sysOrgCode;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package com.nu.modules.directiveTag.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.nu.modules.directiveTag.entity.DirectiveTag;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 指令标签
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-17
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface DirectiveTagMapper extends BaseMapper<DirectiveTag> {
|
||||
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nu.modules.directiveTag.mapper.DirectiveTagMapper">
|
||||
|
||||
</mapper>
|
|
@ -1,14 +0,0 @@
|
|||
package com.nu.modules.directiveTag.service;
|
||||
|
||||
import com.nu.modules.directiveTag.entity.DirectiveTag;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 指令标签
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-17
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IDirectiveTagService extends IService<DirectiveTag> {
|
||||
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package com.nu.modules.directiveTag.service.impl;
|
||||
|
||||
import com.nu.modules.directiveTag.entity.DirectiveTag;
|
||||
import com.nu.modules.directiveTag.mapper.DirectiveTagMapper;
|
||||
import com.nu.modules.directiveTag.service.IDirectiveTagService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 指令标签
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-17
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class DirectiveTagServiceImpl extends ServiceImpl<DirectiveTagMapper, DirectiveTag> implements IDirectiveTagService {
|
||||
|
||||
}
|
|
@ -56,7 +56,22 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
|||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
IPage<ConfigServiceDirective> pageList = service.pageList(configServiceDirective, pageNo, pageSize);
|
||||
// 自定义查询规则
|
||||
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||
// 自定义多选的查询规则为:LIKE_WITH_OR
|
||||
customeRuleMap.put("categoryId", QueryRuleEnum.LIKE_WITH_OR);
|
||||
customeRuleMap.put("typeId", QueryRuleEnum.LIKE_WITH_OR);
|
||||
customeRuleMap.put("instructionTagId", QueryRuleEnum.LIKE_WITH_OR);
|
||||
customeRuleMap.put("izReimbursement", QueryRuleEnum.LIKE_WITH_OR);
|
||||
customeRuleMap.put("izPreferential", QueryRuleEnum.LIKE_WITH_OR);
|
||||
customeRuleMap.put("chargingFrequency", QueryRuleEnum.LIKE_WITH_OR);
|
||||
customeRuleMap.put("cycleType", QueryRuleEnum.LIKE_WITH_OR);
|
||||
customeRuleMap.put("izEnabled", QueryRuleEnum.LIKE_WITH_OR);
|
||||
QueryWrapper<ConfigServiceDirective> queryWrapper = QueryGenerator.initQueryWrapper(configServiceDirective, req.getParameterMap(), customeRuleMap);
|
||||
Page<ConfigServiceDirective> page = new Page<ConfigServiceDirective>(pageNo, pageSize);
|
||||
IPage<ConfigServiceDirective> pageList = configServiceDirectiveService.page(page, queryWrapper);
|
||||
//处理单元格合并所需数据
|
||||
service.merge(pageList.getRecords());
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,19 +1,22 @@
|
|||
package com.nu.modules.serviceDirective.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import org.jeecg.common.constant.ProvinceCityArea;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.nu.modules.directiveTag.entity.DirectiveTag;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令
|
||||
|
@ -97,7 +100,7 @@ public class ConfigServiceDirective implements Serializable {
|
|||
@ApiModelProperty(value = "是否启用")
|
||||
@Dict(dicCode = "iz_enabled")
|
||||
private java.lang.String izEnabled;
|
||||
/**是否删除*/
|
||||
/**是否删除 0未删除 1删除*/
|
||||
@Excel(name = "是否删除", width = 15)
|
||||
@ApiModelProperty(value = "是否删除")
|
||||
@TableLogic
|
||||
|
@ -137,7 +140,4 @@ public class ConfigServiceDirective implements Serializable {
|
|||
private Integer typeRowSpan;
|
||||
@TableField(exist = false)
|
||||
private Integer instructionRowSpan;
|
||||
|
||||
//服务指令标签
|
||||
List<DirectiveTag> tagList;
|
||||
}
|
||||
|
|
|
@ -2,8 +2,6 @@ package com.nu.modules.serviceDirective.mapper;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.nu.modules.serviceDirective.entity.ConfigServiceDirective;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
@ -11,19 +9,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
/**
|
||||
* @Description: 服务指令
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-13
|
||||
* @Date: 2025-03-13
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ConfigServiceDirectiveMapper extends BaseMapper<ConfigServiceDirective> {
|
||||
/**
|
||||
* 自定义分页查询方法
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param directive 主查询对象(包含搜索条件)
|
||||
* @return 分页结果
|
||||
*/
|
||||
IPage<ConfigServiceDirective> pageList(
|
||||
@Param("page") Page<ConfigServiceDirective> page,
|
||||
@Param("directive") ConfigServiceDirective directive
|
||||
);
|
||||
|
||||
}
|
||||
|
|
|
@ -2,102 +2,4 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nu.modules.serviceDirective.mapper.ConfigServiceDirectiveMapper">
|
||||
|
||||
<!-- 自定义结果映射 -->
|
||||
<resultMap id="ConfigServiceDirectiveResultMap"
|
||||
type="com.nu.modules.serviceDirective.entity.ConfigServiceDirective">
|
||||
<id property="id" column="id"/>
|
||||
<result property="categoryId" column="category_id"/>
|
||||
<result property="typeId" column="type_id"/>
|
||||
<result property="instructionTagId" column="instruction_tag_id"/>
|
||||
<result property="directiveName" column="directive_name"/>
|
||||
<result property="tollPrice" column="toll_price"/>
|
||||
<result property="comPrice" column="com_price"/>
|
||||
<result property="izReimbursement" column="iz_reimbursement"/>
|
||||
<result property="izPreferential" column="iz_preferential"/>
|
||||
<result property="chargingFrequency" column="charging_frequency"/>
|
||||
<result property="cycleType" column="cycle_type"/>
|
||||
<result property="sort" column="sort"/>
|
||||
<result property="serviceContent" column="service_content"/>
|
||||
<result property="serviceDuration" column="service_duration"/>
|
||||
<result property="izEnabled" column="iz_enabled"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="sysOrgCode" column="sys_org_code"/>
|
||||
<result property="mp3File" column="mp3_file"/>
|
||||
<result property="mp4File" column="mp4_file"/>
|
||||
|
||||
<collection property="tagList" ofType="com.nu.modules.directiveTag.entity.DirectiveTag">
|
||||
<id property="id" column="tagId"/>
|
||||
<result property="tagName" column="tagName"/>
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
<!-- 分页查询SQL -->
|
||||
<select id="pageList" resultMap="ConfigServiceDirectiveResultMap" parameterType="map">
|
||||
SELECT
|
||||
c.id,
|
||||
c.category_id,
|
||||
c.type_id,
|
||||
c.instruction_tag_id,
|
||||
c.directive_name,
|
||||
c.toll_price,
|
||||
c.com_price,
|
||||
c.iz_reimbursement,
|
||||
c.iz_preferential,
|
||||
c.charging_frequency,
|
||||
c.cycle_type,
|
||||
c.sort,
|
||||
c.service_content,
|
||||
c.service_duration,
|
||||
c.iz_enabled,
|
||||
c.del_flag,
|
||||
c.create_by,
|
||||
c.create_time,
|
||||
c.update_by,
|
||||
c.update_time,
|
||||
c.sys_org_code,
|
||||
c.mp3_file,
|
||||
c.mp4_file,
|
||||
tag.id as tagId,
|
||||
tag.tag_name as tagName
|
||||
FROM config_service_directive c
|
||||
LEFT JOIN directive_tag d ON c.id = d.directive_id
|
||||
LEFT JOIN config_directive_tag tag ON d.tag_id = tag.id
|
||||
<where>
|
||||
<!-- 动态条件拼接 -->
|
||||
<if test="directive.categoryId != null and directive.categoryId != ''">
|
||||
AND c.category_id = #{directive.categoryId}
|
||||
</if>
|
||||
<if test="directive.typeId != null and directive.typeId != ''">
|
||||
AND c.type_id = #{directive.typeId}
|
||||
</if>
|
||||
<if test="directive.instructionTagId != null and directive.instructionTagId != ''">
|
||||
AND d.tag_id = #{directive.instructionTagId}
|
||||
</if>
|
||||
<if test="directive.directiveName != null and directive.directiveName != ''">
|
||||
AND c.directive_name LIKE CONCAT('%', #{directive.directiveName}, '%')
|
||||
</if>
|
||||
<if test="directive.izReimbursement != null and directive.izReimbursement != ''">
|
||||
AND c.iz_reimbursement = #{directive.izReimbursement}
|
||||
</if>
|
||||
<if test="directive.izPreferential != null and directive.izPreferential != ''">
|
||||
AND c.iz_preferential = #{directive.izPreferential}
|
||||
</if>
|
||||
<if test="directive.chargingFrequency != null and directive.chargingFrequency != ''">
|
||||
AND c.charging_frequency = #{directive.chargingFrequency}
|
||||
</if>
|
||||
<if test="directive.cycleType != null and directive.cycleType != ''">
|
||||
AND c.cycle_type = #{directive.cycleType}
|
||||
</if>
|
||||
<if test="directive.izEnabled != null and directive.izEnabled != ''">
|
||||
AND c.iz_enabled = #{directive.izEnabled}
|
||||
</if>
|
||||
AND c.del_flag = '0'
|
||||
</where>
|
||||
ORDER BY c.category_id ASC, c.type_id ASC, c.instruction_tag_id ASC,c.create_time desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
</mapper>
|
|
@ -1,13 +1,9 @@
|
|||
package com.nu.modules.serviceDirective.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.nu.modules.serviceDirective.entity.ConfigServiceDirective;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令
|
||||
|
@ -18,6 +14,4 @@ import java.util.Map;
|
|||
public interface IConfigServiceDirectiveService extends IService<ConfigServiceDirective> {
|
||||
|
||||
void merge(List<ConfigServiceDirective> records);
|
||||
|
||||
IPage<ConfigServiceDirective> pageList(ConfigServiceDirective configServiceDirective, Integer pageNo, Integer pageSize);
|
||||
}
|
||||
|
|
|
@ -1,63 +1,26 @@
|
|||
package com.nu.modules.serviceDirective.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.modules.serviceDirective.entity.ConfigServiceDirective;
|
||||
import com.nu.modules.serviceDirective.mapper.ConfigServiceDirectiveMapper;
|
||||
import com.nu.modules.serviceDirective.service.IConfigServiceDirectiveService;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-13
|
||||
* @Date: 2025-03-13
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigServiceDirectiveMapper, ConfigServiceDirective> implements IConfigServiceDirectiveService {
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<ConfigServiceDirective> pageList(ConfigServiceDirective configServiceDirective, Integer pageNo, Integer pageSize) {
|
||||
Page<ConfigServiceDirective> page = new Page<>(pageNo, pageSize);
|
||||
IPage<ConfigServiceDirective> pageList = baseMapper.pageList(page, configServiceDirective);
|
||||
//处理单元格合并所需数据
|
||||
merge(pageList.getRecords());
|
||||
return pageList;
|
||||
}
|
||||
// @Override
|
||||
// public IPage<ConfigServiceDirective> pageList(ConfigServiceDirective configServiceDirective, Integer pageNo, Integer pageSize, HttpServletRequest req) {
|
||||
// // 自定义查询规则
|
||||
// Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||
// // 自定义多选的查询规则为:LIKE_WITH_OR
|
||||
// customeRuleMap.put("categoryId", QueryRuleEnum.LIKE_WITH_OR);
|
||||
// customeRuleMap.put("typeId", QueryRuleEnum.LIKE_WITH_OR);
|
||||
// customeRuleMap.put("instructionTagId", QueryRuleEnum.LIKE_WITH_OR);
|
||||
// customeRuleMap.put("izReimbursement", QueryRuleEnum.LIKE_WITH_OR);
|
||||
// customeRuleMap.put("izPreferential", QueryRuleEnum.LIKE_WITH_OR);
|
||||
// customeRuleMap.put("chargingFrequency", QueryRuleEnum.LIKE_WITH_OR);
|
||||
// customeRuleMap.put("cycleType", QueryRuleEnum.LIKE_WITH_OR);
|
||||
// customeRuleMap.put("izEnabled", QueryRuleEnum.LIKE_WITH_OR);
|
||||
// QueryWrapper<ConfigServiceDirective> queryWrapper = QueryGenerator.initQueryWrapper(configServiceDirective, req.getParameterMap(), customeRuleMap);
|
||||
// Page<ConfigServiceDirective> page = new Page<>(pageNo, pageSize);
|
||||
// IPage<ConfigServiceDirective> pageList = page(page, queryWrapper);
|
||||
// //处理单元格合并所需数据
|
||||
// merge(pageList.getRecords());
|
||||
// return pageList;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 主合并方法
|
||||
*
|
||||
* @param records 已排序的记录列表(需先按categoryId→typeId→instructionTagId排序)
|
||||
*/
|
||||
@Override
|
||||
|
@ -79,13 +42,11 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigService
|
|||
processAllGroups(records, outerStart, records.size() - 1); // 处理最后一组
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 处理完整个一级分组(包含二级和三级分组)
|
||||
*
|
||||
* @param records 记录列表
|
||||
* @param start 当前分组的起始索引
|
||||
* @param end 当前分组的结束索引
|
||||
* @param start 当前分组的起始索引
|
||||
* @param end 当前分组的结束索引
|
||||
*/
|
||||
private void processAllGroups(List<ConfigServiceDirective> records, int start, int end) {
|
||||
processOuterGroup(records, start, end); // 处理一级categoryRowSpan
|
||||
|
@ -106,10 +67,9 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigService
|
|||
|
||||
/**
|
||||
* 处理二级typeId分组(包含三级instructionTagId分组)
|
||||
*
|
||||
* @param records 记录列表
|
||||
* @param start 当前分组的起始索引
|
||||
* @param end 当前分组的结束索引
|
||||
* @param start 当前分组的起始索引
|
||||
* @param end 当前分组的结束索引
|
||||
*/
|
||||
private void processMiddleGroup(List<ConfigServiceDirective> records, int start, int end) {
|
||||
processTypeRowSpan(records, start, end); // 设置二级typeRowSpan
|
||||
|
@ -130,10 +90,9 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigService
|
|||
|
||||
/**
|
||||
* 处理三级instructionTagId分组
|
||||
*
|
||||
* @param records 记录列表
|
||||
* @param start 当前分组的起始索引
|
||||
* @param end 当前分组的结束索引
|
||||
* @param start 当前分组的起始索引
|
||||
* @param end 当前分组的结束索引
|
||||
*/
|
||||
private void processInnerGroup(List<ConfigServiceDirective> records, int start, int end) {
|
||||
int count = end - start + 1;
|
||||
|
|
|
@ -163,7 +163,7 @@ spring:
|
|||
slow-sql-millis: 5000
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:mysql://1.92.152.160:33061/nursing_unit?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
url: jdbc:mysql://1.92.152.160:33061/nursing_unit_001?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
# url: jdbc:mysql://localhost:3306/nursing_unit_001?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: root
|
||||
|
@ -348,4 +348,4 @@ tplink:
|
|||
port: 21
|
||||
username: administrator
|
||||
password: Root@123..
|
||||
uploadpath: /
|
||||
uploadpath: /
|
Loading…
Reference in New Issue