Commit cfc5e307 by 王力

Merge branch 'dev_mp2jpa0803' into 'develop'

Dev mp2jpa0803

See merge request !324
2 parents ce9530f3 a44aca0c
...@@ -29,7 +29,7 @@ public class BusinessBlockController { ...@@ -29,7 +29,7 @@ public class BusinessBlockController {
*/ */
@GetMapping("/business/service/block/list") @GetMapping("/business/service/block/list")
public Result<?> businessSeverBlocks(@RequestParam String levelType, @RequestParam String levelValue, public Result<?> businessSeverBlocks(@RequestParam String levelType, @RequestParam String levelValue,
@RequestParam long page, @RequestParam long size, @RequestParam int page, @RequestParam int size,
@RequestParam(required = false) String layerId, @RequestParam(required = false) String layerId,
@RequestParam(required = false) String teamId) { @RequestParam(required = false) String teamId) {
Result<?> res = null; Result<?> res = null;
......
...@@ -43,7 +43,7 @@ public class BusinessLayerController { ...@@ -43,7 +43,7 @@ public class BusinessLayerController {
* @return * @return
*/ */
@GetMapping("/business/layer/custom/list") @GetMapping("/business/layer/custom/list")
public Result<?> businessCustomLayers(String levelType, String levelValue, long page, long size) { public Result<?> businessCustomLayers(String levelType, String levelValue, int page, int size) {
// 自定义图层列表 // 自定义图层列表
Result<?> res = null; Result<?> res = null;
try { try {
......
package com.dituhui.pea.order.dao; package com.dituhui.pea.order.dao;
import java.util.List; import com.dituhui.pea.order.entity.MapBlockInfoEntity;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import com.dituhui.pea.order.entity.MapBlockInfoEntity; import java.util.List;
@Repository @Repository
public interface MapBlockInfoDao extends JpaRepository<MapBlockInfoEntity, Integer> { public interface MapBlockInfoDao extends JpaRepository<MapBlockInfoEntity, Integer>, JpaSpecificationExecutor<MapBlockInfoEntity> {
List<MapBlockInfoEntity> findByBlockIdInAndLayerIdIn(List<String> blockIds, List<String> layerIds); List<MapBlockInfoEntity> findByBlockIdInAndLayerIdIn(List<String> blockIds, List<String> layerIds);
......
...@@ -2,10 +2,11 @@ package com.dituhui.pea.order.dao; ...@@ -2,10 +2,11 @@ package com.dituhui.pea.order.dao;
import com.dituhui.pea.order.entity.MapLayerCustomizeEntity; import com.dituhui.pea.order.entity.MapLayerCustomizeEntity;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import java.util.List; import java.util.List;
public interface MapLayerCustomizeDao extends JpaRepository<MapLayerCustomizeEntity, Long> { public interface MapLayerCustomizeDao extends JpaRepository<MapLayerCustomizeEntity, Long>, JpaSpecificationExecutor<MapLayerCustomizeEntity>{
public MapLayerCustomizeEntity findByBranchIdAndLayerIdAndStatus(String branchId, String layerId, int status); public MapLayerCustomizeEntity findByBranchIdAndLayerIdAndStatus(String branchId, String layerId, int status);
......
package com.dituhui.pea.order.dao;
import com.dituhui.pea.order.entity.MapLayerCustomizeSkillEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface MapLayerCustomizeSkillDao extends JpaRepository<MapLayerCustomizeSkillEntity, Long>{
List<MapLayerCustomizeSkillEntity> findByLayerId(String layerId);
@Modifying
@Query("UPDATE MapLayerCustomizeSkill s SET s.status = :status WHERE s.layerId = :layerId")
void updateStatusByLayerId(int status, String layerId);
@Modifying
@Query("UPDATE MapLayerCustomizeSkill s SET s.status = :status WHERE s.layerId = :layerId and s.skillCode IN :skillCodes")
void updateStatusByLayerIdAndSkillCodeIn(int status, String layerId, List<String> skillCodes);
}
...@@ -3,6 +3,7 @@ package com.dituhui.pea.order.entity; ...@@ -3,6 +3,7 @@ package com.dituhui.pea.order.entity;
import lombok.Data; import lombok.Data;
import javax.persistence.*; import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.Date; import java.util.Date;
@Entity @Entity
...@@ -36,10 +37,10 @@ public class MapLayerCustomizeEntity { ...@@ -36,10 +37,10 @@ public class MapLayerCustomizeEntity {
private String memo; private String memo;
@Column(name = "create_time", nullable = false) @Column(name = "create_time", nullable = false)
private Date createTime; private LocalDateTime createTime;
@Column(name = "update_time", nullable = false) @Column(name = "update_time", nullable = false)
private Date updateTime; private LocalDateTime updateTime;
// Getters and Setters // Getters and Setters
// ... // ...
......
package com.dituhui.pea.order.entity;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.time.LocalDateTime;
@Data
public class MapLayerCustomizeSkillEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@Column(name = "layer_id", length = 32)
private String layerId;
@Column(name = "skill_code", length = 32)
private String skillCode;
@Column(name = "description", length = 50)
private String description;
@Column(name = "status", length = 1)
private Integer status;
@Column(name = "memo", length = 100)
private String memo;
@Column(name = "create_time", nullable = false, columnDefinition = "datetime DEFAULT CURRENT_TIMESTAMP")
private LocalDateTime createTime;
@Column(name = "update_time", nullable = false, columnDefinition = "datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
private LocalDateTime updateTime;
}
...@@ -4,7 +4,7 @@ import com.dituhui.pea.common.Result; ...@@ -4,7 +4,7 @@ import com.dituhui.pea.common.Result;
public interface BusinessBlockService { public interface BusinessBlockService {
Result<?> businessServerBlocks(String levelType, String levelValue, long page, long size, String layerId, String teamId); Result<?> businessServerBlocks(String levelType, String levelValue, int page, int size, String layerId, String teamId);
Result<?> businessServiceBlockAdd(String layerId, String teamId); Result<?> businessServiceBlockAdd(String layerId, String teamId);
......
...@@ -8,7 +8,7 @@ import java.util.List; ...@@ -8,7 +8,7 @@ import java.util.List;
public interface BusinessLayerService { public interface BusinessLayerService {
Result<?> businessLayerUniversal(); Result<?> businessLayerUniversal();
Result<?> businessCustomLayers(String levelType, String levelValue, long page, long size); Result<?> businessCustomLayers(String levelType, String levelValue, int page, int size);
Result<?> businessCustomLayer(String layerId); Result<?> businessCustomLayer(String layerId);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!