BgmxzMapper.xml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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.agile.mapper.BgmxzMapper" >
  4. <resultMap id="BaseResultMap" type="com.chinaitop.agile.model.Bgmxz">
  5. <id column="DataID" property="dataid" jdbcType="VARCHAR" />
  6. <result column="UnitID" property="unitid" jdbcType="CHAR" />
  7. <result column="ModifyDate" property="modifydate" jdbcType="TIMESTAMP" />
  8. <result column="lkmc" property="lkmc" jdbcType="VARCHAR" />
  9. <result column="ch" property="ch" jdbcType="INTEGER" />
  10. <result column="hwh" property="hwh" jdbcType="INTEGER" />
  11. <result column="pz" property="pz" jdbcType="CHAR" />
  12. <result column="rq" property="rq" jdbcType="TIMESTAMP" />
  13. <result column="wjh" property="wjh" jdbcType="VARCHAR" />
  14. <result column="srsl" property="srsl" jdbcType="DOUBLE" />
  15. <result column="zcsl" property="zcsl" jdbcType="DOUBLE" />
  16. <result column="kcsl" property="kcsl" jdbcType="DOUBLE" />
  17. <result column="jzr" property="jzr" jdbcType="VARCHAR" />
  18. <result column="lkbm" property="lkbm" jdbcType="VARCHAR" />
  19. <result column="mxpz" property="mxpz" jdbcType="CHAR" />
  20. <result column="dj" property="dj" jdbcType="CHAR" />
  21. <result column="cjsj" property="cjsj" jdbcType="TIMESTAMP" />
  22. <result column="hwxz" property="hwxz" jdbcType="CHAR" />
  23. <result column="zy" property="zy" jdbcType="VARCHAR" />
  24. <result column="Direction" property="direction" jdbcType="INTEGER" />
  25. <result column="hwcd" property="hwcd" jdbcType="CHAR" />
  26. <result column="scnf" property="scnf" jdbcType="CHAR" />
  27. <result column="srsjsl" property="srsjsl" jdbcType="DOUBLE" />
  28. <result column="zcsjsl" property="zcsjsl" jdbcType="DOUBLE" />
  29. <result column="kcsjsl" property="kcsjsl" jdbcType="DOUBLE" />
  30. <result column="ljsrsjsl" property="ljsrsjsl" jdbcType="DOUBLE" />
  31. <result column="ljzcsjsl" property="ljzcsjsl" jdbcType="DOUBLE" />
  32. <result column="sssh" property="sssh" jdbcType="DOUBLE" />
  33. <result column="bpsf" property="bpsf" jdbcType="DOUBLE" />
  34. <result column="bpzz" property="bpzz" jdbcType="DOUBLE" />
  35. <result column="pjsf" property="pjsf" jdbcType="DOUBLE" />
  36. <result column="pjzz" property="pjzz" jdbcType="DOUBLE" />
  37. <result column="zbszsl" property="zbszsl" jdbcType="DOUBLE" />
  38. <result column="lqss" property="lqss" jdbcType="VARCHAR" />
  39. <result column="tzdh" property="tzdh" jdbcType="VARCHAR" />
  40. </resultMap>
  41. <sql id="Base_Column_List">
  42. DataID, UnitID, ModifyDate, lkmc, ch, hwh, pz, rq, wjh, srsl, zcsl, kcsl,
  43. jzr, lkbm, mxpz, dj, cjsj, hwxz, zy, Direction, hwcd, scnf, srsjsl, zcsjsl,
  44. kcsjsl, ljsrsjsl, ljzcsjsl, sssh, bpsf, bpzz, pjsf, pjzz, zbszsl, lqss, tzdh
  45. </sql>
  46. <!-- 保管明细账(新) -->
  47. <select id="selectbgmxz" parameterType="java.util.Map" resultMap="BaseResultMap">
  48. select
  49. a.DataID,
  50. a.UnitID,
  51. a.ModifyDate,
  52. a.lkmc,
  53. a.ch,
  54. a.hwh,
  55. a.pz,
  56. a.rq,
  57. a.wjh,
  58. a.srsl,
  59. a.zcsl,
  60. a.kcsl,
  61. a.jzr,
  62. a.lkbm,
  63. a.mxpz,
  64. a.dj,
  65. a.cjsj,
  66. a.hwxz,
  67. a.zy,
  68. a.Direction,
  69. a.hwcd,
  70. a.scnf,
  71. a.srsjsl,
  72. a.zcsjsl,
  73. a.kcsjsl,
  74. a.ljsrsjsl,
  75. a.ljzcsjsl,
  76. a.sssh,
  77. a.bpsf,
  78. a.bpzz,
  79. a.pjsf,
  80. a.pjzz,
  81. a.zbszsl,
  82. c.lqss,
  83. b.tzdh,
  84. d.y_dataid ydataid
  85. from data_kcgl_fcbgz_default a
  86. left join data_kcgl_xckc_default b on b.dataid=a.dataid
  87. left join depot_qh.business_delivery_storage_notice c on c.bill_number=b.tzdh and c.org_id=b.unitid
  88. left join depot_qh.storage_keep_voucher d on d.y_dataid=a.DataID
  89. where 1=1 and (a.srsl > 0.0 or a.zcsl > 0.0) AND a.Direction = 1
  90. <if test="ch != null">
  91. and a.ch = #{ch}
  92. </if>
  93. <if test="hwh != null">
  94. and a.hwh = #{hwh}
  95. </if>
  96. <if test="pz != null">
  97. and a.pz = #{pz}
  98. </if>
  99. <if test="hwxz != null">
  100. and a.hwxz = #{hwxz}
  101. </if>
  102. <if test="startDate != null">
  103. and a.rq >= to_date(#{startDate},'yyyy-mm-dd hh24:mi:ss')
  104. </if>
  105. <if test="endDate != null">
  106. and a.rq &lt;= to_date(#{endDate},'yyyy-mm-dd hh24:mi:ss')
  107. </if>
  108. <if test="orgId != null">
  109. and a.UnitID = #{orgId}
  110. </if>
  111. order by a.rq desc
  112. </select>
  113. </mapper>