| | |
| | | <select id="selectTraceabilityPage" resultType="org.springblade.modules.traceability.vo.TraceabilityVO"> |
| | | select st.* from sys_traceability st |
| | | left join sys_recovery sr on st.recovery_id = sr.id |
| | | LEFT JOIN sys_land sl ON sl.id = sr.land_id |
| | | where 1=1 |
| | | <if test="traceability.code!=null and traceability.code!=''"> |
| | | and st.code like concat('%',#{traceability.code},'%') |
| | | </if> |
| | | <if test="traceability.deptId!=null and traceability.deptId!=''"> |
| | | and st.dept_id = #{traceability.deptId} |
| | | <if test="traceability.farmId!=null and traceability.farmId!=''"> |
| | | and sl.farm_id = #{traceability.farmId} |
| | | </if> |
| | | <if test="traceability.tenantId!=null and traceability.tenantId!=''"> |
| | | and st.tenant_id = #{traceability.tenantId} |
| | |
| | | </select> |
| | | |
| | | <select id="selectRevorid" resultType="java.lang.String"> |
| | | select recovery_id from sys_traceability where code=#{code} |
| | | select recovery_id |
| | | from sys_traceability |
| | | where code = #{code} |
| | | </select> |
| | | |
| | | <!--获取溯源简介信息--> |
| | | <select id="getSimpleInfo" resultType="org.springblade.modules.traceability.dto.TraceabilityDTO"> |
| | | SELECT concat(sf.farm_name,'-',ifnull(sl.land_name,'-'),'-',ss.strain_name,'-',sr.time,' 采收') remark FROM `sys_traceability` st |
| | | left join blade_dept bd on bd.id = st.dept_id |
| | | left join sys_recovery sr on sr.id = st.recovery_id |
| | | left join sys_land sl on sl.id = sr.land_id |
| | | left join sys_strain ss on ss.id = sr.strain_id |
| | | left join sys_farm sf on sf.dept_id = bd.id |
| | | SELECT concat(sf.farm_name, '-', ifnull(sl.land_name, '-'), '-', ss.strain_name, '-', sr.time, ' 采收') remark |
| | | FROM `sys_traceability` st |
| | | left join blade_dept bd on bd.id = st.dept_id |
| | | left join sys_recovery sr on sr.id = st.recovery_id |
| | | left join sys_land sl on sl.id = sr.land_id |
| | | left join sys_strain ss on ss.id = sr.strain_id |
| | | left join sys_farm sf on sf.dept_id = bd.id |
| | | where st.code = #{traceability.code} |
| | | </select> |
| | | </mapper> |