src/main/resources/mapper/production/ProductMaterialMapper.xml
@@ -16,4 +16,20 @@ <result property="updateTime" column="update_time"/> </resultMap> <select id="selectProductModelIdByName" resultType="java.lang.String" parameterType="java.lang.Long"> select pm.product_name from product_material pm left join product_material_sku pms on pms.product_id = pm.id <where> <choose> <when test="productModelId != null"> pms.id = #{productModelId} </when> <otherwise> 1 = 0 </otherwise> </choose> </where> </select> </mapper>