XiaoRuby
2023-07-26 cdaff9ab0d1b676e3b429171d6de0887c98f488c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?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.InspectionMapper">
    <select id="selectAllInspection" resultType="com.yuanchu.limslaboratory.pojo.dto.InspectionDto">
        select i.id, type, inspection_status, qualified_state, i.create_time, user_name, inspect_start_time, inspect_end_time, u.name inspectUserName
        from inspection i left join user u
        on i.inspect_user_id = u.id
        <if test="state!=null">
            where state = #{state}
        </if>
        order by i.create_time desc
        limit #{pageSize},#{countSize}
    </select>
    <select id="selectInspectToCount" resultType="java.lang.Integer">
        select count(*)
        from inspection i left join user u
        on i.inspect_user_id = u.id
        <if test="state!=null">
            where state = #{state}
        </if>
    </select>
 
</mapper>