Jpa Hql

直接上代碼

@Data
public class SS_Res {
 
    public SS_Res(String pol, String pod) {
        this.pol = pol;
        this.pod = pod;
    }
 
   
    private String pol;
    private String pod;
 
}

 

Dao

@Query(value="select new com.example.SS_Res(" +
            " ss.pol " +
            " ,ss.pod " +
            " )"+
            " from ss_res ss , ssa_res ssa " +
            " where ss.ssUUID = ssa.ssaUUID  " +
            " and (ifnull(:companyUUID,'')='' or ssa.companyUUID=:companyUUID) " 
    List<SS_Res> findHqlExample(@Param("companyUUID")String companyUUID);

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章