酸奶检验记录,鲜奶检验记录、生乳检验记录页面导出功能,奶产量分析页面报错修复
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zhyc.module.dairyProducts.mapper.NpSheepMilkAnalysisMapper">
|
||||
|
||||
<!-- 1) 获取 distinct sheep_id(支持按 sheep_file.bs_manage_tags 模糊搜索) -->
|
||||
<!-- 1) 获取distinct sheep_id(支持按sheep_file.bs_manage_tags模糊搜索) -->
|
||||
<select id="selectDistinctSheepIds" resultType="string" parameterType="map">
|
||||
SELECT DISTINCT a.sheep_id
|
||||
FROM np_milk_prod_classes a
|
||||
@@ -30,8 +30,7 @@
|
||||
ORDER BY datetime ASC
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 3) 获取该羊在 sheep_file 视图中的基础信息 -->
|
||||
<!-- 3) 获取该羊在sheep_file视图中的基础信息 -->
|
||||
<!-- 假设字段名称:bs_manage_tags、variety、lactation_day、name、birthday、parity、month_age、current_weight、breed、father_manage_tags、mother_manage_tags、dr_ranch、family -->
|
||||
<select id="selectSheepFileBySheepId" resultType="map" parameterType="string">
|
||||
SELECT
|
||||
@@ -53,10 +52,29 @@
|
||||
WHERE id = #{sheepId}
|
||||
</select>
|
||||
|
||||
<!-- 4) 兼容旧 list 查询(返回 domain 对象列表),但在我们的实现中 service 会构造最终的 NpSheepMilkAnalysis 列表 -->
|
||||
<!-- 4) 兼容旧list查询(返回domain对象列表),但在我们的实现中service会构造最终的NpSheepMilkAnalysis列表 -->
|
||||
<select id="selectNpSheepMilkAnalysisList" resultType="com.zhyc.module.dairyProducts.domain.NpSheepMilkAnalysis" parameterType="com.zhyc.module.dairyProducts.domain.NpSheepMilkAnalysis">
|
||||
<!-- 如果你仍需基于某张表的简单映射,可在此实现;当前我们在 ServiceImpl 中组装对象,所以该查询不做复杂实现 -->
|
||||
<!-- 如果你仍需基于某张表的简单映射,可在此实现;当前我们在ServiceImpl中组装对象,所以该查询不做复杂实现 -->
|
||||
SELECT 1 FROM dual WHERE 1=0
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
<!-- 5) 导出奶产量分析记录 -->
|
||||
<select id="selectNpSheepMilkAnalysisForExport" resultType="com.zhyc.module.dairyProducts.domain.NpSheepMilkAnalysis" parameterType="com.zhyc.module.dairyProducts.domain.NpSheepMilkAnalysis">
|
||||
<!-- 这里需要根据实际表结构编写SQL查询 -->
|
||||
<!-- 示例SQL,需要根据实际表结构调整 -->
|
||||
SELECT
|
||||
sf.id as sheepId,
|
||||
sf.bs_manage_tags as manageEarTag,
|
||||
sf.variety,
|
||||
<!-- 其他字段 -->
|
||||
FROM sheep_file sf
|
||||
LEFT JOIN np_milk_prod_classes m ON sf.id = m.sheep_id
|
||||
<where>
|
||||
<if test="manageEarTag != null and manageEarTag != ''">
|
||||
AND sf.bs_manage_tags LIKE CONCAT('%', #{manageEarTag}, '%')
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY sf.id
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user