CmSecondHandDetailMapper.xml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  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.caimei.modules.product.dao.CmSecondHandDetailDao">
  4. <sql id="cmSecondHandDetailColumns">
  5. a.id AS "id",
  6. a.productID AS "productID",
  7. a.sold AS "sold",
  8. a.secondHandType AS "secondHandType",
  9. a.instrumentType AS "instrumentType",
  10. a.fixedYears AS "fixedYears",
  11. a.maturityYears AS "maturityYears",
  12. a.companyName AS "companyName",
  13. a.detailTalkFlag AS "detailTalkFlag",
  14. a.originalPrice AS "originalPrice",
  15. a.contactName AS "contactName",
  16. a.contactMobile AS "contactMobile",
  17. a.dockingPeopleName AS "dockingPeopleName",
  18. a.dockingPeopleMobile AS "dockingPeopleMobile",
  19. a.secondProductType AS "secondProductType",
  20. a.provinceCityDistrict AS "provinceCityDistrict",
  21. a.townId as "townId",
  22. a.address AS "address",
  23. a.productQuality AS "productQuality",
  24. a.productDetails AS "productDetails",
  25. a.viewingNum AS "viewingNum",
  26. a.brandName AS "brandName",
  27. a.payStatus AS "payStatus",
  28. a.payAmount AS "payAmount",
  29. a.payFormData AS "payFormData",
  30. a.payType AS "payType",
  31. a.payDate AS "payDate",
  32. a.submitDate AS "submitDate",
  33. a.reviewedDate AS "reviewedDate",
  34. a.onLineDate AS "onLineDate",
  35. a.source AS "source",
  36. a.showContactFlag AS "showContactFlag",
  37. a.publisher AS "publisher",
  38. a.authenticationImage AS "authenticationImage",
  39. a.fileName AS "fileName",
  40. a.ossName AS "ossName",
  41. a.commitmentImage AS "commitmentImage",
  42. p.validFlag AS "validFlag",
  43. p.productCategory AS "productCategory",
  44. p.name AS "name",
  45. p.normalPrice AS "normalPrice",
  46. p.price1 AS "price1",
  47. p.stock AS "stock",
  48. p.brandID AS "brandID",
  49. p.costPrice as "costPrice",
  50. p.costCheckFlag AS "costCheckFlag",
  51. p.costProportional AS "costProportional",
  52. p.visibility AS "visibility"
  53. </sql>
  54. <sql id="cmSecondHandDetailJoins">
  55. left join product p on p.productID = a.productID
  56. </sql>
  57. <select id="get" resultType="CmSecondHandDetail">
  58. SELECT
  59. <include refid="cmSecondHandDetailColumns"/>
  60. FROM cm_second_hand_detail a
  61. <include refid="cmSecondHandDetailJoins"/>
  62. WHERE a.productID = #{id}
  63. </select>
  64. <select id="findList" resultType="CmSecondHandDetail">
  65. SELECT
  66. <include refid="cmSecondHandDetailColumns"/>
  67. FROM cm_second_hand_detail a
  68. <include refid="cmSecondHandDetailJoins"/>
  69. <where>
  70. <if test="productID != null and productID != ''">
  71. AND a.productID = #{productID}
  72. </if>
  73. </where>
  74. <choose>
  75. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  76. ORDER BY ${page.orderBy}
  77. </when>
  78. <otherwise>
  79. </otherwise>
  80. </choose>
  81. </select>
  82. <select id="findAllList" resultType="CmSecondHandDetail">
  83. SELECT
  84. <include refid="cmSecondHandDetailColumns"/>
  85. FROM cm_second_hand_detail a
  86. <include refid="cmSecondHandDetailJoins"/>
  87. <where>
  88. </where>
  89. <choose>
  90. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  91. ORDER BY ${page.orderBy}
  92. </when>
  93. <otherwise>
  94. </otherwise>
  95. </choose>
  96. </select>
  97. <insert id="insert" parameterType="CmSecondHandDetail" keyProperty="id" useGeneratedKeys="true">
  98. INSERT INTO cm_second_hand_detail(
  99. productID,
  100. sold,
  101. secondHandType,
  102. instrumentType,
  103. fixedYears,
  104. maturityYears,
  105. companyName,
  106. detailTalkFlag,
  107. originalPrice,
  108. contactName,
  109. contactMobile,
  110. dockingPeopleName,
  111. dockingPeopleMobile,
  112. secondProductType,
  113. provinceCityDistrict,
  114. townId,
  115. address,
  116. productQuality,
  117. productDetails,
  118. viewingNum,
  119. brandName,
  120. payStatus,
  121. payAmount,
  122. payFormData,
  123. payType,
  124. payDate,
  125. submitDate,
  126. reviewedDate,
  127. onLineDate,
  128. source,
  129. showContactFlag,
  130. publisher,
  131. authenticationImage,
  132. fileName,
  133. ossName,
  134. commitmentImage
  135. ) VALUES (
  136. #{productID},
  137. #{sold},
  138. #{secondHandType},
  139. #{instrumentType},
  140. #{fixedYears},
  141. #{maturityYears},
  142. #{companyName},
  143. #{detailTalkFlag},
  144. #{originalPrice},
  145. #{contactName},
  146. #{contactMobile},
  147. #{dockingPeopleName},
  148. #{dockingPeopleMobile},
  149. #{secondProductType},
  150. #{provinceCityDistrict},
  151. #{townId},
  152. #{address},
  153. #{productQuality},
  154. #{productDetails},
  155. #{viewingNum},
  156. #{brandName},
  157. #{payStatus},
  158. #{payAmount},
  159. #{payFormData},
  160. #{payType},
  161. #{payDate},
  162. #{submitDate},
  163. #{reviewedDate},
  164. #{onLineDate},
  165. #{source},
  166. #{showContactFlag},
  167. #{publisher},
  168. #{authenticationImage},
  169. #{fileName},
  170. #{ossName},
  171. #{commitmentImage}
  172. )
  173. </insert>
  174. <update id="update">
  175. UPDATE cm_second_hand_detail SET
  176. productID = #{productID},
  177. sold = #{sold},
  178. secondHandType = #{secondHandType},
  179. instrumentType = #{instrumentType},
  180. fixedYears = #{fixedYears},
  181. maturityYears = #{maturityYears},
  182. companyName = #{companyName},
  183. detailTalkFlag = #{detailTalkFlag},
  184. originalPrice = #{originalPrice},
  185. contactName = #{contactName},
  186. contactMobile = #{contactMobile},
  187. dockingPeopleName = #{dockingPeopleName},
  188. dockingPeopleMobile = #{dockingPeopleMobile},
  189. secondProductType = #{secondProductType},
  190. provinceCityDistrict = #{provinceCityDistrict},
  191. townId = #{townId},
  192. address = #{address},
  193. productQuality = #{productQuality},
  194. productDetails = #{productDetails},
  195. viewingNum = #{viewingNum},
  196. brandName = #{brandName},
  197. payStatus = #{payStatus},
  198. payAmount = #{payAmount},
  199. payFormData = #{payFormData},
  200. payType = #{payType},
  201. payDate = #{payDate},
  202. submitDate = #{submitDate},
  203. reviewedDate = #{reviewedDate},
  204. onLineDate = #{onLineDate},
  205. source = #{source},
  206. showContactFlag = #{showContactFlag},
  207. publisher = #{publisher},
  208. authenticationImage = #{authenticationImage},
  209. fileName = #{fileName},
  210. ossName = #{ossName},
  211. commitmentImage = #{commitmentImage}
  212. WHERE productID = #{productID}
  213. </update>
  214. <update id="updateRevieweInfo">
  215. UPDATE cm_second_hand_detail SET
  216. reviewedDate = #{reviewedDate},
  217. onLineDate = #{onLineDate}
  218. WHERE productID = #{productID}
  219. </update>
  220. <update id="updateOnLineDate">
  221. UPDATE cm_second_hand_detail SET
  222. onLineDate = #{date}
  223. WHERE productID = #{productID}
  224. </update>
  225. <update id="updatSecondHnadproductSold">
  226. UPDATE cm_second_hand_detail SET sold = 1 where productID = #{productID}
  227. </update>
  228. <delete id="delete">
  229. DELETE FROM cm_second_hand_detail
  230. WHERE productID = #{productID}
  231. </delete>
  232. <update id="updatSecondHnadBySold">
  233. UPDATE cm_second_hand_detail SET sold = 0 WHERE productID = #{productID}
  234. </update>
  235. </mapper>