| | |
| | | |
| | | List<FiberDto> selectFiberByBushingId(Integer bushingId); |
| | | |
| | | List<FiberDto> selectFiberByFibersId(Integer fibersId); |
| | | |
| | | } |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.yuanchu.mom.dto.BushingDto; |
| | | import com.yuanchu.mom.pojo.InsBushing; |
| | | import com.yuanchu.mom.mapper.InsBushingMapper; |
| | | import com.yuanchu.mom.service.InsBushingService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.dto.BushingDto; |
| | | import com.yuanchu.mom.dto.FibersDto; |
| | | import com.yuanchu.mom.mapper.InsBushingMapper; |
| | | import com.yuanchu.mom.pojo.InsBushing; |
| | | import com.yuanchu.mom.service.InsBushingService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | for (InsBushing insBushing : insBushings) { |
| | | BushingDto bushingDto = JSON.parseObject(JSON.toJSONString(insBushing), BushingDto.class); |
| | | bushingDto.setFiber(insBushingMapper.selectFiberByBushingId(bushingDto.getId())); |
| | | if(bushingDto.getFiber().size()==0){ |
| | | bushingDto.setFibers(insBushingMapper.selectFibersByBushingId(insBushing.getId())); |
| | | for (FibersDto fibers : bushingDto.getFibers()) { |
| | | fibers.setFiber(insBushingMapper.selectFiberByFibersId(fibers.getId())); |
| | | } |
| | | } |
| | | bushingDtos.add(bushingDto); |
| | | } |
| | | return bushingDtos; |
| | |
| | | where f.ins_bushing_id = #{bushingId} |
| | | </select> |
| | | |
| | | <select id="selectFiberByFibersId" resultMap="FiberDto"> |
| | | select f.id, f.bush_color, f.color, f.model, f.standard, f.ins_bushing_id, |
| | | p.id pid, p.inspection_item, p.inspection_item_classify, p.inspection_item_subclass, p.factory, p.laboratory, p.sample_type, p.sample, p.model pmodel, p.son_laboratory, p.unit, p.price, p.man_hour, p.man_hour_group, p.inspection_item_type, p.inspection_value_type, p.device_group, p.checkout_number, p.section, p.value_type, p.method, p.man_day, p.bsm, p.ask, p.tell, p.`last_value`, p.ins_result, p.state, p.ins_sample_id, p.template_id, p.dic, p.method_s |
| | | from ins_fiber f |
| | | left join ins_product p on p.ins_fiber_id = f.id |
| | | where f.ins_fibers_id = #{fibersId} |
| | | </select> |
| | | |
| | | <resultMap id="FibersDto" type="com.yuanchu.mom.dto.FibersDto"> |
| | | <id property="id" column="id"/> |
| | | <result property="code" column="code"/> |