今天程序须要依据前台的传过来的状态推断在数据库里是取 where a>b 

还是 a<b 还是 a=0 的情况  搞了一下午最后试了下 在if 里面拼接  #{status}=#{status}  一切ok了 

具体代码例如以下   

                        

                                <if test=" status==1">
 				 
 				 and inv.security_inventory < inv.actual_inventory and #{status} = #{status}
 				 </if>
 				<if test="  status==2"><!-- 缺货-->
 					 and inv.security_inventory > inv.actual_inventory  and #{status} = #{status}
 				</if>
 				<if test="  status==3"><!-- 无货-->
 					 and inv.security_inventory = 0  and #{status} = #{status}
 				</if>

相关文章:

  • 2022-12-23
  • 2021-06-10
  • 2022-12-23
  • 2022-12-23
  • 2021-06-28
  • 2022-12-23
  • 2022-12-23
  • 2022-01-20
猜你喜欢
  • 2021-10-24
  • 2021-09-14
  • 2021-04-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案