parent
f6f72ea7b2
commit
a72d3e5afa
@ -1,5 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.jeecg.modules.demo.yxgwf.mapper.CaseMapper">
|
||||
|
||||
<select id="getAll" resultType="org.jeecg.modules.demo.yxgwf.entity.Case">
|
||||
SELECT id,customer,title,industry,des,img,date
|
||||
FROM yxgw_case
|
||||
where id in
|
||||
<foreach item="caseId" collection="caseIds"
|
||||
open="(" separator="," close=")">
|
||||
#{caseId}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
@ -1,5 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.jeecg.modules.demo.yxgwf.mapper.SolutionMapper">
|
||||
|
||||
<select id="getAll" resultType="org.jeecg.modules.demo.yxgwf.entity.Solution">
|
||||
SELECT id,title,des,img,date,cases FROM yxgw_solution
|
||||
</select>
|
||||
</mapper>
|
@ -1,11 +1,30 @@
|
||||
package org.jeecg.modules.demo.yxgwf.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.modules.demo.yxgwf.entity.Case;
|
||||
import org.jeecg.modules.demo.yxgwf.entity.Solution;
|
||||
import org.jeecg.modules.demo.yxgwf.mapper.CaseMapper;
|
||||
import org.jeecg.modules.demo.yxgwf.mapper.SolutionMapper;
|
||||
import org.jeecg.modules.demo.yxgwf.service.ISolutionService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class SolutionServiceImpl extends ServiceImpl<SolutionMapper, Solution> implements ISolutionService {
|
||||
@Autowired
|
||||
private SolutionMapper solutionMapper;
|
||||
@Autowired
|
||||
private CaseMapper caseMapper;
|
||||
|
||||
public List<Solution> getAll() {
|
||||
List<Solution> solution_list = solutionMapper.getAll();
|
||||
solution_list.forEach((e) -> {
|
||||
String[] caseIds = e.cases.split(",");
|
||||
List<Case> case_list = caseMapper.getAll(caseIds);
|
||||
e.caseslist = case_list;
|
||||
});
|
||||
return solution_list;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.jeecg.modules.demo.yxgwf.mapper.CaseMapper">
|
||||
|
||||
<select id="getAll" resultType="org.jeecg.modules.demo.yxgwf.entity.Case">
|
||||
SELECT id,customer,title,industry,des,img,date
|
||||
FROM yxgw_case
|
||||
where id in
|
||||
<foreach item="caseId" collection="caseIds"
|
||||
open="(" separator="," close=")">
|
||||
#{caseId}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
@ -1,5 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.jeecg.modules.demo.yxgwf.mapper.SolutionMapper">
|
||||
|
||||
<select id="getAll" resultType="org.jeecg.modules.demo.yxgwf.entity.Solution">
|
||||
SELECT id,title,des,img,date,cases FROM yxgw_solution
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in new issue