HyReleaseGoodsInfoMapper.xml 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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.yh.saas.plugin.yiliangyiyun.mapper.HyReleaseGoodsInfoMapper">
  4. <select id="getCountByCondition" parameterType="Map" resultType="java.lang.Integer">
  5. SELECT
  6. COUNT(id)
  7. FROM hy_release_goods_info
  8. WHERE 1=1
  9. <if test="commonId != null and commonId != ''">
  10. AND common_id = #{commonId}
  11. </if>
  12. <if test="loadingPlaceCity != null and loadingPlaceCity != ''">
  13. AND (lower(send_city) like lower(CONCAT('%',#{loadingPlaceCity},'%')))
  14. </if>
  15. <if test="unLoadingPlaceCity != null and unLoadingPlaceCity != ''">
  16. AND (lower(unload_city) like lower(CONCAT('%',#{unLoadingPlaceCity},'%')))
  17. </if>
  18. <if test="loadingPlace != null and loadingPlace != ''">
  19. AND send_area in (${loadingPlace})
  20. </if>
  21. <if test="unLoadingPlace != null and unLoadingPlace != ''">
  22. AND unload_area in (${unLoadingPlace})
  23. </if>
  24. <if test="searchType != null and searchType != ''">
  25. <if test="searchType == 1">
  26. AND status!='已下架' and delete_flag = '0'
  27. </if>
  28. <if test="searchType == 2">
  29. AND delete_flag = '0'
  30. </if>
  31. <if test="searchType == 3">
  32. AND often_flag = '1'
  33. </if>
  34. </if>
  35. </select>
  36. <select id="getListByCondition" parameterType="Map" resultType="com.yh.saas.plugin.yiliangyiyun.entity.HyReleaseGoodsInfo">
  37. SELECT
  38. id,
  39. common_id as commonId,
  40. send_private as sendPrivate,
  41. send_city as sendCity,
  42. send_area as sendArea,
  43. send_detailed_address as sendDetailedAddress,
  44. send_longitude as sendLongitude,
  45. send_latitude as sendLatitude,
  46. unsend_longitude as unsendLongitude,
  47. unsend_latitude as unsendLatitude,
  48. unload_private as unloadPrivate,
  49. unload_city as unloadCity,
  50. unload_area as unloadArea,
  51. unload_detailed_address as unloadDetailedAddress,
  52. cargo_distance as cargoDistance,
  53. goods_name as goodsName,
  54. package_type as packageType,
  55. measuring_method as measuringMethod,
  56. weight,
  57. volume,
  58. expected_num as expectedNum,
  59. billing_method as billingMethod,
  60. freight_price as freightPrice,
  61. contacts,
  62. contacts_phone as contactsPhone,
  63. freight_station_name as freightStationName,
  64. period_of_time as periodOfTime,
  65. loading_date as loadingDate,
  66. car_length as carLength,
  67. remark,
  68. station_fee as stationFee,
  69. often_flag as oftenFlag,
  70. car_model as carModel,
  71. status,
  72. create_date as createDate,
  73. update_date as updateDate
  74. FROM hy_release_goods_info
  75. WHERE 1=1
  76. <if test="commonId != null and commonId != ''">
  77. AND common_id = #{commonId}
  78. </if>
  79. <if test="loadingPlaceCity != null and loadingPlaceCity != ''">
  80. AND (lower(send_city) like lower(CONCAT('%',#{loadingPlaceCity},'%')))
  81. </if>
  82. <if test="unLoadingPlaceCity != null and unLoadingPlaceCity != ''">
  83. AND (lower(unload_city) like lower(CONCAT('%',#{unLoadingPlaceCity},'%')))
  84. </if>
  85. <if test="loadingPlace != null and loadingPlace != ''">
  86. AND send_area in (${loadingPlace})
  87. </if>
  88. <if test="unLoadingPlace != null and unLoadingPlace != ''">
  89. AND unload_area in (${unLoadingPlace})
  90. </if>
  91. <if test="searchType != null and searchType != ''">
  92. <if test="searchType == 1">
  93. AND status!='已下架' and delete_flag = '0'
  94. </if>
  95. <if test="searchType == 2">
  96. AND delete_flag = '0'
  97. </if>
  98. <if test="searchType == 3">
  99. AND often_flag = '1'
  100. </if>
  101. </if>
  102. ORDER BY update_date DESC
  103. <if test="currentPage != null and currentPage != ''">
  104. LIMIT ${startRecord}, ${pageSize}
  105. </if>
  106. </select>
  107. <select id="getAllListsByCondition" parameterType="Map" resultType="com.yh.saas.plugin.yiliangyiyun.entity.HyReleaseGoodsInfo">
  108. SELECT
  109. id,
  110. common_id as commonId,
  111. send_private as sendPrivate,
  112. send_city as sendCity,
  113. send_area as sendArea,
  114. send_detailed_address as sendDetailedAddress,
  115. send_longitude as sendLongitude,
  116. send_latitude as sendLatitude,
  117. unsend_longitude as unsendLongitude,
  118. unsend_latitude as unsendLatitude,
  119. unload_private as unloadPrivate,
  120. unload_city as unloadCity,
  121. unload_area as unloadArea,
  122. unload_detailed_address as unloadDetailedAddress,
  123. cargo_distance as cargoDistance,
  124. goods_name as goodsName,
  125. package_type as packageType,
  126. measuring_method as measuringMethod,
  127. weight,
  128. volume,
  129. expected_num as expectedNum,
  130. billing_method as billingMethod,
  131. freight_price as freightPrice,
  132. contacts,
  133. contacts_phone as contactsPhone,
  134. freight_station_name as freightStationName,
  135. period_of_time as periodOfTime,
  136. loading_date as loadingDate,
  137. car_length as carLength,
  138. remark,
  139. station_fee as stationFee,
  140. often_flag as oftenFlag,
  141. car_model as carModel,
  142. status,
  143. create_date as createDate,
  144. update_date as updateDate
  145. FROM hy_release_goods_info
  146. WHERE 1=1
  147. <if test="commonId != null and commonId != ''">
  148. AND common_id = #{commonId}
  149. </if>
  150. <if test="loadingPlaceCity != null and loadingPlaceCity != '' and loadingPlace == null and loadingPlace == ''">
  151. AND (lower(send_city) not like lower(CONCAT('%',#{loadingPlaceCity},'%')))
  152. </if>
  153. <if test="unLoadingPlaceCity != null and unLoadingPlaceCity != '' and unLoadingPlace == null and unLoadingPlace == ''">
  154. AND (lower(unload_city) not like lower(CONCAT('%',#{unLoadingPlaceCity},'%')))
  155. </if>
  156. <if test="loadingPlace != null and loadingPlace != ''">
  157. AND send_area not in (${loadingPlace})
  158. </if>
  159. <if test="unLoadingPlace != null and unLoadingPlace != ''">
  160. AND unload_area not in (${unLoadingPlace})
  161. </if>
  162. <if test="searchType != null and searchType != ''">
  163. <if test="searchType == 1">
  164. AND status!='已下架' and delete_flag = '0'
  165. </if>
  166. <if test="searchType == 2">
  167. AND delete_flag = '0'
  168. </if>
  169. <if test="searchType == 3">
  170. AND often_flag = '1'
  171. </if>
  172. </if>
  173. ORDER BY update_date DESC
  174. <if test="currentPage != null and currentPage != ''">
  175. LIMIT ${startRecord}, ${pageSize}
  176. </if>
  177. </select>
  178. </mapper>