42 changed files with 1222 additions and 83 deletions
@ -0,0 +1,157 @@ |
|||||
|
package org.dromara.business.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 jakarta.servlet.http.HttpServletRequest; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import org.dromara.business.domain.BusinessAlert; |
||||
|
import org.dromara.business.domain.BusinessPatrolAreas; |
||||
|
import org.dromara.business.domain.BusinessPatrolAreasPoints; |
||||
|
import org.dromara.business.domain.BusinessPatrolAreasUser; |
||||
|
import org.dromara.business.domain.bo.BusinessPatrolAreasBo; |
||||
|
import org.dromara.business.service.IBusinessPatrolAreasPointsService; |
||||
|
import org.dromara.business.service.IBusinessPatrolAreasService; |
||||
|
import org.dromara.business.service.IBusinessPatrolAreasUserService; |
||||
|
import org.dromara.common.core.domain.R; |
||||
|
import org.dromara.common.core.utils.MapstructUtils; |
||||
|
import org.dromara.common.satoken.utils.LoginHelper; |
||||
|
import org.dromara.common.web.core.BaseController; |
||||
|
import org.dromara.system.api.model.LoginUser; |
||||
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
||||
|
import org.jeecgframework.poi.excel.entity.ExportParams; |
||||
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
||||
|
import org.springframework.beans.factory.annotation.Value; |
||||
|
import org.springframework.validation.annotation.Validated; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
import org.springframework.web.servlet.ModelAndView; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description: 巡查区域 |
||||
|
*/ |
||||
|
@Validated |
||||
|
@RequiredArgsConstructor |
||||
|
@RestController |
||||
|
@RequestMapping("/patrol/patrolAreas") |
||||
|
public class BusinessPatrolAreasController extends BaseController { |
||||
|
|
||||
|
private final IBusinessPatrolAreasService patrolAreasService; |
||||
|
|
||||
|
private final IBusinessPatrolAreasPointsService patrolAreasPointsService; |
||||
|
|
||||
|
private final IBusinessPatrolAreasUserService patrolAreasUserService; |
||||
|
|
||||
|
// @Value("${jeecg.path.upload}")
|
||||
|
private String upLoadPath; |
||||
|
|
||||
|
/** |
||||
|
* 巡查区域-分页列表查询 |
||||
|
* |
||||
|
* @param patrolAreasBo |
||||
|
* @param pageNo |
||||
|
* @param pageSize |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping(value = "/list") |
||||
|
public R<IPage<BusinessPatrolAreas>> queryPageList(BusinessPatrolAreasBo patrolAreasBo, |
||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize) { |
||||
|
Page<BusinessPatrolAreas> page = new Page<BusinessPatrolAreas>(pageNo, pageSize); |
||||
|
IPage<BusinessPatrolAreas> pageList = patrolAreasService.pagePatrolAreas(page, patrolAreasBo); |
||||
|
return R.ok(pageList); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 巡查区域-添加 |
||||
|
* |
||||
|
* @param patrolAreas |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping(value = "/add") |
||||
|
public R<?> add(@RequestBody BusinessPatrolAreas patrolAreas) { |
||||
|
boolean flag = patrolAreasService.addPatrolAreas(patrolAreas); |
||||
|
if(flag){ |
||||
|
return R.ok("添加成功!"); |
||||
|
} |
||||
|
return R.fail("新增失败"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 巡查区域-编辑 |
||||
|
* |
||||
|
* @param patrolAreas |
||||
|
* @return |
||||
|
*/ |
||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
||||
|
public R<?> edit(@RequestBody BusinessPatrolAreas patrolAreas) { |
||||
|
boolean flag = patrolAreasService.updatePatrolAreas(patrolAreas); |
||||
|
if(flag){ |
||||
|
return R.ok("添加成功!"); |
||||
|
} |
||||
|
return R.fail("新增失败"); |
||||
|
} |
||||
|
/** |
||||
|
* 巡查区域-禁用/启用 |
||||
|
* |
||||
|
* @param patrolAreas |
||||
|
* @return |
||||
|
*/ |
||||
|
@RequestMapping(value = "/isDisable", method = {RequestMethod.PUT,RequestMethod.POST}) |
||||
|
public R<?> isDisable(@RequestBody BusinessPatrolAreas patrolAreas) { |
||||
|
boolean flag = patrolAreasService.updateById(patrolAreas); |
||||
|
if(flag){ |
||||
|
return R.ok("修改成功!"); |
||||
|
} |
||||
|
return R.fail("操作失败"); |
||||
|
} |
||||
|
/** |
||||
|
* 巡查区域-删除 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return |
||||
|
*/ |
||||
|
@DeleteMapping(value = "/delete") |
||||
|
public R<?> delete(String id) { |
||||
|
boolean flag = patrolAreasService.removeById(id); |
||||
|
if(flag){ |
||||
|
List<BusinessPatrolAreasUser> patrolAreasUsersDels = patrolAreasUserService.listPatrolAreasUserByAreaId(id); |
||||
|
List<BusinessPatrolAreasPoints> patrolAreasPointsDels = patrolAreasPointsService.listPatrolAreasPointByAreaId(id); |
||||
|
patrolAreasUserService.removeByIds(patrolAreasUsersDels); |
||||
|
patrolAreasPointsService.removeByIds(patrolAreasPointsDels); |
||||
|
} |
||||
|
if(flag){ |
||||
|
return R.ok("删除成功!"); |
||||
|
} |
||||
|
return R.fail("删除失败!"); |
||||
|
} |
||||
|
/** |
||||
|
* 导出excel |
||||
|
* |
||||
|
* @param request |
||||
|
* @param patrolAreas |
||||
|
*/ |
||||
|
@RequestMapping(value = "/exportXls") |
||||
|
public ModelAndView exportXls(BusinessPatrolAreas patrolAreas, HttpServletRequest request) { |
||||
|
//Step.2 AutoPoi 导出Excel
|
||||
|
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); |
||||
|
//update-begin--Author:kangxiaolin Date:20180825 for:[03]用户导出,如果选择数据则只导出相关数据--------------------
|
||||
|
// String selections = request.getParameter("selections");
|
||||
|
// if(!oConvertUtils.isEmpty(selections)){
|
||||
|
// queryWrapper.in("id",selections.split(","));
|
||||
|
// }
|
||||
|
//update-end--Author:kangxiaolin Date:20180825 for:[03]用户导出,如果选择数据则只导出相关数据----------------------
|
||||
|
List<BusinessPatrolAreas> pageList = patrolAreasService.exportXls(patrolAreas); |
||||
|
|
||||
|
//导出文件名称
|
||||
|
mv.addObject(NormalExcelConstants.FILE_NAME, "用户列表"); |
||||
|
mv.addObject(NormalExcelConstants.CLASS, BusinessPatrolAreas.class); |
||||
|
LoginUser user = LoginHelper.getLoginUser(); |
||||
|
ExportParams exportParams = new ExportParams("用户列表数据", "导出人:"+user.getNickname(), "导出信息"); |
||||
|
exportParams.setImageBasePath(upLoadPath); |
||||
|
mv.addObject(NormalExcelConstants.PARAMS, exportParams); |
||||
|
mv.addObject(NormalExcelConstants.DATA_LIST, pageList); |
||||
|
return mv; |
||||
|
} |
||||
|
} |
@ -0,0 +1,74 @@ |
|||||
|
package org.dromara.business.domain; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
import lombok.experimental.Accessors; |
||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity; |
||||
|
import org.jeecgframework.poi.excel.annotation.Excel; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description: 巡查区域 |
||||
|
*/ |
||||
|
@Data |
||||
|
@TableName("business_patrol_areas") |
||||
|
@EqualsAndHashCode(callSuper = false) |
||||
|
@Accessors(chain = true) |
||||
|
public class BusinessPatrolAreas extends BaseEntity { |
||||
|
|
||||
|
/** |
||||
|
* ID |
||||
|
*/ |
||||
|
@TableId(type = IdType.ASSIGN_ID) |
||||
|
private String id; |
||||
|
|
||||
|
/**区域名称*/ |
||||
|
@Excel(name = "区域名称", width = 15) |
||||
|
private String name; |
||||
|
/**区域编号*/ |
||||
|
@Excel(name = "区域编号", width = 15) |
||||
|
private String number; |
||||
|
/**所属乡镇id*/ |
||||
|
@Excel(name = "所属乡镇id", width = 15) |
||||
|
private String deptId; |
||||
|
|
||||
|
/**所属乡镇id*/ |
||||
|
@Excel(name = "所属乡镇名称", width = 15) |
||||
|
@TableField(exist = false) |
||||
|
private String deptName; |
||||
|
|
||||
|
@Excel(name = "所属乡镇ids", width = 15) |
||||
|
private String deptIds; |
||||
|
|
||||
|
@Excel(name = "平台类型", width = 15) |
||||
|
private String platformType; |
||||
|
|
||||
|
/**分管领导所属乡镇id**/ |
||||
|
private String leaderDeptId; |
||||
|
|
||||
|
/**用户id**/ |
||||
|
private String userId; |
||||
|
|
||||
|
/**用户姓名**/ |
||||
|
private String userName; |
||||
|
|
||||
|
/**是否禁用:0:禁用 1:启用**/ |
||||
|
private Integer isDisable; |
||||
|
|
||||
|
/**巡查区域人员信息集合**/ |
||||
|
@TableField(exist = false) |
||||
|
private List<BusinessPatrolAreasUser> patrolAreasUsers = new ArrayList<>(); |
||||
|
/**巡查区域平台类型集合**/ |
||||
|
@TableField(exist = false) |
||||
|
private List<String> patrolAreasIdList = new ArrayList<>(); |
||||
|
/**巡查区域坐标集合**/ |
||||
|
@TableField(exist = false) |
||||
|
private List<BusinessPatrolAreasPoints> patrolAreasPoints = new ArrayList<>(); |
||||
|
|
||||
|
} |
@ -0,0 +1,54 @@ |
|||||
|
package org.dromara.business.domain; |
||||
|
|
||||
|
import com.alibaba.excel.annotation.ExcelProperty; |
||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
import lombok.experimental.Accessors; |
||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity; |
||||
|
|
||||
|
/** |
||||
|
* Description: <br/> |
||||
|
* date: 2024/8/12$ 17:17$<br/> |
||||
|
* |
||||
|
* @author: yq |
||||
|
*/ |
||||
|
|
||||
|
@Data |
||||
|
@TableName("business_patrol_areas_platform_info") |
||||
|
@EqualsAndHashCode(callSuper = false) |
||||
|
@Accessors(chain = true) |
||||
|
public class BusinessPatrolAreasPlatform extends BaseEntity { |
||||
|
|
||||
|
/** |
||||
|
* ID |
||||
|
*/ |
||||
|
@TableId(type = IdType.ASSIGN_ID) |
||||
|
private String id; |
||||
|
|
||||
|
@ExcelProperty(value = "patrol_areas_id") |
||||
|
private String patrolAreasId; |
||||
|
/**区域名称*/ |
||||
|
@ExcelProperty(value = "平台名称") |
||||
|
private String platformName; |
||||
|
|
||||
|
@ExcelProperty(value = "平台类型") |
||||
|
private String platformType; |
||||
|
|
||||
|
/**区域编号*/ |
||||
|
@ExcelProperty(value = "平台图片") |
||||
|
private String imageUrl; |
||||
|
|
||||
|
/** |
||||
|
* 排序 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "排序") |
||||
|
private Integer sort; |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,42 @@ |
|||||
|
package org.dromara.business.domain; |
||||
|
|
||||
|
import com.alibaba.excel.annotation.ExcelProperty; |
||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
import lombok.experimental.Accessors; |
||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
/** |
||||
|
* @Description: 巡查区域坐标 |
||||
|
*/ |
||||
|
@Data |
||||
|
@TableName("business_patrol_area_points") |
||||
|
@EqualsAndHashCode(callSuper = false) |
||||
|
@Accessors(chain = true) |
||||
|
public class BusinessPatrolAreasPoints extends BaseEntity { |
||||
|
|
||||
|
/** |
||||
|
* ID |
||||
|
*/ |
||||
|
@TableId(type = IdType.ASSIGN_ID) |
||||
|
private String id; |
||||
|
|
||||
|
/**areaId*/ |
||||
|
@ExcelProperty(value = "areaId") |
||||
|
private String areaId; |
||||
|
/**纬度*/ |
||||
|
@ExcelProperty(value = "纬度") |
||||
|
private BigDecimal lat; |
||||
|
/**经度*/ |
||||
|
@ExcelProperty(value = "经度") |
||||
|
private BigDecimal lng; |
||||
|
/**序号*/ |
||||
|
@ExcelProperty(value = "序号") |
||||
|
private Integer sortNumber; |
||||
|
|
||||
|
} |
@ -0,0 +1,37 @@ |
|||||
|
package org.dromara.business.domain; |
||||
|
|
||||
|
import com.alibaba.excel.annotation.ExcelProperty; |
||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
import lombok.experimental.Accessors; |
||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity; |
||||
|
|
||||
|
/** |
||||
|
* @Description: 巡查区域人员信息 |
||||
|
*/ |
||||
|
@Data |
||||
|
@TableName("business_patrol_area_users") |
||||
|
@EqualsAndHashCode(callSuper = false) |
||||
|
@Accessors(chain = true) |
||||
|
public class BusinessPatrolAreasUser extends BaseEntity { |
||||
|
|
||||
|
/** |
||||
|
* ID |
||||
|
*/ |
||||
|
@TableId(type = IdType.ASSIGN_ID) |
||||
|
private String id; |
||||
|
|
||||
|
/**巡查区域id*/ |
||||
|
@ExcelProperty(value = "巡查区域id") |
||||
|
private String areaId; |
||||
|
/**巡查人员id*/ |
||||
|
@ExcelProperty(value = "巡查人员id") |
||||
|
private String userId; |
||||
|
/**巡查人员姓名*/ |
||||
|
@ExcelProperty(value = "巡查人员姓名") |
||||
|
private String realname; |
||||
|
|
||||
|
} |
@ -0,0 +1,54 @@ |
|||||
|
|
||||
|
package org.dromara.business.domain; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
import lombok.experimental.Accessors; |
||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.HashMap; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @Description: 平台信息 |
||||
|
*/ |
||||
|
@Data |
||||
|
@TableName("business_platform_info") |
||||
|
@EqualsAndHashCode(callSuper = false) |
||||
|
@Accessors(chain = true) |
||||
|
public class BusinessPlatformInfo extends BaseEntity { |
||||
|
|
||||
|
/** |
||||
|
* ID |
||||
|
*/ |
||||
|
@TableId(type = IdType.ASSIGN_ID) |
||||
|
private String id; |
||||
|
|
||||
|
/**设备昵称**/ |
||||
|
private String platformName; |
||||
|
|
||||
|
/**设备类型**/ |
||||
|
private String platformType; |
||||
|
|
||||
|
/**平台图片**/ |
||||
|
private String imageUrl; |
||||
|
|
||||
|
/**app图片**/ |
||||
|
private String imageAppUrl; |
||||
|
|
||||
|
/**排序**/ |
||||
|
private Integer sort; |
||||
|
/**路由**/ |
||||
|
private String routes; |
||||
|
/**平台识别类型集合**/ |
||||
|
@TableField(exist = false) |
||||
|
private List<BusinessPlatformInfoCode> platformInfoCodes = new ArrayList<>(); |
||||
|
@TableField(exist = false) |
||||
|
private Map<String,Object> total = new HashMap<>(); |
||||
|
} |
@ -0,0 +1,32 @@ |
|||||
|
|
||||
|
package org.dromara.business.domain; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
import lombok.experimental.Accessors; |
||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity; |
||||
|
|
||||
|
/** |
||||
|
* @Description: 平台信息 |
||||
|
*/ |
||||
|
@Data |
||||
|
@TableName("business_platform_info_code") |
||||
|
@EqualsAndHashCode(callSuper = false) |
||||
|
@Accessors(chain = true) |
||||
|
public class BusinessPlatformInfoCode extends BaseEntity { |
||||
|
|
||||
|
/** |
||||
|
* ID |
||||
|
*/ |
||||
|
@TableId(type = IdType.ASSIGN_ID) |
||||
|
private String id; |
||||
|
/**平台对象id**/ |
||||
|
private String platformInfoId; |
||||
|
/**识别内容**/ |
||||
|
private String codeName; |
||||
|
/**识别类型**/ |
||||
|
private String codeType; |
||||
|
} |
@ -0,0 +1,44 @@ |
|||||
|
package org.dromara.business.domain.bo; |
||||
|
|
||||
|
|
||||
|
import io.github.linpeilie.annotations.AutoMapper; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
import org.dromara.business.domain.BusinessAlert; |
||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = true) |
||||
|
@AutoMapper(target = BusinessAlert.class, reverseConvertGenerate = false) |
||||
|
public class BusinessPatrolAreasBo extends BaseEntity { |
||||
|
|
||||
|
/** |
||||
|
* 所属乡镇id |
||||
|
*/ |
||||
|
private String deptId; |
||||
|
|
||||
|
/** |
||||
|
* 所属乡镇名称 |
||||
|
*/ |
||||
|
private String deptName; |
||||
|
|
||||
|
/** |
||||
|
* 预警类型 |
||||
|
*/ |
||||
|
private String platformType; |
||||
|
|
||||
|
/** |
||||
|
* 是否禁用:0:禁用 1:启用 |
||||
|
*/ |
||||
|
private Integer isDisable; |
||||
|
|
||||
|
/** |
||||
|
* 下级所有部门id |
||||
|
*/ |
||||
|
private List<String> deptIds = new ArrayList<>(); |
||||
|
|
||||
|
private String name; |
||||
|
} |
@ -0,0 +1,11 @@ |
|||||
|
package org.dromara.business.domain.bo; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class BusinessPlatformInfoBo { |
||||
|
|
||||
|
/**查询条件**/ |
||||
|
private String search; |
||||
|
|
||||
|
} |
@ -0,0 +1,22 @@ |
|||||
|
package org.dromara.business.mapper; |
||||
|
|
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
import org.dromara.business.domain.BusinessPatrolAreas; |
||||
|
import org.dromara.business.domain.bo.BusinessPatrolAreasBo; |
||||
|
|
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description: 巡查区域 |
||||
|
*/ |
||||
|
public interface BusinessPatrolAreasMapper extends BaseMapper<BusinessPatrolAreas> { |
||||
|
|
||||
|
IPage<BusinessPatrolAreas> listPatrolAreas(Page<BusinessPatrolAreas> page, @Param("condition") BusinessPatrolAreasBo patrolAreasBo, @Param("deptIds") List<String> deptIds); |
||||
|
|
||||
|
List<BusinessPatrolAreas> listPatrolAreas(@Param("condition") BusinessPatrolAreasBo patrolAreasBo, @Param("deptIds") List<String> deptIds); |
||||
|
} |
@ -0,0 +1,10 @@ |
|||||
|
package org.dromara.business.mapper; |
||||
|
|
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import org.dromara.business.domain.BusinessPatrolAreasPlatform; |
||||
|
|
||||
|
|
||||
|
public interface BusinessPatrolAreasPlatformMapper extends BaseMapper<BusinessPatrolAreasPlatform> { |
||||
|
|
||||
|
} |
@ -0,0 +1,16 @@ |
|||||
|
package org.dromara.business.mapper; |
||||
|
|
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
import org.dromara.business.domain.BusinessPatrolAreasPoints; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description: 巡查区域坐标 |
||||
|
*/ |
||||
|
public interface BusinessPatrolAreasPointsMapper extends BaseMapper<BusinessPatrolAreasPoints> { |
||||
|
|
||||
|
List<BusinessPatrolAreasPoints> listPatrolAreasPointByAreaId(@Param("areaId") String areaId); |
||||
|
} |
@ -0,0 +1,16 @@ |
|||||
|
package org.dromara.business.mapper; |
||||
|
|
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
import org.dromara.business.domain.BusinessPatrolAreasUser; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description: 巡查区域人员信息 |
||||
|
*/ |
||||
|
public interface BusinessPatrolAreasUserMapper extends BaseMapper<BusinessPatrolAreasUser> { |
||||
|
|
||||
|
List<BusinessPatrolAreasUser> listPatrolAreasUserByAreaId(@Param("areaId") String areaId); |
||||
|
} |
@ -0,0 +1,17 @@ |
|||||
|
package org.dromara.business.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
import org.dromara.business.domain.BusinessPlatformInfoCode; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @author sean.zhou |
||||
|
* @date 2021/11/10 |
||||
|
* @version 0.1 |
||||
|
*/ |
||||
|
public interface BusinessPlatformInfoCodeMapper extends BaseMapper<BusinessPlatformInfoCode> { |
||||
|
List<BusinessPlatformInfoCode> listPlatformInfoCodeByPlatformInfoId(@Param("platformInfoId") String platformInfoId); |
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
package org.dromara.business.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
import org.dromara.business.domain.BusinessPlatformInfo; |
||||
|
import org.dromara.business.domain.bo.BusinessPlatformInfoBo; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @author sean.zhou |
||||
|
* @date 2021/11/10 |
||||
|
* @version 0.1 |
||||
|
*/ |
||||
|
public interface BusinessPlatformInfoMapper extends BaseMapper<BusinessPlatformInfo> { |
||||
|
IPage<BusinessPlatformInfo> listPlatformInfo(Page page, @Param("condition") BusinessPlatformInfoBo platformInfoBo); |
||||
|
|
||||
|
List<BusinessPlatformInfo> listPlatformInfo(@Param("condition")BusinessPlatformInfoBo platformInfoBo); |
||||
|
|
||||
|
} |
@ -0,0 +1,13 @@ |
|||||
|
package org.dromara.business.service; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
import org.dromara.business.domain.BusinessPatrolAreasPoints; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description: 巡查区域坐标 |
||||
|
*/ |
||||
|
public interface IBusinessPatrolAreasPointsService extends IService<BusinessPatrolAreasPoints> { |
||||
|
List<BusinessPatrolAreasPoints> listPatrolAreasPointByAreaId(String areaId); |
||||
|
} |
@ -0,0 +1,25 @@ |
|||||
|
package org.dromara.business.service; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
import org.dromara.business.domain.BusinessPatrolAreas; |
||||
|
import org.dromara.business.domain.bo.BusinessPatrolAreasBo; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description: 巡查区域 |
||||
|
*/ |
||||
|
public interface IBusinessPatrolAreasService extends IService<BusinessPatrolAreas> { |
||||
|
IPage<BusinessPatrolAreas> pagePatrolAreas(Page page, @Param("condition") BusinessPatrolAreasBo patrolAreasBo); |
||||
|
|
||||
|
List<BusinessPatrolAreas> listPatrolAreas(@Param("condition") BusinessPatrolAreasBo patrolAreasBo); |
||||
|
|
||||
|
boolean addPatrolAreas(BusinessPatrolAreas patrolAreas); |
||||
|
|
||||
|
boolean updatePatrolAreas(BusinessPatrolAreas patrolAreas); |
||||
|
|
||||
|
List<BusinessPatrolAreas> exportXls(BusinessPatrolAreas patrolAreas); |
||||
|
} |
@ -0,0 +1,13 @@ |
|||||
|
package org.dromara.business.service; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
import org.dromara.business.domain.BusinessPatrolAreasUser; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description: 巡查区域人员信息 |
||||
|
*/ |
||||
|
public interface IBusinessPatrolAreasUserService extends IService<BusinessPatrolAreasUser> { |
||||
|
List<BusinessPatrolAreasUser> listPatrolAreasUserByAreaId(String areaId); |
||||
|
} |
@ -0,0 +1,9 @@ |
|||||
|
package org.dromara.business.service; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
import org.dromara.business.domain.BusinessPlatformInfo; |
||||
|
|
||||
|
public interface IBusinessPlatformInfoService extends IService<BusinessPlatformInfo> { |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
package org.dromara.business.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import org.dromara.business.domain.BusinessPatrolAreasPoints; |
||||
|
import org.dromara.business.mapper.BusinessPatrolAreasPointsMapper; |
||||
|
import org.dromara.business.service.IBusinessPatrolAreasPointsService; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description: 巡查区域坐标 |
||||
|
*/ |
||||
|
@RequiredArgsConstructor |
||||
|
@Service |
||||
|
public class BusinessPatrolAreasPointsServiceImpl extends ServiceImpl<BusinessPatrolAreasPointsMapper, BusinessPatrolAreasPoints> implements IBusinessPatrolAreasPointsService { |
||||
|
|
||||
|
@Override |
||||
|
public List<BusinessPatrolAreasPoints> listPatrolAreasPointByAreaId(String areaId) { |
||||
|
return baseMapper.listPatrolAreasPointByAreaId(areaId); |
||||
|
} |
||||
|
} |
@ -0,0 +1,203 @@ |
|||||
|
package org.dromara.business.service.impl; |
||||
|
|
||||
|
import cn.hutool.core.util.ObjectUtil; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import org.apache.commons.lang.StringUtils; |
||||
|
import org.apache.dubbo.config.annotation.DubboReference; |
||||
|
import org.dromara.business.domain.*; |
||||
|
import org.dromara.business.domain.bo.BusinessPatrolAreasBo; |
||||
|
import org.dromara.business.mapper.BusinessPatrolAreasMapper; |
||||
|
import org.dromara.business.mapper.BusinessPatrolAreasPlatformMapper; |
||||
|
import org.dromara.business.service.IBusinessPatrolAreasPointsService; |
||||
|
import org.dromara.business.service.IBusinessPatrolAreasService; |
||||
|
import org.dromara.business.service.IBusinessPatrolAreasUserService; |
||||
|
import org.dromara.business.service.IBusinessPlatformInfoService; |
||||
|
import org.dromara.common.core.exception.ServiceException; |
||||
|
import org.dromara.common.satoken.utils.LoginHelper; |
||||
|
import org.dromara.system.api.RemoteDeptService; |
||||
|
import org.dromara.system.api.RemoteUserService; |
||||
|
import org.dromara.system.api.domain.vo.RemoteDeptVo; |
||||
|
import org.dromara.system.api.model.LoginUser; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
import java.util.Set; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
/** |
||||
|
* @Description: 巡查区域 |
||||
|
*/ |
||||
|
@RequiredArgsConstructor |
||||
|
@Service |
||||
|
public class BusinessPatrolAreasServiceImpl extends ServiceImpl<BusinessPatrolAreasMapper, BusinessPatrolAreas> implements IBusinessPatrolAreasService { |
||||
|
|
||||
|
|
||||
|
private final IBusinessPatrolAreasPointsService patrolAreasPointsService; |
||||
|
|
||||
|
private final IBusinessPatrolAreasUserService patrolAreasUserService; |
||||
|
|
||||
|
private final IBusinessPlatformInfoService platformInfoService; |
||||
|
|
||||
|
private final BusinessPatrolAreasPlatformMapper patrolAreasPlatformInfoMapper; |
||||
|
|
||||
|
@DubboReference |
||||
|
private RemoteUserService remoteUserService; |
||||
|
@DubboReference |
||||
|
private RemoteDeptService remoteDeptService; |
||||
|
|
||||
|
@Override |
||||
|
public IPage<BusinessPatrolAreas> pagePatrolAreas(Page page, BusinessPatrolAreasBo patrolAreasBo) { |
||||
|
LoginUser user = LoginHelper.getLoginUser(); |
||||
|
List<String> deptIds = new ArrayList<>(); |
||||
|
String departIds = null; |
||||
|
if(StringUtils.isBlank(patrolAreasBo.getDeptId())){ |
||||
|
RemoteDeptVo remoteDeptVo = remoteDeptService.selectDeptById(user.getDeptId()); |
||||
|
if(ObjectUtil.isEmpty(remoteDeptVo)){ |
||||
|
throw new ServiceException("部门不存在"); |
||||
|
} |
||||
|
departIds = user.getDeptId() + ""; |
||||
|
}else { |
||||
|
departIds = patrolAreasBo.getDeptId(); |
||||
|
} |
||||
|
// if(oConvertUtils.isNotEmpty(user.getUserIdentity()) && user.getUserIdentity().equals( CommonConstant.USER_IDENTITY_2 )){
|
||||
|
// if(StringUtils.isNotBlank(departIds)){
|
||||
|
// deptIds.addAll(commonAPI.getMySubDepIdsStatusByDepId(departIds));
|
||||
|
// }
|
||||
|
// }else {
|
||||
|
// deptIds.add(departIds);
|
||||
|
// }
|
||||
|
deptIds.add(departIds); |
||||
|
IPage<BusinessPatrolAreas> iPage = this.baseMapper.listPatrolAreas(page, patrolAreasBo, deptIds); |
||||
|
List<BusinessPatrolAreas> records = page.getRecords(); |
||||
|
if(!records.isEmpty()){ |
||||
|
records.forEach(p->{ |
||||
|
QueryWrapper<BusinessPatrolAreasPlatform> queryWrapper = new QueryWrapper<BusinessPatrolAreasPlatform>(); |
||||
|
queryWrapper.eq("patrol_areas_id",p.getId()); |
||||
|
List<String> collect = patrolAreasPlatformInfoMapper.selectList(queryWrapper).stream().map(BusinessPatrolAreasPlatform::getPlatformType).collect(Collectors.toList()); |
||||
|
p.setPatrolAreasIdList(collect); |
||||
|
}); |
||||
|
} |
||||
|
page.setRecords(records); |
||||
|
return iPage; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<BusinessPatrolAreas> listPatrolAreas(BusinessPatrolAreasBo patrolAreasBo) { |
||||
|
return this.baseMapper.listPatrolAreas(patrolAreasBo, patrolAreasBo.getDeptIds()); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public boolean addPatrolAreas(BusinessPatrolAreas patrolAreas) { |
||||
|
patrolAreas.setUserName(remoteUserService.selectUserNameById(Long.valueOf(patrolAreas.getUserId()))); |
||||
|
boolean flag = this.save(patrolAreas); |
||||
|
List<BusinessPatrolAreasUser> patrolAreasUsers = patrolAreas.getPatrolAreasUsers(); |
||||
|
patrolAreasUsers.stream().forEach(item->{ |
||||
|
item.setAreaId(patrolAreas.getId()); |
||||
|
item.setRealname(remoteUserService.selectUserNameById(Long.valueOf(patrolAreas.getUserId()))); |
||||
|
}); |
||||
|
List<String> patrolAreasIdList = patrolAreas.getPatrolAreasIdList(); |
||||
|
if(!patrolAreasIdList.isEmpty()){ |
||||
|
patrolAreasIdList.forEach(item->{ |
||||
|
BusinessPlatformInfo platformInfo = platformInfoService.lambdaQuery().eq(BusinessPlatformInfo::getPlatformType,item).one(); |
||||
|
BusinessPatrolAreasPlatform patrolAreasPlatformInfo =new BusinessPatrolAreasPlatform(); |
||||
|
patrolAreasPlatformInfo.setPatrolAreasId(patrolAreas.getId()); |
||||
|
patrolAreasPlatformInfo.setPlatformName(platformInfo.getPlatformName()); |
||||
|
patrolAreasPlatformInfo.setPlatformType(platformInfo.getPlatformType()); |
||||
|
patrolAreasPlatformInfo.setSort(platformInfo.getSort()); |
||||
|
patrolAreasPlatformInfo.setImageUrl(platformInfo.getImageUrl()); |
||||
|
patrolAreasPlatformInfoMapper.insert(patrolAreasPlatformInfo); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
if(CollectionUtils.isNotEmpty(patrolAreasUsers)){ |
||||
|
flag = patrolAreasUserService.saveBatch(patrolAreasUsers,500); |
||||
|
} |
||||
|
List<BusinessPatrolAreasPoints> patrolAreasPoints = patrolAreas.getPatrolAreasPoints(); |
||||
|
patrolAreasPoints.stream().forEach(item->{ |
||||
|
item.setAreaId(patrolAreas.getId()); |
||||
|
}); |
||||
|
if(CollectionUtils.isNotEmpty(patrolAreasPoints)) { |
||||
|
flag = patrolAreasPointsService.saveBatch(patrolAreasPoints, 500); |
||||
|
} |
||||
|
return flag; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public boolean updatePatrolAreas(BusinessPatrolAreas patrolAreas) { |
||||
|
patrolAreas.setUserName(remoteUserService.selectUserNameById(Long.valueOf(patrolAreas.getUserId()))); |
||||
|
boolean flag = this.updateById(patrolAreas); |
||||
|
List<BusinessPatrolAreasUser> patrolAreasUsersDels = patrolAreasUserService.listPatrolAreasUserByAreaId(patrolAreas.getId()); |
||||
|
List<BusinessPatrolAreasPoints> patrolAreasPointsDels = patrolAreasPointsService.listPatrolAreasPointByAreaId(patrolAreas.getId()); |
||||
|
patrolAreasUserService.removeByIds(patrolAreasUsersDels); |
||||
|
patrolAreasPointsService.removeByIds(patrolAreasPointsDels); |
||||
|
//先删除后添加
|
||||
|
QueryWrapper<BusinessPatrolAreasPlatform> queryWrapper = new QueryWrapper<BusinessPatrolAreasPlatform>(); |
||||
|
queryWrapper.eq("patrol_areas_id",patrolAreas.getId()); |
||||
|
Set<String> stringSet = patrolAreasPlatformInfoMapper.selectList(queryWrapper).stream().map(BusinessPatrolAreasPlatform::getId).collect(Collectors.toSet()); |
||||
|
if(!stringSet.isEmpty()){ |
||||
|
patrolAreasPlatformInfoMapper.deleteBatchIds(stringSet); |
||||
|
} |
||||
|
List<String> patrolAreasIdList = patrolAreas.getPatrolAreasIdList(); |
||||
|
|
||||
|
if(!patrolAreasIdList.isEmpty()){ |
||||
|
patrolAreasIdList.forEach(item->{ |
||||
|
BusinessPlatformInfo platformInfo = platformInfoService.lambdaQuery().eq(BusinessPlatformInfo::getPlatformType,item).one(); |
||||
|
BusinessPatrolAreasPlatform patrolAreasPlatformInfo =new BusinessPatrolAreasPlatform(); |
||||
|
patrolAreasPlatformInfo.setPatrolAreasId(patrolAreas.getId()); |
||||
|
patrolAreasPlatformInfo.setPlatformName(platformInfo.getPlatformName()); |
||||
|
patrolAreasPlatformInfo.setPlatformType(platformInfo.getPlatformType()); |
||||
|
patrolAreasPlatformInfo.setSort(platformInfo.getSort()); |
||||
|
patrolAreasPlatformInfo.setImageUrl(platformInfo.getImageUrl()); |
||||
|
patrolAreasPlatformInfoMapper.insert(patrolAreasPlatformInfo); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
List<BusinessPatrolAreasUser> patrolAreasUsers = patrolAreas.getPatrolAreasUsers(); |
||||
|
patrolAreasUsers.stream().forEach(item->{ |
||||
|
item.setAreaId(patrolAreas.getId()); |
||||
|
}); |
||||
|
if(CollectionUtils.isNotEmpty(patrolAreasUsers)){ |
||||
|
flag = patrolAreasUserService.saveBatch(patrolAreasUsers,500); |
||||
|
} |
||||
|
List<BusinessPatrolAreasPoints> patrolAreasPoints = patrolAreas.getPatrolAreasPoints(); |
||||
|
patrolAreasPoints.stream().forEach(item->{ |
||||
|
item.setAreaId(patrolAreas.getId()); |
||||
|
}); |
||||
|
if(CollectionUtils.isNotEmpty(patrolAreasPoints)) { |
||||
|
flag = patrolAreasPointsService.saveBatch(patrolAreasPoints, 500); |
||||
|
} |
||||
|
return flag; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<BusinessPatrolAreas> exportXls(BusinessPatrolAreas patrolAreas) { |
||||
|
LambdaQueryWrapper<BusinessPatrolAreas> wrapper = buildWrapper(patrolAreas); |
||||
|
|
||||
|
return this.list(wrapper); |
||||
|
} |
||||
|
|
||||
|
private LambdaQueryWrapper<BusinessPatrolAreas> buildWrapper(BusinessPatrolAreas patrolAreas) { |
||||
|
LambdaQueryWrapper<BusinessPatrolAreas> wrapper = new LambdaQueryWrapper<>(); |
||||
|
|
||||
|
if (ObjectUtil.isNotEmpty(patrolAreas.getName())){ |
||||
|
wrapper.eq(BusinessPatrolAreas::getName, patrolAreas.getName()); |
||||
|
} |
||||
|
|
||||
|
if (ObjectUtil.isNotEmpty(patrolAreas.getDeptId())){ |
||||
|
wrapper.eq(BusinessPatrolAreas::getDeptId, patrolAreas.getDeptId()); |
||||
|
} |
||||
|
|
||||
|
return wrapper; |
||||
|
} |
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
package org.dromara.business.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import org.dromara.business.domain.BusinessPatrolAreasUser; |
||||
|
import org.dromara.business.mapper.BusinessPatrolAreasUserMapper; |
||||
|
import org.dromara.business.service.IBusinessPatrolAreasUserService; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description: 巡查区域人员信息 |
||||
|
*/ |
||||
|
@RequiredArgsConstructor |
||||
|
@Service |
||||
|
public class BusinessPatrolAreasUserServiceImpl extends ServiceImpl<BusinessPatrolAreasUserMapper, BusinessPatrolAreasUser> implements IBusinessPatrolAreasUserService { |
||||
|
|
||||
|
@Override |
||||
|
public List<BusinessPatrolAreasUser> listPatrolAreasUserByAreaId(String areaId) { |
||||
|
return baseMapper.listPatrolAreasUserByAreaId(areaId); |
||||
|
} |
||||
|
} |
@ -0,0 +1,17 @@ |
|||||
|
package org.dromara.business.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
import org.dromara.business.domain.BusinessPlatformInfo; |
||||
|
import org.dromara.business.mapper.BusinessPlatformInfoMapper; |
||||
|
import org.dromara.business.service.IBusinessPlatformInfoService; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
**/ |
||||
|
@Service |
||||
|
public class BusinessPlatformInfoServiceImpl extends ServiceImpl<BusinessPlatformInfoMapper, BusinessPlatformInfo> implements IBusinessPlatformInfoService { |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,55 @@ |
|||||
|
<?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="org.dromara.business.mapper.BusinessPatrolAreasMapper"> |
||||
|
<resultMap id="listPatrolAreasMap" type="org.dromara.business.domain.BusinessPatrolAreas"> |
||||
|
<result column="id" property="id" jdbcType="VARCHAR"/> |
||||
|
<result column="name" property="name" jdbcType="VARCHAR"/> |
||||
|
<result column="number" property="number" jdbcType="VARCHAR"/> |
||||
|
<result column="dept_id" property="deptId" jdbcType="VARCHAR"/> |
||||
|
<result column="dept_ids" property="deptIds" jdbcType="VARCHAR"/> |
||||
|
<result column="platform_type" property="platformType" jdbcType="VARCHAR"/> |
||||
|
<result column="dept_name" property="deptName" jdbcType="VARCHAR"/> |
||||
|
<result column="leader_dept_id" property="leaderDeptId" jdbcType="VARCHAR"/> |
||||
|
<result column="user_id" property="userId" jdbcType="VARCHAR"/> |
||||
|
<result column="user_name" property="userName" jdbcType="VARCHAR"/> |
||||
|
<result column="create_by" property="createBy" jdbcType="VARCHAR"/> |
||||
|
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/> |
||||
|
<collection column="{areaId=id}" |
||||
|
property="patrolAreasUsers" ofType="org.dromara.business.domain.BusinessPatrolAreasUser" |
||||
|
javaType="java.util.ArrayList" |
||||
|
select="org.dromara.business.mapper.BusinessPatrolAreasUserMapper.listPatrolAreasUserByAreaId"/> |
||||
|
<collection column="{areaId=id}" |
||||
|
property="patrolAreasPoints" ofType="org.dromara.business.domain.BusinessPatrolAreasPoints" |
||||
|
javaType="java.util.ArrayList" |
||||
|
select="org.dromara.business.mapper.BusinessPatrolAreasPointsMapper.listPatrolAreasPointByAreaId"/> |
||||
|
</resultMap> |
||||
|
<select id="listPatrolAreas" resultMap="listPatrolAreasMap"> |
||||
|
select pa.*,sd.dept_name as dept_name from business_patrol_areas pa |
||||
|
LEFT JOIN dk_cloud.sys_dept sd ON pa.dept_id = sd.dept_id |
||||
|
where |
||||
|
pa.del_flag = 0 |
||||
|
<if test="deptIds.size > 0"> |
||||
|
and pa.dept_id in |
||||
|
<foreach item="id" collection="deptIds" open="(" separator="," close=")"> |
||||
|
#{id} |
||||
|
</foreach> |
||||
|
</if> |
||||
|
<if test="condition.name != null and condition.name != ''"> |
||||
|
and pa.name LIKE concat(concat('%',#{condition.name}),'%') |
||||
|
</if> |
||||
|
<if test="condition.platformType != null and condition.platformType != ''"> |
||||
|
AND pa.id IN ( |
||||
|
SELECT api.patrol_areas_id |
||||
|
FROM business_patrol_areas_platform_info api |
||||
|
|
||||
|
WHERE api.platform_type = 'plough' |
||||
|
) |
||||
|
</if> |
||||
|
<if test="condition.name != null and condition.name != ''"> |
||||
|
and pa.name LIKE concat(concat('%',#{condition.name}),'%') |
||||
|
</if> |
||||
|
<if test="condition.isDisable != null and condition.isDisable != ''"> |
||||
|
and pa.is_disable =#{condition.isDisable} |
||||
|
</if> |
||||
|
</select> |
||||
|
</mapper> |
@ -0,0 +1,5 @@ |
|||||
|
<?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="org.dromara.business.mapper.BusinessPatrolAreasPlatformMapper"> |
||||
|
|
||||
|
</mapper> |
@ -0,0 +1,11 @@ |
|||||
|
<?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="org.dromara.business.mapper.BusinessPatrolAreasPointsMapper"> |
||||
|
<select id="listPatrolAreasPointByAreaId" resultType="org.dromara.business.domain.BusinessPatrolAreasPoints"> |
||||
|
select * from business_patrol_area_points po |
||||
|
where |
||||
|
po.del_flag = 0 |
||||
|
and po.area_id = #{areaId} |
||||
|
order by po.sort_number asc |
||||
|
</select> |
||||
|
</mapper> |
@ -0,0 +1,9 @@ |
|||||
|
<?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="org.dromara.business.mapper.BusinessPatrolAreasUserMapper"> |
||||
|
<select id="listPatrolAreasUserByAreaId" resultType="org.dromara.business.domain.BusinessPatrolAreasUser"> |
||||
|
select * from business_patrol_area_users au |
||||
|
where au.del_flag = 0 |
||||
|
and au.area_id = #{areaId} |
||||
|
</select> |
||||
|
</mapper> |
@ -0,0 +1,10 @@ |
|||||
|
<?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="org.dromara.business.mapper.BusinessPlatformInfoCodeMapper"> |
||||
|
<select id="listPlatformInfoCodeByPlatformInfoId" resultType="org.dromara.business.domain.BusinessPlatformInfoCode"> |
||||
|
select * from business_platform_info_code |
||||
|
where |
||||
|
del_flag = 0 |
||||
|
and platform_info_id = #{platformInfoId} |
||||
|
</select> |
||||
|
</mapper> |
@ -0,0 +1,31 @@ |
|||||
|
<?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="org.dromara.business.mapper.BusinessPlatformInfoMapper"> |
||||
|
<resultMap id="listPlatformInfoMap" type="org.dromara.business.domain.BusinessPlatformInfo"> |
||||
|
<result column="id" property="id" jdbcType="VARCHAR"/> |
||||
|
<result column="platform_name" property="platformName" jdbcType="VARCHAR"/> |
||||
|
<result column="platform_type" property="platformType" jdbcType="VARCHAR"/> |
||||
|
<result column="image_url" property="imageUrl" jdbcType="VARCHAR"/> |
||||
|
<result column="image_app_url" property="imageAppUrl" jdbcType="VARCHAR"/> |
||||
|
<result column="sort" property="sort"/> |
||||
|
<result column="create_by" property="createBy" jdbcType="VARCHAR"/> |
||||
|
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/> |
||||
|
<collection column="{platformInfoId=id}" |
||||
|
property="platformInfoCodes" ofType="org.dromara.business.domain.BusinessPlatformInfoCode" |
||||
|
javaType="java.util.ArrayList" |
||||
|
select="org.dromara.business.mapper.BusinessPlatformInfoCodeMapper.listPlatformInfoCodeByPlatformInfoId"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
<select id="listPlatformInfo" resultMap="listPlatformInfoMap"> |
||||
|
select * from business_platform_info |
||||
|
where |
||||
|
del_flag = 0 |
||||
|
<if test="condition.search != null and condition.search != ''"> |
||||
|
and (platform_name like concat(concat('%',#{condition.search}),'%') |
||||
|
or platform_type like concat(concat('%',#{condition.search}),'%') |
||||
|
) |
||||
|
</if> |
||||
|
order by sort asc |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
Loading…
Reference in new issue