1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
| <?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="com.yuanchu.limslaboratory.mapper.InspectionRecordsMapper">
| <select id="selectByProductId" resultType="com.yuanchu.limslaboratory.pojo.dto.InspectionRecordsDto">
| select yp.name,
| yp.username,
| ir.create_time,
| ir.update_time,
| ir.method,
| yp.ask,
| yp.mid,
| yp.material_name,
| yp.specifications_serial_number,
| yp.material_num
| from lims_laboratory.inspection_records ir
| left join (select ipl.id id,
| ipl.name,
| u.name username,
| ipl.ask,
| iml.id mid,
| iml.material_name,
| iml.specifications_serial_number,
| iml.material_num
| from lims_laboratory.inspection_product_list ipl
| left join lims_laboratory.inspection_material_list iml on ipl.inspection_material_list_id = iml.id left join
| lims_laboratory.user u on ipl.user_id = u.id) yp
| on ir.inspection_product_list_id = yp.id
| <where>
| <if test="productId != null">
| AND inspection_product_list_id = #{productId}
| </if>
| AND submit_state = #{submitState}
| </where>
| </select>
| </mapper>
|
|