WareHouseBasicInfoMapper.xml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.chinaitop.depot.intelligent.basicdata.mapper.WareHouseBasicInfoMapper" >
  4. <select id="getStorehouseInfo" parameterType="java.util.Map" resultType="java.util.Map">
  5. SELECT
  6. t.*
  7. FROM
  8. (
  9. SELECT
  10. t2.storehouse_type,
  11. t2.storehouse_code,
  12. t2.storehouse_name,
  13. t2.design_capacity,
  14. t2.house_doot_position,
  15. t2.storehouse_state,
  16. t2.dutyStoreman,
  17. t1.lkmc,
  18. t1.pz,
  19. t1.hwxz,
  20. t1.dj,
  21. t1.kcsl,
  22. t5.EnumItemName rq,
  23. t1.rq AS rcrq,
  24. t1.cjsj AS cjsj,
  25. t1.UnitID
  26. FROM
  27. `lsreport_ts`.data_kcgl_kcsw_default AS t1
  28. LEFT JOIN basic_storehouse t2 ON t1.UnitID = t2.org_id
  29. AND t1.ch = t2.storehouse_id
  30. LEFT JOIN (
  31. SELECT
  32. t4.EnumItemId,
  33. t4.EnumItemName,
  34. MAX(t4.EnumItemName) scnf,
  35. t3.UnitID,
  36. t3.ch,
  37. t3.scnf scnfEnumId
  38. FROM
  39. `lsreport_ts`.data_kcgl_fcbgz_default t3
  40. INNER JOIN `lsreport_ts`.enumitem t4 ON t3.scnf = t4.EnumItemId
  41. AND t3.srsl > 0
  42. AND t3.UnitID = #{org_id}
  43. GROUP BY
  44. t3.ch
  45. ) t5 ON t2.org_id = t5.UnitID
  46. AND t2.storehouse_id = t5.ch
  47. <where>
  48. t2.del_flag = 1
  49. <if test="org_id != null">
  50. AND t2.org_id = #{org_id}
  51. </if>
  52. <if test="library_type != null">
  53. AND t2.library_type = #{library_type}
  54. </if>
  55. <if test="cfCdoe != null">
  56. AND t2.storehouse_code = #{cfCdoe}
  57. </if>
  58. </where>
  59. ) t
  60. GROUP BY
  61. t.storehouse_code
  62. </select>
  63. <select id="getColumn1Max" parameterType="java.util.Map" resultType="java.util.Map">
  64. SELECT
  65. <trim suffixOverrides="," >
  66. <if test="column1 != null" >
  67. MAX(${column1}) column1,
  68. </if>
  69. <if test="column2 != null" >
  70. MAX(${column2}) column2,
  71. </if>
  72. <if test="column3 != null" >
  73. MAX(${column3}) column3,
  74. </if>
  75. </trim>
  76. FROM ${tableName}
  77. where ${column1} >= 10000
  78. </select>
  79. <select id="getEnum" parameterType="java.lang.String" resultType="java.lang.String">
  80. SELECT
  81. enumName
  82. FROM
  83. basic_enum
  84. WHERE
  85. enumId = ${code} AND delFlag = 1
  86. </select>
  87. <select id="getKeeperName" parameterType="java.util.Map" resultType="java.lang.String">
  88. SELECT
  89. GROUP_CONCAT(bk.name) keeperName
  90. FROM
  91. basic_keeper_house kh,
  92. basic_keeper bk,
  93. basic_storehouse bs
  94. WHERE
  95. kh.org_id = bk.org_id
  96. AND bk.id = kh.keeper_Id
  97. AND kh.house_Id = bs.storehouse_id
  98. AND bk.org_id = bs.org_id
  99. AND bs.storehouse_code = ${storehouse_code}
  100. AND bs.org_id = ${UnitID}
  101. AND bs.del_flag = 1
  102. </select>
  103. </mapper>