|
@@ -7,6 +7,8 @@ import com.huimv.management.entity.YearPigBaseEntity;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
+
|
|
|
|
+import java.util.HashMap;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -137,4 +139,42 @@ public class YearPigBaseServiceImpl extends ServiceImpl<YearPigBaseDao, YearPigB
|
|
Integer integer = pigBaseDao.selectCount(wrapper);
|
|
Integer integer = pigBaseDao.selectCount(wrapper);
|
|
return integer;
|
|
return integer;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Map<String ,Object> queryPageByRelationship(Map<String, Object> params) {
|
|
|
|
+
|
|
|
|
+ Map<String, Object> result = new HashMap<>();
|
|
|
|
+ String eartag_no = (String) params.get("eartag");
|
|
|
|
+ System.out.println(eartag_no);
|
|
|
|
+ YearPigBaseEntity self = baseMapper.selectOne(Wrappers.<YearPigBaseEntity>lambdaQuery().eq(YearPigBaseEntity::getEartag, eartag_no));
|
|
|
|
+ System.out.println(self);
|
|
|
|
+ result.put("self", self );
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ System.out.println("父亲ID"+self.getFatherEartag()); System.out.println("母亲ID"+self.getMotherEartag());
|
|
|
|
+ String math = self.getMotherEartag();
|
|
|
|
+
|
|
|
|
+ YearPigBaseEntity father = self.getFatherEartag() == null ? null : baseMapper.selectOne(Wrappers.<YearPigBaseEntity>lambdaQuery().eq(YearPigBaseEntity::getEartag, self.getFatherEartag()));
|
|
|
|
+ YearPigBaseEntity mother = self.getMotherEartag() == null ? null : baseMapper.selectOne(Wrappers.<YearPigBaseEntity>lambdaQuery().eq(YearPigBaseEntity::getEartag, math));
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //父亲父母
|
|
|
|
+ result.put("father", father);
|
|
|
|
+ result.put("mother", mother);
|
|
|
|
+ YearPigBaseEntity fathermother = father == null ? null : baseMapper.selectOne(Wrappers.<YearPigBaseEntity>lambdaQuery().eq(YearPigBaseEntity::getEartag, father.getFatherEartag()));
|
|
|
|
+ YearPigBaseEntity fatherfather = father == null ? null : baseMapper.selectOne(Wrappers.<YearPigBaseEntity>lambdaQuery().eq(YearPigBaseEntity::getEartag, father.getMotherEartag()));
|
|
|
|
+ result.put("fathermother", fathermother);
|
|
|
|
+ result.put("fatherfather", fatherfather);
|
|
|
|
+ //母亲父母
|
|
|
|
+ YearPigBaseEntity mothermother = mother == null ? null : baseMapper.selectOne(Wrappers.<YearPigBaseEntity>lambdaQuery().eq(YearPigBaseEntity::getEartag, mother.getFatherEartag()));
|
|
|
|
+ YearPigBaseEntity motherfather = mother == null ? null : baseMapper.selectOne(Wrappers.<YearPigBaseEntity>lambdaQuery().eq(YearPigBaseEntity::getEartag, mother.getMotherEartag()));
|
|
|
|
+ result.put("mothermother", mothermother);
|
|
|
|
+ result.put("motherfather", motherfather);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|