Fixiaobai
2023-08-17 58f820f804046e7fe82bef5a7b428b442a728e8a
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
<?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.MeteringPlanMapper">
 
    <select id="pagingQueryOfMeasurementLedger" resultType="map">
        SELECT
        i.`equipment_code` equipmentCode,
        i.`equipment_name` equipmentName,
        m.measurement_unit measurementUnit,
        i.measuring_range measuringRange,
        i.term_validity termValidity,
        m.result result,
        m.end_date endDate,
        u.NAME name ,
        m.`create_time` createTime,
        m.code code
        FROM
        metrical_information m
        LEFT JOIN `user` u ON u.id = m.user_id
        LEFT JOIN instrument i ON i.`id` = m.`instrument_id`
        WHERE 1=1
        and (m.state=1 and i.state=1)
        <if test="dto.code!=null and dto.code!=''">
         and    i.`equipment_code` like concat('%',#{dto.code},'%')
        </if>
        <if test="dto.name!=null and dto.name!=''">
          and   i.`equipment_name` like concat('%',#{dto.name},'%')
        </if>
        <if test="dto.name!=null and dto.name!=''">
          and   i.measurement_unit like concat('%',#{dto.unit},'%')
        </if>
    </select>
</mapper>