123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338 |
- <?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.StoreDao">
- <resultMap type="com.kmall.admin.entity.StoreEntity" id="storeMap">
- <result property="id" column="id"/>
- <result property="merchSn" column="merch_sn"/>
- <result property="merchName" column="merch_name"/>
- <result property="storeName" column="store_name"/>
- <result property="storeNumber" column="store_number"/>
- <result property="storeAddress" column="store_address"/>
- <result property="provinceName" column="province_name"/>
- <result property="cityName" column="city_name"/>
- <result property="countyName" column="county_name"/>
- <result property="latitude" column="latitude"/>
- <result property="longitude" column="longitude"/>
- <result property="coverRadius" column="cover_radius"/>
- <result property="remark" column="remark"/>
- <result column="creater_sn" property="createrSn"/>
- <result column="create_time" property="createTime"/>
- <result column="moder_sn" property="moderSn"/>
- <result column="mod_time" property="modTime"/>
- <result column="tstm" property="tstm"/>
- <result property="thirdPartyMerchCode" column="third_party_merch_code"/>
- <result property="thirdPartyMerchName" column="third_party_merch_name"/>
- <result property="exprAgreementType" column="expr_agreement_type"/>
- <result property="isValid" column="is_valid"/>
- </resultMap>
- <select id="queryObject" resultType="com.kmall.admin.entity.StoreEntity">
- select
- `id`,
- `merch_sn`,
- `merch_name`,
- `store_name`,
- `store_number`,
- `store_address`,
- `province_name`,
- `city_name`,
- `county_name`,
- `latitude`,
- `longitude`,
- `cover_radius`,expr_agreement_type,
- `remark`,merch_sn, merch_name, creater_sn, create_time,third_party_merch_code,third_party_merch_name,
- moder_sn, mod_time, tstm,is_valid,store_img_url as storeImgUrl
- from mall_store
- where id = #{id}
- </select>
- <select id="queryStoreByAll" resultType="com.kmall.admin.entity.StoreEntity">
- select
- `id`,
- `merch_sn`,
- `merch_name`,
- `store_name`,
- `store_number`,
- `store_address`,
- `province_name`,
- `city_name`,
- `county_name`,
- `latitude`,
- `longitude`,
- `cover_radius`,expr_agreement_type,
- `remark`,merch_sn, merch_name, creater_sn, create_time,third_party_merch_code,third_party_merch_name,
- moder_sn, mod_time, tstm,is_valid
- from mall_store
- </select>
- <select id="queryObjectByName" resultType="com.kmall.admin.entity.StoreEntity">
- select
- `id`,
- `merch_sn`,
- `merch_name`,
- `store_name`,
- `store_number`,
- `store_address`,
- `province_name`,
- `city_name`,
- `county_name`,
- `latitude`,
- `longitude`,
- `cover_radius`,expr_agreement_type,
- `remark`,merch_sn, merch_name, creater_sn, create_time,third_party_merch_code,third_party_merch_name,
- moder_sn, mod_time, tstm,is_valid
- from mall_store
- where store_name = #{storeName}
- </select>
- <select id="queryObjectByNumber" resultType="com.kmall.admin.entity.StoreEntity">
- select
- `id`,
- `merch_sn`,
- `merch_name`,
- `store_name`,
- `store_number`,
- `store_address`,
- `province_name`,
- `city_name`,
- `county_name`,
- `latitude`,
- `longitude`,
- `cover_radius`,expr_agreement_type,
- `remark`,merch_sn, merch_name, creater_sn, create_time,third_party_merch_code,third_party_merch_name,
- moder_sn, mod_time, tstm,is_valid
- from mall_store
- where store_number = #{storeNumber}
- </select>
- <!--<select id="queryObjectByDistId" resultType="com.kmall.admin.entity.StoreEntity">-->
- <!--select-->
- <!--`id`,-->
- <!--`merch_sn`,-->
- <!--`merch_name`,-->
- <!--`store_name`,-->
- <!--`store_number`,-->
- <!--`store_address`,-->
- <!--`province_name`,-->
- <!--`city_name`,-->
- <!--`county_name`,-->
- <!--`latitude`,-->
- <!--`longitude`,-->
- <!--`cover_radius`,expr_agreement_type,-->
- <!--`remark`,merch_sn, merch_name, creater_sn, create_time,third_party_merch_code,third_party_merch_name,-->
- <!--moder_sn, mod_time, tstm,is_valid,dist_id-->
- <!--from mall_store-->
- <!--where dist_id = #{distId}-->
- <!--</select>-->
- <select id="queryList" resultType="com.kmall.admin.entity.StoreEntity">
- select
- s.`id`,
- s.`merch_sn`,
- s.`merch_name`,
- s.`store_name`,
- s.`store_number`,
- s.`store_address`,
- s.`province_name`,
- s.`city_name`,
- s.`county_name`,
- s.`latitude`,
- s.`longitude`,
- s.`cover_radius`,
- s.`remark`,s.merch_sn, s.merch_name, s.creater_sn, s.create_time,s.third_party_merch_code,t.third_party_merch_name,s.expr_agreement_type,
- s.moder_sn, s.mod_time, s.tstm,s.is_valid,s.store_img_url as storeImgUrl
- from mall_store s left join third_merchant_biz t on s.third_party_merch_code = t.third_party_merch_code
- WHERE 1=1
- <if test="merchSn != null and merchSn.trim() != ''">
- AND s.merch_sn = #{merchSn}
- </if>
- <if test="storeName != null and storeName.trim() != ''">
- AND s.store_name LIKE concat('%',#{storeName},'%')
- </if>
- <if test="storeNumber != null and storeNumber.trim() != ''">
- AND s.store_number LIKE concat('%',#{storeNumber},'%')
- </if>
- <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
- AND s.third_party_merch_code = #{thirdPartyMerchCode}
- </if>
- <if test="thirdMerchSn != null and thirdMerchSn.trim() != ''">
- AND t.third_merch_sn = #{thirdMerchSn}
- </if>
- <if test="isSupplierGoods != null and isSupplierGoods.trim() != ''">
- AND t.is_supplier_goods = #{isSupplierGoods}
- </if>
- <if test="isValid != null and isValid.trim() != ''">
- AND s.is_valid = #{isValid}
- </if>
- <if test="id != null">
- AND s.id = #{id}
- </if>
- <choose>
- <when test="sidx != null and sidx.trim() != ''">
- order by ${sidx} ${order}
- </when>
- <otherwise>
- order by s.id desc
- </otherwise>
- </choose>
- <if test="offset != null and limit != null">
- limit #{offset}, #{limit}
- </if>
- </select>
- <select id="queryTotal" resultType="int">
- select count(*) from mall_store s left join third_merchant_biz t on s.third_party_merch_code = t.third_party_merch_code
- WHERE 1=1
- <if test="merchSn != null and merchSn.trim() != ''">
- AND s.merch_sn = #{merchSn}
- </if>
- <if test="storeName != null and storeName.trim() != ''">
- AND s.store_name LIKE concat('%',#{storeName},'%')
- </if>
- <if test="storeNumber != null and storeNumber.trim() != ''">
- AND s.store_number LIKE concat('%',#{storeNumber},'%')
- </if>
- <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
- AND s.third_party_merch_code = #{thirdPartyMerchCode}
- </if>
- <if test="thirdMerchSn != null and thirdMerchSn.trim() != ''">
- AND t.third_merch_sn = #{thirdMerchSn}
- </if>
- <if test="id != null">
- AND s.id = #{id}
- </if>
- </select>
- <insert id="save" parameterType="com.kmall.admin.entity.StoreEntity" useGeneratedKeys="true" keyProperty="id">
- insert into mall_store(
- `merch_sn`,
- `merch_name`,
- `store_name`,
- `store_number`,
- `store_address`,
- `province_name`,
- `city_name`,
- `county_name`,
- `latitude`,
- `longitude`,
- `cover_radius`,
- is_valid,
- `remark`,
- third_party_merch_code,
- third_party_merch_name,
- expr_agreement_type,
- creater_sn,
- create_time,
- moder_sn,
- mod_time,
- store_img_url
- )
- values(
- #{merchSn},
- #{merchName},
- #{storeName},
- #{storeNumber},
- #{storeAddress},
- #{provinceName},
- #{cityName},
- #{countyName},
- #{latitude},
- #{longitude},
- #{coverRadius},
- #{isValid},
- #{remark},
- #{thirdPartyMerchCode},
- #{thirdPartyMerchName},
- #{exprAgreementType},
- #{createrSn},
- #{createTime},
- #{moderSn},
- #{modTime},
- #{storeImgUrl}
- )
- </insert>
- <update id="update" parameterType="com.kmall.admin.entity.StoreEntity">
- update mall_store
- <set>
- <if test="merchSn != null">`merch_sn` = #{merchSn}, </if>
- <if test="merchName != null">`merch_name` = #{merchName}, </if>
- <if test="storeName != null">`store_name` = #{storeName}, </if>
- <if test="storeNumber != null">`store_number` = #{storeNumber}, </if>
- <if test="storeAddress != null">`store_address` = #{storeAddress}, </if>
- <if test="provinceName != null">`province_name` = #{provinceName}, </if>
- <if test="cityName != null">`city_name` = #{cityName}, </if>
- <if test="countyName != null">`county_name` = #{countyName}, </if>
- <if test="latitude != null">`latitude` = #{latitude}, </if>
- <if test="longitude != null">`longitude` = #{longitude}, </if>
- <if test="coverRadius != null">`cover_radius` = #{coverRadius}, </if>
- <if test="isValid != null">`is_valid` = #{isValid}, </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="thirdPartyMerchCode != null" >third_party_merch_code = #{thirdPartyMerchCode},</if>
- <if test="thirdPartyMerchName != null" >third_party_merch_name = #{thirdPartyMerchName},</if>
- <if test="exprAgreementType != null" >expr_agreement_type = #{exprAgreementType},</if>
- <if test="moderSn != null" >moder_sn = #{moderSn},</if>
- <if test="modTime != null" >mod_time = #{modTime},</if>
- <if test="tstm != null" >tstm = #{tstm},</if>
- <if test="storeImgUrl != null" >store_img_url = #{storeImgUrl}</if>
- </set>
- where id = #{id}
- </update>
- <delete id="delete">
- delete from mall_store where id = #{value}
- </delete>
- <delete id="deleteBatch">
- delete from mall_store where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <select id="queryExportList" resultType="com.kmall.admin.entity.StoreEntity">
- select
- s.`id`,
- s.`merch_sn`,
- s.`merch_name`,
- s.`store_name`,
- s.`store_number`,
- s.`store_address`,
- s.`province_name`,
- s.`city_name`,
- s.`county_name`,
- s.`latitude`,
- s.`longitude`,
- s.`cover_radius`,
- s.`remark`,s.merch_sn, s.merch_name, s.creater_sn, s.create_time,s.third_party_merch_code,t.third_party_merch_name,s.expr_agreement_type,
- s.moder_sn, s.mod_time, s.tstm,s.is_valid
- from mall_store s left join third_merchant_biz t on s.third_party_merch_code = t.third_party_merch_code
- WHERE 1=1
- <if test="merchSn != null and merchSn.trim() != ''">
- AND s.merch_sn = #{merchSn}
- </if>
- <if test="storeName != null and storeName.trim() != ''">
- AND s.store_name LIKE concat('%',#{storeName},'%')
- </if>
- <if test="storeNumber != null and storeNumber.trim() != ''">
- AND s.store_number LIKE concat('%',#{storeNumber},'%')
- </if>
- <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
- AND s.third_party_merch_code = #{thirdPartyMerchCode}
- </if>
- <if test="thirdMerchSn != null and thirdMerchSn.trim() != ''">
- AND t.third_merch_sn = #{thirdMerchSn}
- </if>
- <if test="isSupplierGoods != null and isSupplierGoods.trim() != ''">
- AND t.is_supplier_goods = #{isSupplierGoods}
- </if>
- <if test="id != null">
- AND s.id = #{id}
- </if>
- </select>
- </mapper>
|