提交 73027637 authored 作者: 吴德鹏's avatar 吴德鹏

图片压缩

上级 24529114
...@@ -125,6 +125,8 @@ public class TbCfStationItem { ...@@ -125,6 +125,8 @@ public class TbCfStationItem {
private Integer sort; private Integer sort;
private String handled;
@JsonIgnore @JsonIgnore
@ManyToOne @ManyToOne
@JoinColumn(columnDefinition = "template", name = "template") @JoinColumn(columnDefinition = "template", name = "template")
...@@ -504,4 +506,11 @@ public class TbCfStationItem { ...@@ -504,4 +506,11 @@ public class TbCfStationItem {
return itemDescritionId; return itemDescritionId;
} }
public String getHandled() {
return handled;
}
public void setHandled(String handled) {
this.handled = handled;
}
} }
...@@ -5,9 +5,11 @@ import com.example.afrishop_v3.models.TbCfStationItem; ...@@ -5,9 +5,11 @@ import com.example.afrishop_v3.models.TbCfStationItem;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param; import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;
import java.util.List; import java.util.List;
...@@ -37,7 +39,7 @@ public interface TbCfStationItemRepository extends PagingAndSortingRepository<Tb ...@@ -37,7 +39,7 @@ public interface TbCfStationItemRepository extends PagingAndSortingRepository<Tb
Page<TbCfStationItem> findByItemCategory(String itemName, Pageable pageable); Page<TbCfStationItem> findByItemCategory(String itemName, Pageable pageable);
List<TbCfStationItem> findAllByItemDescritionId(String id,Sort sort); List<TbCfStationItem> findAllByItemDescritionId(String id, Sort sort);
@Query(value = "select i from #{#entityName} i inner join AdvertisementItem a on i.itemId=a.itemId where a.adId=?1 order by a.sort") @Query(value = "select i from #{#entityName} i inner join AdvertisementItem a on i.itemId=a.itemId where a.adId=?1 order by a.sort")
Page<TbCfStationItem> getAdvertisementItem(String adId, Pageable pageable); Page<TbCfStationItem> getAdvertisementItem(String adId, Pageable pageable);
...@@ -49,4 +51,12 @@ public interface TbCfStationItemRepository extends PagingAndSortingRepository<Tb ...@@ -49,4 +51,12 @@ public interface TbCfStationItemRepository extends PagingAndSortingRepository<Tb
List<TbCfStationItem> findAllByItemIdIn(String[] ids); List<TbCfStationItem> findAllByItemIdIn(String[] ids);
@Query(value = "select i from #{#entityName} i where i.handled is null ")
List<TbCfStationItem> queryItemsAll();
@Modifying
@Query(value = "update TbCfStationItem set handled='Y',itemImg=:itemImg where itemId=:itemId")
@Transactional
int updateItmeImg(@Param("itemImg") String itemImg, @Param("itemId") String itemId);
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论