智慧农业后台管理
guoshilong
2022-10-17 991770ca69d356362f123d1ff6d8df1ec7046c9c
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
<?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.farmplant.mapper.StrainMapper">
 
    <!--自定义查询农场检测报告/证书分页数据-->
    <select id="selectStrainPage" resultType="org.springblade.modules.farmplant.vo.StrainVO">
        select * from sys_strain where 1=1
        <if test="strain.strainType!=null and strain.strainType!=''">
            and strain_type = #{strain.strainType}
        </if>
        <if test="strain.tenantId!=null and strain.tenantId!=''">
            and tenant_id = #{strain.tenantId}
        </if>
        <if test="strain.strainName!=null and strain.strainName!=''">
            and strain_name like concat('%',#{strain.strainName},'%')
        </if>
    </select>
    <select id="kindTree" resultType="java.util.Map">
        SELECT strain.id,strain.strain_name kindName,0 AS type
        FROM sys_strain strain
        UNION
        SELECT m.id ,m.machining_type,1 AS type
        FROM sys_machining m
        WHERE m.is_deleted = 0
    </select>
 
</mapper>