优化查询功能,
This commit is contained in:
@@ -156,7 +156,7 @@ public class ServiceDictInfoController extends BaseController {
|
||||
for(int i=allList.size()-1;i>=0;i--){
|
||||
ServiceDictInfo se = allList.get(i);
|
||||
if(se!=null&&se.getServiceDictId()!=null){
|
||||
if(tempList.contains(se.getServiceDictId())){
|
||||
if(tempList.contains(se.getServiceDictId())||se.getParent().getServiceDictId()==0){
|
||||
allList.remove(se);
|
||||
}
|
||||
}
|
||||
@@ -164,7 +164,7 @@ public class ServiceDictInfoController extends BaseController {
|
||||
|
||||
allList.addAll(page.getList());
|
||||
ServiceDictInfo.sortList(list,allList,0,true);
|
||||
|
||||
//serviceDictInfo.setItemType(selectedType);
|
||||
model.addAttribute("itType", itType);
|
||||
model.addAttribute("intArr", Arrays.asList(intArr));
|
||||
model.addAttribute("list", list);
|
||||
|
||||
@@ -155,7 +155,7 @@ public class SysDictInfoController extends BaseController {
|
||||
SysDictInfo se = allList.get(i);
|
||||
//System.out.println("删前顺序"+se.getSysDictId());
|
||||
if(se!=null&&se.getSysDictId()!=null){
|
||||
if(tempList.contains(se.getSysDictId())){
|
||||
if(tempList.contains(se.getSysDictId())||se.getParent().getSysDictId()==0){
|
||||
allList.remove(se);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
AND create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND create_time <= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
|
||||
AND create_time <= #{endDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
|
||||
<choose>
|
||||
@@ -115,7 +115,7 @@
|
||||
AND create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND create_time <= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
|
||||
AND create_time <= #{endDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
|
||||
<choose>
|
||||
@@ -168,7 +168,7 @@
|
||||
AND s.create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND s.create_time <= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
|
||||
AND s.create_time <= #{endDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
AND s.parent_id not in (
|
||||
SELECT s2.service_dict_id FROM service_dict_info s2 WHERE s2.is_valid=1
|
||||
@@ -185,7 +185,7 @@
|
||||
AND s2.create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND s2.create_time <= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
|
||||
AND s2.create_time <= #{endDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
)
|
||||
<choose>
|
||||
@@ -216,7 +216,7 @@
|
||||
AND s.create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND s.create_time <= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
|
||||
AND s.create_time <= #{endDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
AND s.parent_id not in (
|
||||
SELECT s2.service_dict_id FROM service_dict_info s2 WHERE s2.is_valid=1
|
||||
@@ -233,7 +233,7 @@
|
||||
AND s2.create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND s2.create_time <= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
|
||||
AND s2.create_time <= #{endDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
)
|
||||
<choose>
|
||||
@@ -266,7 +266,7 @@
|
||||
AND create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND create_time <= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
|
||||
AND create_time <= #{endDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
@@ -287,7 +287,7 @@
|
||||
AND create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND create_time <= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
|
||||
AND create_time <= #{endDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
AND create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND create_time <= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
|
||||
AND create_time <= #{endDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
|
||||
<choose>
|
||||
@@ -107,7 +107,7 @@
|
||||
AND s.create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND s.create_time <= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
|
||||
AND s.create_time <= #{endDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
AND s.parent_id not in (
|
||||
SELECT s2.sys_dict_id FROM sys_dict_info s2 WHERE s2.is_valid=1
|
||||
@@ -124,7 +124,7 @@
|
||||
AND s2.create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND s2.create_time <= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
|
||||
AND s2.create_time <= #{endDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
)
|
||||
<choose>
|
||||
@@ -155,7 +155,7 @@
|
||||
AND create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND create_time <= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
|
||||
AND create_time <= #{endDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.nis.domain.Page;
|
||||
@@ -285,6 +286,7 @@ public class ServiceDictInfoService extends BaseService{
|
||||
* 新增或修改业务字典表(添加层级改变)
|
||||
* @param serviceDictInfo
|
||||
*/
|
||||
@Transactional
|
||||
public void saveOrUpdate(ServiceDictInfo serviceDictInfo) {
|
||||
if(serviceDictInfo.getParent()==null
|
||||
||(serviceDictInfo.getParent()!=null&&serviceDictInfo.getParent().getServiceDictId()==null)
|
||||
@@ -351,6 +353,7 @@ public class ServiceDictInfoService extends BaseService{
|
||||
* 删除
|
||||
* @param serviceDictInfo
|
||||
*/
|
||||
@Transactional(readOnly = false)
|
||||
public void deleteDict(ServiceDictInfo serviceDictInfo) {
|
||||
List<ServiceDictInfo> list = Lists.newArrayList();
|
||||
//找出所有下级
|
||||
|
||||
Reference in New Issue
Block a user