StorehouseServiceDaoImplMapper.xml 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="storehouseServiceDaoImpl">
  6. <!-- 查询仓库信息 add by wuxw 2018-07-03 -->
  7. <select id="getStorehouseInfo" parameterType="Map" resultType="Map">
  8. select t.sh_desc,t.sh_desc shDesc,t.sh_id,t.sh_id
  9. shId,t.status_cd,t.status_cd statusCd,t.sh_name,t.sh_name shName,t.store_id,t.store_id
  10. storeId,t.is_show,t.is_show isShow,t.create_time createTime,t.purchase_switch purchaseSwitch,
  11. t.purchase_raf_id purchaseRafId,t.use_switch useSwitch,t.use_raf_id useRafId,
  12. t.allocation_switch allocationSwitch,t.allocation_raf_id allocationRafId,raf.flow_name purchaseFlowName,
  13. raf.flow_id purchaseFlowId,raf1.flow_id useFlowId,raf2.flow_id allocationFlowId,
  14. raf1.flow_name useFlowName,raf2.flow_name allocationFlowName
  15. from storehouse t
  16. left join resource_audit_flow raf on t.purchase_raf_id = raf.raf_id and raf.status_cd = '0'
  17. left join resource_audit_flow raf1 on t.use_raf_id = raf1.raf_id and raf1.status_cd = '0'
  18. left join resource_audit_flow raf2 on t.allocation_raf_id = raf2.raf_id and raf2.status_cd = '0'
  19. where 1 =1
  20. <if test="shDesc !=null and shDesc != ''">
  21. and t.sh_desc= #{shDesc}
  22. </if>
  23. <if test="shId !=null and shId != ''">
  24. and t.sh_id= #{shId}
  25. </if>
  26. <if test="statusCd !=null and statusCd != ''">
  27. and t.status_cd= #{statusCd}
  28. </if>
  29. <if test="shName !=null and shName != ''">
  30. and t.sh_name= #{shName}
  31. </if>
  32. <if test="bId !=null and bId != ''">
  33. and t.b_id= #{bId}
  34. </if>
  35. <if test="storeId !=null and storeId != ''">
  36. and t.store_id= #{storeId}
  37. </if>
  38. <if test="isShow !=null and isShow != ''">
  39. and t.is_show= #{isShow}
  40. </if>
  41. order by t.create_time desc
  42. <if test="page != -1 and page != null ">
  43. limit #{page}, #{row}
  44. </if>
  45. </select>
  46. <!-- 查询仓库数量 add by wuxw 2018-07-03 -->
  47. <select id="queryStorehousesCount" parameterType="Map" resultType="Map">
  48. select count(1) count
  49. from storehouse t
  50. where 1 =1
  51. <if test="shDesc !=null and shDesc != ''">
  52. and t.sh_desc= #{shDesc}
  53. </if>
  54. <if test="shId !=null and shId != ''">
  55. and t.sh_id= #{shId}
  56. </if>
  57. <if test="statusCd !=null and statusCd != ''">
  58. and t.status_cd= #{statusCd}
  59. </if>
  60. <if test="shName !=null and shName != ''">
  61. and t.sh_name= #{shName}
  62. </if>
  63. <if test="bId !=null and bId != ''">
  64. and t.b_id= #{bId}
  65. </if>
  66. <if test="storeId !=null and storeId != ''">
  67. and t.store_id= #{storeId}
  68. </if>
  69. <if test="isShow !=null and isShow != ''">
  70. and t.is_show= #{isShow}
  71. </if>
  72. </select>
  73. </mapper>