ThirdMerchantBizDao.xml 6.2 KB

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