123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.kmall.api.dao.ApiThirdMerchantBizMapper">
- <resultMap type="com.kmall.api.entity.ThirdMerchantBizVo" id="thirdMerchantBizMap">
- <result property="thirdMerchSn" column="third_merch_sn"/>
- <result property="merchSn" column="merch_sn"/>
- <result property="thirdPartyMerchCode" column="third_party_merch_code"/>
- <result property="thirdPartyMerchName" column="third_party_merch_name"/>
- <result property="isStockShare" column="is_stock_share"/>
- <result property="isStoreUserShare" column="is_store_user_share"/>
- <result property="isValid" column="is_valid"/>
- <result property="createrSn" column="creater_sn"/>
- <result property="createTime" column="create_time"/>
- <result property="moderSn" column="moder_sn"/>
- <result property="modTime" column="mod_time"/>
- <result property="tstm" column="tstm"/>
- <result property="isMapShow" column="is_map_show"/>
- </resultMap>
- <select id="queryObject" resultType="com.kmall.api.entity.ThirdMerchantBizVo">
- select
- `third_merch_sn`,
- `merch_sn`,
- `third_party_merch_code`,
- `third_party_merch_name`,
- `is_valid`,
- is_stock_share,
- is_store_user_share,
- is_map_show,
- `creater_sn`,
- `create_time`,
- `moder_sn`,
- `mod_time`,
- `tstm`
- from third_merchant_biz
- where third_merch_sn = #{id}
- </select>
- <select id="findByMerchSn" resultType="com.kmall.api.entity.ThirdMerchantBizVo">
- select
- `third_merch_sn`,
- `merch_sn`,
- `third_party_merch_code`,
- `third_party_merch_name`,
- `is_valid`,
- is_stock_share,
- is_store_user_share,
- is_map_show,
- `creater_sn`,
- `create_time`,
- `moder_sn`,
- `mod_time`,
- `tstm`
- from third_merchant_biz
- where merch_sn = #{value}
- </select>
- <select id="getThirdMerchangByCode" resultType="com.kmall.api.entity.ThirdMerchantBizVo">
- select
- `third_merch_sn`,
- `merch_sn`,
- `third_party_merch_code`,
- `third_party_merch_name`,
- `is_valid`,
- is_stock_share,
- is_store_user_share,
- is_map_show,
- `creater_sn`,
- `create_time`,
- `moder_sn`,
- `mod_time`,
- `tstm`
- from third_merchant_biz
- where third_party_merch_code = #{thirdMerchantCode}
- </select>
- <select id="queryDataByStoreId" resultType="com.kmall.api.entity.ThirdMerchantBizVo">
- select
- b.`third_merch_sn`,
- b.`merch_sn`,
- b.`third_party_merch_code`,
- b.`third_party_merch_name`,
- b.`is_valid`,
- b.is_stock_share,
- b.is_store_user_share,
- b.is_map_show
- from third_merchant_biz b inner join mall_store s on s.third_party_merch_code=b.third_party_merch_code
- where s.id = #{storeId}
- </select>
- <select id="queryList" resultType="com.kmall.api.entity.ThirdMerchantBizVo">
- select
- `third_merch_sn`,
- `merch_sn`,
- `third_party_merch_code`,
- `third_party_merch_name`,
- `is_valid`,
- is_stock_share,
- is_store_user_share,
- is_map_show,
- `creater_sn`,
- `create_time`,
- `moder_sn`,
- `mod_time`,
- `tstm`
- from third_merchant_biz
- WHERE 1=1
- <if test="name != null and name.trim() != ''">
- AND name LIKE concat('%',#{name},'%')
- </if>
- <if test="merchSn != null and merchSn.trim() != ''">
- and merch_sn = #{merchSn}
- </if>
- <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
- and third_party_merch_code = #{thirdPartyMerchCode}
- </if>
- <choose>
- <when test="sidx != null and sidx.trim() != ''">
- order by ${sidx} ${order}
- </when>
- <otherwise>
- order by third_merch_sn desc
- </otherwise>
- </choose>
- <if test="offset != null and limit != null">
- limit #{offset}, #{limit}
- </if>
- </select>
-
- <select id="queryTotal" resultType="int">
- select count(*) from third_merchant_biz
- WHERE 1=1
- <if test="name != null and name.trim() != ''">
- AND name LIKE concat('%',#{name},'%')
- </if>
- <if test="merchSn != null and merchSn.trim() != ''">
- and merch_sn = #{merchSn}
- </if>
- <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
- and third_party_merch_code = #{thirdPartyMerchCode}
- </if>
- </select>
- <insert id="save" parameterType="com.kmall.api.entity.ThirdMerchantBizVo" useGeneratedKeys="true" keyProperty="thirdMerchSn">
- insert into third_merchant_biz(
- `merch_sn`,
- `third_party_merch_code`,
- `third_party_merch_name`,
- `is_valid`,
- is_stock_share,
- is_store_user_share,
- `creater_sn`,
- `create_time`,
- `moder_sn`,
- `mod_time`,
- `tstm`)
- values(
- #{merchSn},
- #{thirdPartyMerchCode},
- #{thirdPartyMerchName},
- #{isValid},
- #{isStockShare},
- #{isStoreUserShare},
- #{createrSn},
- #{createTime},
- #{moderSn},
- #{modTime},
- #{tstm})
- </insert>
- <update id="update" parameterType="com.kmall.api.entity.ThirdMerchantBizVo">
- update third_merchant_biz
- <set>
- <if test="merchSn != null">`merch_sn` = #{merchSn},</if>
- <if test="thirdPartyMerchCode != null">`third_party_merch_code` = #{thirdPartyMerchCode}, </if>
- <if test="thirdPartyMerchName != null">`third_party_merch_name` = #{thirdPartyMerchName}, </if>
- <if test="isValid != null">`is_valid` = #{isValid}, </if>
- <if test="isStockShare != null">`is_stock_share` = #{isStockShare}, </if>
- <if test="isStoreUserShare != null">`is_store_user_share` = #{isStoreUserShare}, </if>
- <if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
- <if test="createTime != null">`create_time` = #{createTime}, </if>
- <if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
- <if test="modTime != null">`mod_time` = #{modTime}, </if>
- <if test="tstm != null">`tstm` = #{tstm}</if>
- </set>
- where third_merch_sn = #{thirdMerchSn}
- </update>
-
- <delete id="delete">
- delete from third_merchant_biz where third_merch_sn = #{value}
- </delete>
-
- <delete id="deleteBatch">
- delete from third_merchant_biz where third_merch_sn in
- <foreach item="thirdMerchSn" collection="array" open="(" separator="," close=")">
- #{thirdMerchSn}
- </foreach>
- </delete>
- </mapper>
|