1
0

ThirdMerchantBizDao.xml 5.6 KB

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