智慧农业后台管理
guoshilong
2022-08-19 4d60a2ee6bbfe76e2740307c832c8f309090a41e
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
<?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.springblade.modules.farm.mapper.FarmPaperMapper">
 
    <!--自定义查询农场检测报告/证书分页数据-->
    <select id="selectFarmPaperPage" resultType="org.springblade.modules.farm.vo.FarmPaperVO">
        select * from sys_farm_paper where 1=1
        <if test="farmPaper.type!=null and farmPaper.type!=''">
            and type = #{farmPaper.type}
        </if>
        <if test="farmPaper.deptId!=null and farmPaper.deptId!=''">
            and dept_id = #{farmPaper.deptId}
        </if>
        <if test="farmPaper.farmId!=null">
            and farm_id = #{farmPaper.farmId}
        </if>
        <if test="farmPaper.name!=null and farmPaper.name!=''">
            and name like concat('%',#{farmPaper.name},'%')
        </if>
    </select>
 
    <!--查询相关检测信息-->
    <select id="getFarmPaperList" resultType="org.springblade.modules.farm.vo.FarmPaperVO">
        select * from sys_farm_paper
        where 1=1
        and (farm_id = #{farmId} and type != 3)
        or (farm_id = #{farmPlantId} and type = 3)
    </select>
 
</mapper>