CZT
2023-09-27 93c97d5894ce481a567b7fd8769436388f3897a8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package com.fzzy.api.view.repository;
 
import com.fzzy.api.entity.GbArea;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
 
import java.util.List;
 
 
public interface GbAreaRep extends JpaRepository<GbArea, String> {
 
    @Query("from GbArea where code like:code or name like:name  order by code ")
    List<GbArea> findByCode(@Param("code") String code, @Param("name") String name);
 
    @Query("from GbArea where parentCode=:parentCode order by code")
    List<GbArea> listByParent(@Param("parentCode") String parentCode);
 
    /**
     * 根据名称获取区域信息
     * @param name
     * @return
     */
    @Query("from GbArea where name like:name order by code")
    List<GbArea> listByName(@Param("name") String name);
}