1
0

ThirdMerchantBizDao.xml 5.8 KB

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