1
0

ThirdMerchExpressDao.xml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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.kmall.admin.dao.ThirdMerchExpressDao">
  4. <resultMap type="com.kmall.admin.entity.ThirdMerchExpressEntity" id="thirdMerchExpressMap">
  5. <result property="id" column="id"/>
  6. <result property="expressAccount" column="express_account"/>
  7. <result property="expressPwd" column="express_pwd"/>
  8. <result property="expressCusId" column="express_cus_id"/>
  9. <result property="thirdPartyMerchCode" column="third_party_merch_code"/>
  10. <result property="remark" column="remark"/>
  11. <result property="createrSn" column="creater_sn"/>
  12. <result property="createTime" column="create_time"/>
  13. <result property="moderSn" column="moder_sn"/>
  14. <result property="modTime" column="mod_time"/>
  15. <result property="tstm" column="tstm"/>
  16. <result property="thirdPartyMerchName" column="thirdPartyMerchName"/>
  17. </resultMap>
  18. <select id="queryObject" resultType="com.kmall.admin.entity.ThirdMerchExpressEntity">
  19. select
  20. `id`,
  21. `express_account`,
  22. `express_pwd`,
  23. `express_cus_id`,
  24. `third_party_merch_code`,
  25. `remark`,
  26. `creater_sn`,
  27. `create_time`,
  28. `moder_sn`,
  29. `mod_time`,
  30. `tstm`
  31. from third_merch_express
  32. where id = #{id}
  33. </select>
  34. <select id="getThirdMerchExpressByThirdCode" resultType="com.kmall.admin.entity.ThirdMerchExpressEntity">
  35. select
  36. e.`id`,
  37. e.`express_account`,
  38. e.`express_pwd`,
  39. e.`express_cus_id`,
  40. e.`third_party_merch_code`,
  41. e.`remark`,
  42. e.`creater_sn`,
  43. e.`create_time`,
  44. e.`moder_sn`,
  45. e.`mod_time`,
  46. e.`tstm`,
  47. b.third_party_merch_name thirdPartyMerchName
  48. from third_merch_express e left join third_merchant_biz b on e.third_party_merch_code = b.third_party_merch_code
  49. where e.third_party_merch_code = #{thirdPartyMerchCode}
  50. </select>
  51. <select id="queryList" resultType="com.kmall.admin.entity.ThirdMerchExpressEntity">
  52. select
  53. e.`id`,
  54. e.`express_account`,
  55. e.`express_pwd`,
  56. e.`express_cus_id`,
  57. e.`third_party_merch_code`,
  58. e.`remark`,
  59. e.`creater_sn`,
  60. e.`create_time`,
  61. e.`moder_sn`,
  62. e.`mod_time`,
  63. e.`tstm`,
  64. b.third_party_merch_name thirdPartyMerchName
  65. from third_merch_express e
  66. left join third_merchant_biz b on e.third_party_merch_code = b.third_party_merch_code
  67. WHERE 1=1
  68. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  69. AND e.third_party_merch_code = #{thirdPartyMerchCode}
  70. </if>
  71. <if test="merchSn != null and merchSn.trim() != ''">
  72. AND b.merch_sn = #{merchSn}
  73. </if>
  74. <if test="storeId != null and storeId != ''">
  75. AND e.third_party_merch_code = (select third_party_merch_code from mall_store where id = #{storeId})
  76. </if>
  77. <choose>
  78. <when test="sidx != null and sidx.trim() != ''">
  79. order by ${sidx} ${order}
  80. </when>
  81. <otherwise>
  82. order by id desc
  83. </otherwise>
  84. </choose>
  85. <if test="offset != null and limit != null">
  86. limit #{offset}, #{limit}
  87. </if>
  88. </select>
  89. <select id="queryTotal" resultType="int">
  90. select count(*)
  91. from third_merch_express e
  92. left join third_merchant_biz b on e.third_party_merch_code = b.third_party_merch_code
  93. WHERE 1=1
  94. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  95. AND e.third_party_merch_code = #{thirdPartyMerchCode}
  96. </if>
  97. <if test="merchSn != null and merchSn.trim() != ''">
  98. AND b.merch_sn = #{merchSn}
  99. </if>
  100. <if test="storeId != null and storeId != ''">
  101. AND e.third_party_merch_code = (select third_party_merch_code from mall_store where id = #{storeId})
  102. </if>
  103. </select>
  104. <insert id="save" parameterType="com.kmall.admin.entity.ThirdMerchExpressEntity" useGeneratedKeys="true" keyProperty="id">
  105. insert into third_merch_express(
  106. `express_account`,
  107. `express_pwd`,
  108. `express_cus_id`,
  109. `third_party_merch_code`,
  110. `remark`,
  111. `creater_sn`,
  112. `create_time`,
  113. `moder_sn`,
  114. `mod_time`,
  115. `tstm`)
  116. values(
  117. #{expressAccount},
  118. #{expressPwd},
  119. #{expressCusId},
  120. #{thirdPartyMerchCode},
  121. #{remark},
  122. #{createrSn},
  123. #{createTime},
  124. #{moderSn},
  125. #{modTime},
  126. #{tstm})
  127. </insert>
  128. <update id="update" parameterType="com.kmall.admin.entity.ThirdMerchExpressEntity">
  129. update third_merch_express
  130. <set>
  131. <if test="expressAccount != null">`express_account` = #{expressAccount}, </if>
  132. <if test="expressPwd != null">`express_pwd` = #{expressPwd}, </if>
  133. <if test="expressCusId != null">`express_cus_id` = #{expressCusId}, </if>
  134. <if test="thirdPartyMerchCode != null">`third_party_merch_code` = #{thirdPartyMerchCode}, </if>
  135. <if test="remark != null">`remark` = #{remark}, </if>
  136. <if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
  137. <if test="createTime != null">`create_time` = #{createTime}, </if>
  138. <if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
  139. <if test="modTime != null">`mod_time` = #{modTime}, </if>
  140. <if test="tstm != null">`tstm` = #{tstm}</if>
  141. </set>
  142. where id = #{id}
  143. </update>
  144. <delete id="delete">
  145. delete from third_merch_express where id = #{value}
  146. </delete>
  147. <delete id="deleteBatch">
  148. delete from third_merch_express where id in
  149. <foreach item="id" collection="array" open="(" separator="," close=")">
  150. #{id}
  151. </foreach>
  152. </delete>
  153. </mapper>