Commit 15683bbc by wangli

mp2jpa

1 parent 7e86450e
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);
}
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;
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!