XiaoRuby
2023-07-27 ad7151b14f2721b0fa40a903c6e65a2c511dd4c5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?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.ProductMapper">
 
    <select id="pageProductInformation" resultType="map">
        SELECT COUNT(1) num, p.`father`
        FROM product p
        <if test="productCodeOrName != null and productCodeOrName != ''">
            WHERE p.`father` = #{productCodeOrName}
        </if>
        GROUP BY p.`father`
    </select>
 
    <select id="selectOneChildren" resultType="map">
        SELECT p.`id`, p.`unit`, p.`required`, p.`internal`
        FROM product p
        WHERE p.`father` = #{father}
    </select>
</mapper>