Jelajahi Sumber

根据mdjf的ids筛选查询

wangtuohang@126.com 1 bulan lalu
induk
melakukan
52593b1cf2

+ 5 - 1
src/main/java/org/springblade/modules/mdjfdj/controller/MdjfDjController.java

@@ -166,7 +166,7 @@ public class MdjfDjController extends BladeController {
 			mdjfDj.setSqName(sq.getDeptName());
 		}
 		List<MdjfRyEntity> mdjfRyList = mdjfryService.getRyByMdId(id);
-		MdjfDjVO mdjfDetail = new MdjfDjVO(mdjfDj, mdjfRyList, new ArrayList<MdjfTjEntity>());
+		MdjfDjVO mdjfDetail = new MdjfDjVO(null, mdjfDj, mdjfRyList, new ArrayList<MdjfTjEntity>());
 		return R.data(mdjfDetail);
 	}
 
@@ -221,6 +221,10 @@ public class MdjfDjController extends BladeController {
 			}
 			mdjftjService.saveBatch(mdjfTjList);
 		}
+
+		if (null != mdjfdj.getFwId()) {
+			fwInfoService.updateMdId(mdjfdj.getFwId(), mdjf.getId());
+		}
 		return R.data(mdjf.getId());
 	}
 

+ 6 - 0
src/main/java/org/springblade/modules/mdjfdj/mapper/MdjfDjMapper.xml

@@ -147,6 +147,12 @@
                 WHERE
                     md.is_deleted = 0
                 AND ((sq.id :: text = any(string_to_array(#{params.deptId},','))) OR (sq.ancestors LIKE '%' || #{params.deptId} || '%'))
+                <if test="null != params.jfIds and '' != params.jfIds">
+                    AND EXISTS (
+                    SELECT 1 FROM unnest(string_to_array(#{params.jfIds}, ',')::int8[]) AS id(val)
+                    WHERE md.id = id.val
+                    )
+                </if>
             ) temp
         WHERE
             temp.maxRow = 1

+ 1 - 0
src/main/java/org/springblade/modules/mdjfdj/vo/MdjfDjVO.java

@@ -20,6 +20,7 @@ import java.util.List;
 @AllArgsConstructor
 public class MdjfDjVO extends MdjfDjEntity {
 	private static final long serialVersionUID = 1L;
+	private Long fwId;
 	private MdjfDjEntity mdjfDj;
 	private List<MdjfRyEntity> mdjfRyList;
 	private List<MdjfTjEntity> mdjfTjList;