1
0

ThirdMerchantBizDao.xml 6.4 KB

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