SparePickFormMapper.xml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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.platform.dao.mapper.store.SparePickFormMapper">
  4. <sql id="Base_Column_List">
  5. sparepickform.id,
  6. sparepickform.pick_no,
  7. sparepickform.type,
  8. sparepickform.store_id,
  9. sparepickform.repair_id,
  10. sparepickform.repair_no,
  11. sparepickform.total_price,
  12. sparepickform.reason,
  13. sparepickform.remark,
  14. sparepickform.status,
  15. sparepickform.pick_user_id,
  16. sparepickform.pick_user_name,
  17. sparepickform.created_user_id,
  18. sparepickform.created_user_name,
  19. sparepickform.update_user_id,
  20. sparepickform.update_user_name,
  21. sparepickform.created_time,
  22. sparepickform.update_time
  23. </sql>
  24. <sql id="Ref_Column_List">
  25. sparepickform.pick_no,
  26. sparepickform.type,
  27. sparepickform.total_price,
  28. sparepickform.store_id,
  29. sparepickform.repair_id,
  30. sparepickform.pick_user_id,
  31. sparepickform.pick_user_name,
  32. sparepickform.repair_no,
  33. sparepickform.reason,
  34. sparepickform.remark,
  35. sparepickform.status,
  36. </sql>
  37. <sql id="List_Condition">
  38. <if test="id != null and id != ''">
  39. and sparepickform.id = #{id}
  40. </if>
  41. <if test="storeId != null and storeId != ''">
  42. and sparepickform.store_id = #{storeId}
  43. </if>
  44. <if test="pickNo != null and pickNo != ''">
  45. and sparepickform.pick_no = #{pickNo}
  46. </if>
  47. <if test="type != null">
  48. and sparepickform.type = #{type}
  49. </if>
  50. <if test="repairId != null and repairId != ''">
  51. and sparepickform.repair_id = #{repairId}
  52. </if>
  53. <if test="repairNo != null and repairNo != ''">
  54. and sparepickform.repair_no = #{repairNo}
  55. </if>
  56. <if test="reason != null and reason != ''">
  57. and sparepickform.reason = #{reason}
  58. </if>
  59. <if test="remark != null and remark != ''">
  60. and sparepickform.remark = #{remark}
  61. </if>
  62. <if test="status != null">
  63. and sparepickform.status = #{status}
  64. </if>
  65. <if test="pickUserId != null and pickUserId != ''">
  66. and sparepickform.pick_user_id = #{pickUserId}
  67. </if>
  68. <if test="pickUserName != null and pickUserName != ''">
  69. and sparepickform.pick_user_name = #{pickUserName}
  70. </if>
  71. <if test="createdUserId != null and createdUserId != ''">
  72. and sparepickform.created_user_id = #{createdUserId}
  73. </if>
  74. <if test="createdUserName != null and createdUserName != ''">
  75. and sparepickform.created_user_name = #{createdUserName}
  76. </if>
  77. <if test="updateUserId != null and updateUserId != ''">
  78. and sparepickform.update_user_id = #{updateUserId}
  79. </if>
  80. <if test="updateUserName != null and updateUserName != ''">
  81. and sparepickform.update_user_name = #{updateUserName}
  82. </if>
  83. <if test="createdTimeStart != null">
  84. and sparepickform.created_time <![CDATA[>=]]>; #{createdTimeStart}
  85. </if>
  86. <if test="createdTimeEnd != null">
  87. and sparepickform.created_time <![CDATA[<=]]> #{createdTimeEnd}
  88. </if>
  89. <if test="createdTime != null">
  90. and sparepickform.created_time = #{createdTime}
  91. </if>
  92. <if test="updateTimeStart != null">
  93. and sparepickform.update_time <![CDATA[>=]]>; #{updateTimeStart}
  94. </if>
  95. <if test="updateTimeEnd != null">
  96. and sparepickform.update_time <![CDATA[<=]]> #{updateTimeEnd}
  97. </if>
  98. <if test="updateTime != null">
  99. and sparepickform.update_time = #{updateTime}
  100. </if>
  101. <if test="keyword != null and keyword != ''">
  102. and sparepickform.no like concat('%',#{keyword},'%')
  103. </if>
  104. </sql>
  105. <select id="selectList" parameterType="com.platform.dao.dto.store.SparePickFormDTO"
  106. resultType="com.platform.dao.vo.query.store.SparePickFormVO">
  107. select sparepickform.*, store.name storeName
  108. from t_spare_pick_form as sparepickform
  109. left join t_store store on store.id = sparepickform.store_id
  110. <where>
  111. <include refid="List_Condition"/>
  112. </where>
  113. </select>
  114. <select id="selectDetailList" parameterType="com.platform.dao.dto.store.SparePickFormDTO"
  115. resultType="com.platform.dao.vo.query.store.SparePickDetailVO">
  116. select detail.*, store.name storeName,sparestore.num as storeNum,
  117. spareinfo.name spareName,
  118. spareinfo.ggxh ggxh,
  119. spareinfo.no,
  120. spareinfo.init_no initNo
  121. from t_spare_pick_detail detail
  122. left join t_spare_pick_form form on form.id = detail.pick_id
  123. left join t_store store on store.id = detail.store_id
  124. left join t_spare_part_info spareinfo on spareinfo.id = detail.spare_id
  125. left join t_spare_store sparestore on sparestore.spare_id = detail.spare_id and sparestore.store_id = detail.store_id
  126. where form.id = #{id}
  127. </select>
  128. </mapper>