TaskStocktakingItemMapper.xml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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.jsh.erp.datasource.mappers.TaskStocktakingItemMapper">
  4. <select id="listByTaskStocktakingId" resultType="com.jsh.erp.datasource.vo.TaskStocktakingItemVO">
  5. SELECT
  6. tsi.id AS id,
  7. mc.`name` AS category_name,
  8. m.`name` AS material_name,
  9. m.system_sku AS system_sku,
  10. me.commodity_unit AS commodity_unit,
  11. me.production_date AS production_date,
  12. s.supplier AS supplier_name,
  13. me.bar_code AS bar_code,
  14. me.inventory AS inventory,
  15. d.`name` AS depot_name,
  16. tsi.new_position AS new_position,
  17. tsi.new_inventory AS new_inventory,
  18. tsi.difference_count AS difference_count,
  19. tsi.difference_reason AS difference_reason
  20. FROM
  21. task_stocktaking_item tsi
  22. LEFT JOIN jsh_material_extend me ON tsi.material_item_id = me.id
  23. LEFT JOIN jsh_material m ON me.material_id = m.id
  24. LEFT JOIN jsh_material_category mc ON mc.id = m.category_id
  25. LEFT JOIN jsh_supplier s ON me.supplier_id = s.id
  26. LEFT JOIN jsh_depot d ON me.depot_id = d.id
  27. WHERE
  28. tsi.delete_flag = 0
  29. AND tsi.task_stocktaking_id = #{taskStocktakingId}
  30. ORDER BY
  31. tsi.oper_time DESC,
  32. tsi.id DESC
  33. </select>
  34. <select id="pdaList" resultType="com.jsh.erp.datasource.pda.vo.PDATaskStocktakingItemVO">
  35. SELECT
  36. me.position AS position,
  37. mc.`name` AS category_name,
  38. m.`name` AS material_name,
  39. m.standard AS standard,
  40. u.username AS creator_name,
  41. tsi.oper_time AS oper_time,
  42. me.inventory AS inventory,
  43. tsi.new_inventory AS new_inventory
  44. FROM
  45. task_stocktaking_item tsi
  46. LEFT JOIN jsh_material_extend me ON tsi.material_item_id = me.id
  47. LEFT JOIN jsh_material m ON me.material_id = m.id
  48. LEFT JOIN jsh_material_category mc ON m.category_id = mc.id
  49. LEFT JOIN jsh_user u ON u.id = tsi.creator
  50. WHERE
  51. tsi.delete_flag = 0
  52. AND tsi.task_stocktaking_id = #{taskId}
  53. ORDER BY
  54. tsi.oper_time DESC,
  55. tsi.id DESC
  56. </select>
  57. </mapper>