From 3c18ab6cd51082eefdc1e3ef28751dd46db3faab Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Fri, 01 Jul 2022 10:22:18 +0800
Subject: [PATCH] 采收修改,农事记录设置租户id,溯源信息返回为二维码图片
---
src/main/java/org/springblade/modules/recovery/mapper/RecoveryMapper.xml | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/src/main/java/org/springblade/modules/recovery/mapper/RecoveryMapper.xml b/src/main/java/org/springblade/modules/recovery/mapper/RecoveryMapper.xml
index 6d290b5..d905329 100644
--- a/src/main/java/org/springblade/modules/recovery/mapper/RecoveryMapper.xml
+++ b/src/main/java/org/springblade/modules/recovery/mapper/RecoveryMapper.xml
@@ -4,8 +4,9 @@
<!--自定义查询采收记录分页数据-->
<select id="selectRecoveryPage" resultType="org.springblade.modules.recovery.vo.RecoveryVO">
- select sr.*,sl.land_name landName from sys_recovery sr
+ select sr.*,sl.land_name landName,ss.strain_name strainName from sys_recovery sr
left join sys_land sl on sl.id = sr.land_id
+ left join sys_strain ss on ss.id = sr.strain_id
where 1=1
<if test="recovery.strainId!=null and recovery.strainId!=''">
and sr.strain_id = #{recovery.strainId}
@@ -22,5 +23,17 @@
<if test="recovery.operator!=null and recovery.operator!=''">
and sr.operator = #{recovery.operator}
</if>
+ <if test="recovery.deptId!=null and recovery.deptId!=''">
+ and sr.dept_id = #{recovery.deptId}
+ </if>
+ <if test="recovery.tenantId!=null and recovery.tenantId!=''">
+ and sr.tenant_id = #{recovery.tenantId}
+ </if>
+ </select>
+
+ <!--查询当前前缀已有的溯源码编号,取倒数7位的最大值-->
+ <select id="getCodePreCount" resultType="java.lang.Integer">
+ select ifnull(max(0+RIGHT(code,7)),0) from sys_traceability
+ where code like concat('%', #{pre},'%')
</select>
</mapper>
--
Gitblit v1.9.3