智慧农业后台管理
tangzy
2022-06-15 e71881a6ade967e45ba62b802028e2a2d2dfdee0
src/main/java/org/springblade/modules/recovery/mapper/RecoveryMapper.xml
@@ -23,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>