|
@@ -9,7 +9,11 @@ import com.sysu.admin.controller.lz.area.LzAreaRepository;
|
|
import com.sysu.admin.site.CommonVo;
|
|
import com.sysu.admin.site.CommonVo;
|
|
import com.sysu.admin.support.base.BaseService;
|
|
import com.sysu.admin.support.base.BaseService;
|
|
import com.sysu.admin.support.system.user.User;
|
|
import com.sysu.admin.support.system.user.User;
|
|
|
|
+import com.sysu.admin.utils.GenericsUtil;
|
|
|
|
+import com.sysu.admin.utils.SqlUtil;
|
|
|
|
+import com.sysu.admin.utils.TextUtil;
|
|
import com.xiesx.fastboot.core.jpa.JpaPlusRepository;
|
|
import com.xiesx.fastboot.core.jpa.JpaPlusRepository;
|
|
|
|
+import org.apache.commons.lang3.ArrayUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -26,11 +30,11 @@ public class LzTreeService extends BaseService<LzTree, Integer> {
|
|
public List<LzTree> findAll(CommonVo vo){
|
|
public List<LzTree> findAll(CommonVo vo){
|
|
String filter = " where 1=1 ";
|
|
String filter = " where 1=1 ";
|
|
if(vo != null){
|
|
if(vo != null){
|
|
- if(vo.getClazzId() != null){
|
|
|
|
- filter += " and c.id = " + vo.getClazzId();
|
|
|
|
|
|
+ if(ArrayUtils.isNotEmpty(vo.getClazzIds())){
|
|
|
|
+ filter += SqlUtil.ArrayToInSql("and", "c.id", vo.getClazzIds());
|
|
}
|
|
}
|
|
- if(vo.getPeriodId() != null){
|
|
|
|
- filter += " and b.lzPeriod.id = " + vo.getPeriodId();
|
|
|
|
|
|
+ if(ArrayUtils.isNotEmpty(vo.getPeriodIds())){
|
|
|
|
+ filter += SqlUtil.ArrayToInSql("and", "b.lzPeriod.id", vo.getPeriodIds());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
String sql = "SELECT a, b, c FROM LzTree a JOIN FETCH a.lzEveryday b JOIN FETCH a.clazz c";
|
|
String sql = "SELECT a, b, c FROM LzTree a JOIN FETCH a.lzEveryday b JOIN FETCH a.clazz c";
|