From b7586ba9b38136c7af8ca9b31f92f570a0b039c2 Mon Sep 17 00:00:00 2001 From: Fixiaobai <fixiaobai@163.com> Date: 星期一, 21 八月 2023 18:02:35 +0800 Subject: [PATCH] 计量管理-》计量修改 试验管理-》合格率统计 --- standard-server/src/main/resources/mapper/StandardMapper.xml | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/standard-server/src/main/resources/mapper/StandardMapper.xml b/standard-server/src/main/resources/mapper/StandardMapper.xml index 0e0f8ce..b232854 100644 --- a/standard-server/src/main/resources/mapper/StandardMapper.xml +++ b/standard-server/src/main/resources/mapper/StandardMapper.xml @@ -2,4 +2,22 @@ <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.yuanchu.limslaboratory.mapper.StandardMapper"> + <resultMap id="BaseResultMap" type="java.util.Map"> + <id property="specificationsId" column="specificationsId" jdbcType="INTEGER"/> + <result property="specificationsName" column="specificationsName" jdbcType="VARCHAR"/> + <collection property="children" resultMap="BaseResultMapChildren" javaType="java.util.List"/> + </resultMap> + <resultMap id="BaseResultMapChildren" type="java.util.Map"> + <id property="modelId" column="modelId" jdbcType="INTEGER"/> + <result property="modelName" column="modelName" jdbcType="VARCHAR"/> + </resultMap> + + <select id="getSpecificationIdAndName" resultMap="BaseResultMap"> + SELECT s.`id` specificationsId, s.`name` specificationsName, f.id modelId, f.name modelName + FROM standard s + LEFT JOIN (SELECT f.`id`, f.`name`, f.`standard_id` FROM specifications f WHERE f.`state` = 1) f + ON s.`id` = f.`standard_id` + WHERE s.`material_id` = #{materialId} + AND s.`state` = 1 + </select> </mapper> -- Gitblit v1.9.3