LongYanPurchaseOrderMapper.xml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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.longyanpurchaseorder.LongYanPurchaseOrderMapper">
  4. <sql id="Base_Column_List">
  5. menu.id,
  6. menu.sb_id,
  7. menu.project_id,
  8. menu.created_user_id,
  9. menu.created_user_name,
  10. menu.created_time,
  11. menu.update_time,
  12. menu.update_user_id,
  13. menu.update_user_name,
  14. menu.type,
  15. menu.order_name,
  16. menu.remark,
  17. menu.position_no,
  18. menu.total_num
  19. </sql>
  20. <sql id="Ref_Column_List">
  21. menu.sb_id,
  22. menu.project_id,
  23. menu.type,
  24. menu.order_name,
  25. menu.remark
  26. </sql>
  27. <sql id="List_Condition">
  28. <if test="id != null and id != ''">
  29. and menu.id = #{id}
  30. </if>
  31. <if test="sbId != null and sbId != ''">
  32. and menu.sb_id = #{sbId}
  33. </if>
  34. <if test="projectId != null and projectId != ''">
  35. and menu.project_id = #{projectId}
  36. </if>
  37. <if test="createdUserId != null and createdUserId != ''">
  38. and menu.created_user_id = #{createdUserId}
  39. </if>
  40. <if test="createdUserName != null and createdUserName != ''">
  41. and menu.created_user_name = #{createdUserName}
  42. </if>
  43. <if test="createdTimeStart != null">
  44. and menu.created_time <![CDATA[>=]]>; #{createdTimeStart}
  45. </if>
  46. <if test="createdTimeEnd != null">
  47. and menu.created_time <![CDATA[<=]]> #{createdTimeEnd}
  48. </if>
  49. <if test="createdTime != null">
  50. and menu.created_time = #{createdTime}
  51. </if>
  52. <if test="updateTimeStart != null">
  53. and menu.update_time <![CDATA[>=]]>; #{updateTimeStart}
  54. </if>
  55. <if test="updateTimeEnd != null">
  56. and menu.update_time <![CDATA[<=]]> #{updateTimeEnd}
  57. </if>
  58. <if test="updateTime != null">
  59. and menu.update_time = #{updateTime}
  60. </if>
  61. <if test="updateUserId != null and updateUserId != ''">
  62. and menu.update_user_id = #{updateUserId}
  63. </if>
  64. <if test="updateUserName != null and updateUserName != ''">
  65. and menu.update_user_name = #{updateUserName}
  66. </if>
  67. <if test="type != null">
  68. and menu.type = #{type}
  69. </if>
  70. <if test="orderName != null and orderName != ''">
  71. and menu.order_name = #{orderName}
  72. </if>
  73. <if test="remark != null and remark != ''">
  74. and menu.remark = #{remark}
  75. </if>
  76. <if test="keyword != null and keyword != ''">
  77. and menu.id like concat(concat('%',#{keyword}),'%')
  78. </if>
  79. <if test="positionNo != null and positionNo != ''">
  80. and menu.position_no= #{positionNo}
  81. </if>
  82. <if test="sbIds!=null and sbIds.size>0">
  83. and menu.sb_id in
  84. <foreach collection="sbIds" item="item" close=")" separator="," open="(">
  85. #{item}
  86. </foreach>
  87. </if>
  88. </sql>
  89. <select id="selectList" parameterType="com.platform.dao.dto.longyanpurchaseorder.LongYanPurchaseOrderDTO" resultType="com.platform.dao.vo.query.longyanpurchaseorder.LongYanPurchaseOrderVO">
  90. select menu.*
  91. from t_long_yan_purchase_order as menu
  92. <where>
  93. <include refid="List_Condition" />
  94. </where>
  95. </select>
  96. <select id="getPurchaseReport" resultType="com.platform.dao.vo.report.LongYanPurchaseOrderReportVO"
  97. parameterType="com.platform.dao.dto.longyanpurchaseorder.LongYanPurchaseOrderDTO">
  98. select type as purchaseType,count(1) as orderTotalNum,sum(total_num) as spareTotalNum
  99. from t_long_yan_purchase_order as orders
  100. <where>
  101. <if test="startTime!=null">
  102. and orders.created_time <![CDATA[>=]]> #{startTime}
  103. </if>
  104. <if test="endTime!=null">
  105. and orders.created_time <![CDATA[<=]]> #{endTime}
  106. </if>
  107. </where>
  108. group by type
  109. </select>
  110. </mapper>