123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165 |
- <?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.admin.dao.ThirdMerchExpressDao">
- <resultMap type="com.kmall.admin.entity.ThirdMerchExpressEntity" id="thirdMerchExpressMap">
- <result property="id" column="id"/>
- <result property="expressAccount" column="express_account"/>
- <result property="expressPwd" column="express_pwd"/>
- <result property="expressCusId" column="express_cus_id"/>
- <result property="thirdPartyMerchCode" column="third_party_merch_code"/>
- <result property="remark" column="remark"/>
- <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="thirdPartyMerchName" column="thirdPartyMerchName"/>
- </resultMap>
- <select id="queryObject" resultType="com.kmall.admin.entity.ThirdMerchExpressEntity">
- select
- `id`,
- `express_account`,
- `express_pwd`,
- `express_cus_id`,
- `third_party_merch_code`,
- `remark`,
- `creater_sn`,
- `create_time`,
- `moder_sn`,
- `mod_time`,
- `tstm`
- from third_merch_express
- where id = #{id}
- </select>
- <select id="getThirdMerchExpressByThirdCode" resultType="com.kmall.admin.entity.ThirdMerchExpressEntity">
- select
- e.`id`,
- e.`express_account`,
- e.`express_pwd`,
- e.`express_cus_id`,
- e.`third_party_merch_code`,
- e.`remark`,
- e.`creater_sn`,
- e.`create_time`,
- e.`moder_sn`,
- e.`mod_time`,
- e.`tstm`,
- b.third_party_merch_name thirdPartyMerchName
- from third_merch_express e left join third_merchant_biz b on e.third_party_merch_code = b.third_party_merch_code
- where e.third_party_merch_code = #{thirdPartyMerchCode}
- </select>
- <select id="queryList" resultType="com.kmall.admin.entity.ThirdMerchExpressEntity">
- select
- e.`id`,
- e.`express_account`,
- e.`express_pwd`,
- e.`express_cus_id`,
- e.`third_party_merch_code`,
- e.`remark`,
- e.`creater_sn`,
- e.`create_time`,
- e.`moder_sn`,
- e.`mod_time`,
- e.`tstm`,
- b.third_party_merch_name thirdPartyMerchName
- from third_merch_express e
- left join third_merchant_biz b on e.third_party_merch_code = b.third_party_merch_code
- WHERE 1=1
- <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
- AND e.third_party_merch_code = #{thirdPartyMerchCode}
- </if>
- <if test="merchSn != null and merchSn.trim() != ''">
- AND b.merch_sn = #{merchSn}
- </if>
- <if test="storeId != null and storeId != ''">
- AND e.third_party_merch_code = (select third_party_merch_code from mall_store where id = #{storeId})
- </if>
- <choose>
- <when test="sidx != null and sidx.trim() != ''">
- order by ${sidx} ${order}
- </when>
- <otherwise>
- order by id desc
- </otherwise>
- </choose>
- <if test="offset != null and limit != null">
- limit #{offset}, #{limit}
- </if>
- </select>
-
- <select id="queryTotal" resultType="int">
- select count(*)
- from third_merch_express e
- left join third_merchant_biz b on e.third_party_merch_code = b.third_party_merch_code
- WHERE 1=1
- <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
- AND e.third_party_merch_code = #{thirdPartyMerchCode}
- </if>
- <if test="merchSn != null and merchSn.trim() != ''">
- AND b.merch_sn = #{merchSn}
- </if>
- <if test="storeId != null and storeId != ''">
- AND e.third_party_merch_code = (select third_party_merch_code from mall_store where id = #{storeId})
- </if>
- </select>
-
- <insert id="save" parameterType="com.kmall.admin.entity.ThirdMerchExpressEntity" useGeneratedKeys="true" keyProperty="id">
- insert into third_merch_express(
- `express_account`,
- `express_pwd`,
- `express_cus_id`,
- `third_party_merch_code`,
- `remark`,
- `creater_sn`,
- `create_time`,
- `moder_sn`,
- `mod_time`,
- `tstm`)
- values(
- #{expressAccount},
- #{expressPwd},
- #{expressCusId},
- #{thirdPartyMerchCode},
- #{remark},
- #{createrSn},
- #{createTime},
- #{moderSn},
- #{modTime},
- #{tstm})
- </insert>
-
- <update id="update" parameterType="com.kmall.admin.entity.ThirdMerchExpressEntity">
- update third_merch_express
- <set>
- <if test="expressAccount != null">`express_account` = #{expressAccount}, </if>
- <if test="expressPwd != null">`express_pwd` = #{expressPwd}, </if>
- <if test="expressCusId != null">`express_cus_id` = #{expressCusId}, </if>
- <if test="thirdPartyMerchCode != null">`third_party_merch_code` = #{thirdPartyMerchCode}, </if>
- <if test="remark != null">`remark` = #{remark}, </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 id = #{id}
- </update>
-
- <delete id="delete">
- delete from third_merch_express where id = #{value}
- </delete>
-
- <delete id="deleteBatch">
- delete from third_merch_express where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|