ThirdMerchantBizDao.xml 5.0 KB

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