123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450 |
- <?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.mk.store.MkStoreTicketDiscountDao">
- <resultMap type="com.kmall.admin.entity.mk.store.MkStoreTicketDiscountEntity" id="mkStoreTicketDiscountMap">
- <result property="tickDiscId" column="tick_disc_id"/>
- <result property="tickDiscType" column="tick_disc_type"/>
- <result property="tickDiscSubTitle" column="tick_disc_sub_title"/>
- <result property="merchSn" column="merch_sn"/>
- <result property="thirdMerchSn" column="third_merch_sn"/>
- <result property="storeId" column="store_id"/>
- <result property="storeTopicId" column="store_topic_id"/>
- <result property="name" column="name"/>
- <result property="voucherMoney" column="voucher_money"/>
- <result property="voucherCond" column="voucher_cond"/>
- <result property="discRatio" column="disc_ratio"/>
- <result property="discCond" column="disc_cond"/>
- <result property="exchCond" column="exch_cond"/>
- <result property="effectTimeType" column="effect_time_type"/>
- <result property="fixBegTime" column="fix_beg_time"/>
- <result property="fixEndTime" column="fix_end_time"/>
- <result property="postponeNum" column="postpone_num"/>
- <result property="validDayNum" column="valid_day_num"/>
- <result property="ticketNum" column="ticket_num"/>
- <result property="applyType" column="apply_type"/>
- <result property="getEnter" column="get_enter"/>
- <result property="canShareGet" column="can_share_get"/>
- <result property="limitNum" column="limit_num"/>
- <result property="advImgUrl" column="adv_img_url"/>
- <result property="storeLogoUrl" column="store_logo_url"/>
- <result property="storeName" column="store_name"/>
- <result property="ticketColor" column="ticket_color"/>
- <result property="optDecl" column="opt_decl"/>
- <result property="discDecl" column="disc_decl"/>
- <result property="useNoti" column="use_noti"/>
- <result property="svrTel" column="svr_tel"/>
- <result property="isValid" column="is_valid"/>
- <result property="isPast" column="is_past"/>
- <result property="note" column="note"/>
- <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="sendType" column="send_type"/>
- <result property="discSellCount" column="disc_sell_count"/>
- <result property="discSellDoller" column="disc_sell_doller"/>
- <result property="guid" column="guid"/>
- <result property="goodsBizType" column="goods_biz_type"/>
- <result property="isStoreShow" column="is_store_show"/>
- </resultMap>
- <select id="queryObject" resultType="com.kmall.admin.entity.mk.store.MkStoreTicketDiscountEntity">
- select
- `tick_disc_id`,
- `tick_disc_type`,
- `tick_disc_sub_title`,
- `merch_sn`,
- `third_merch_sn`,
- `store_id`,goods_biz_type,is_store_show,
- `store_topic_id`,
- `name`,
- `voucher_money`,
- `voucher_cond`,
- `disc_ratio`,
- `disc_cond`,
- `exch_cond`,
- `effect_time_type`,
- `fix_beg_time`,
- `fix_end_time`,
- `postpone_num`,
- `valid_day_num`,
- `ticket_num`,
- `apply_type`,
- `get_enter`,
- `can_share_get`,
- `limit_num`,
- `adv_img_url`,
- `store_logo_url`,
- `store_name`,
- `ticket_color`,
- `opt_decl`,
- `disc_decl`,
- `use_noti`,
- `svr_tel`,
- `is_valid`,
- is_past,
- disc_sell_count,
- disc_sell_doller,
- `note`,
- `creater_sn`,
- `create_time`,
- `moder_sn`,
- `mod_time`,
- `tstm`,
- `send_type`,guid
- from mk_store_ticket_discount
- where tick_disc_id = #{id}
- </select>
- <select id="queryList" resultType="com.kmall.admin.entity.mk.store.MkStoreTicketDiscountEntity">
- select
- d.`tick_disc_id`,
- d.`tick_disc_type`,
- d.`tick_disc_sub_title`,
- d.`merch_sn`,
- d.`third_merch_sn`,
- d.`store_id`,goods_biz_type,
- d.`store_topic_id`,
- d.`name`,
- d.`voucher_money`,
- d.`voucher_cond`,
- d.`disc_ratio`,
- d.`disc_cond`,
- d.`exch_cond`,
- d.`effect_time_type`,
- d.`fix_beg_time`,
- d.`fix_end_time`,
- d.`postpone_num`,
- d.`valid_day_num`,
- d.`ticket_num`,
- d.`apply_type`,
- d.`get_enter`,
- d.`can_share_get`,
- d.`limit_num`,
- d.`adv_img_url`,
- d.`store_logo_url`,
- d.`store_name`,
- d.`ticket_color`,
- d.`opt_decl`,
- d.`disc_decl`,
- d.`use_noti`,
- d.`svr_tel`,
- d.`is_valid`,
- d.is_past,
- d.disc_sell_count,
- d.disc_sell_doller,
- d.`note`,
- d.`creater_sn`,
- d.`create_time`,
- d.`moder_sn`,
- d.`mod_time`,
- d.`tstm`,
- d.`send_type`,d.guid
- from mk_store_ticket_discount d
- LEFT JOIN third_merchant_biz b ON d.third_merch_sn = b.third_merch_sn
- WHERE 1=1
- <if test="name != null and name.trim() != ''">
- AND d.name LIKE concat('%',#{name},'%')
- </if>
- <if test="storeId != null and storeId != ''">
- AND d.store_id = #{storeId}
- </if>
- <if test="thirdMerchSn != null and thirdMerchSn != ''">
- AND d.third_merch_sn = #{thirdMerchSn}
- </if>
- <if test="thirdPartyMerchCode != null and thirdPartyMerchCode != ''">
- AND b.third_party_merch_code = #{thirdPartyMerchCode}
- </if>
- <choose>
- <when test="sidx != null and sidx.trim() != ''">
- order by ${sidx} ${order}
- </when>
- <otherwise>
- order by d.tick_disc_id desc
- </otherwise>
- </choose>
- <if test="offset != null and limit != null">
- limit #{offset}, #{limit}
- </if>
- </select>
- <select id="queryTotal" resultType="int">
- select count(*) from mk_store_ticket_discount d
- LEFT JOIN third_merchant_biz b ON d.third_merch_sn = b.third_merch_sn
- WHERE 1=1
- <if test="name != null and name.trim() != ''">
- AND d.name LIKE concat('%',#{name},'%')
- </if>
- <if test="storeId != null and storeId != ''">
- AND d.store_id = #{storeId}
- </if>
- <if test="thirdMerchSn != null and thirdMerchSn != ''">
- AND d.third_merch_sn = #{thirdMerchSn}
- </if>
- <if test="thirdPartyMerchCode != null and thirdPartyMerchCode != ''">
- AND b.third_party_merch_code = #{thirdPartyMerchCode}
- </if>
- </select>
- <insert id="save" parameterType="com.kmall.admin.entity.mk.store.MkStoreTicketDiscountEntity" useGeneratedKeys="true" keyProperty="tickDiscId">
- insert into mk_store_ticket_discount(
- `tick_disc_type`,
- `tick_disc_sub_title`,
- `merch_sn`,
- `third_merch_sn`,
- `store_id`,
- goods_biz_type,
- `store_topic_id`,
- `name`,
- `voucher_money`,
- `voucher_cond`,
- `disc_ratio`,
- `disc_cond`,
- `exch_cond`,
- `effect_time_type`,
- `fix_beg_time`,
- `fix_end_time`,
- `postpone_num`,
- `valid_day_num`,
- `ticket_num`,
- `apply_type`,
- `get_enter`,
- `can_share_get`,
- `limit_num`,
- `adv_img_url`,
- `store_logo_url`,
- `store_name`,
- `ticket_color`,
- `opt_decl`,
- `disc_decl`,
- `use_noti`,
- `svr_tel`,
- `is_valid`,
- is_past,
- is_store_show,
- disc_sell_count,
- disc_sell_doller,
- guid,
- `note`,
- `creater_sn`,
- `create_time`,
- `moder_sn`,
- `mod_time`,
- `tstm`,
- `send_type`)
- values(
- #{tickDiscType},
- #{tickDiscSubTitle},
- #{merchSn},
- #{thirdMerchSn},
- #{storeId},
- #{goodsBizType},
- #{storeTopicId},
- #{name},
- #{voucherMoney},
- #{voucherCond},
- #{discRatio},
- #{discCond},
- #{exchCond},
- #{effectTimeType},
- #{fixBegTime},
- #{fixEndTime},
- #{postponeNum},
- #{validDayNum},
- #{ticketNum},
- #{applyType},
- #{getEnter},
- #{canShareGet},
- #{limitNum},
- #{advImgUrl},
- #{storeLogoUrl},
- #{storeName},
- #{ticketColor},
- #{optDecl},
- #{discDecl},
- #{useNoti},
- #{svrTel},
- #{isValid},
- #{isPast},
- #{isStoreShow},
- #{discSellCount},
- #{discSellDoller},
- #{guid},
- #{note},
- #{createrSn},
- #{createTime},
- #{moderSn},
- #{modTime},
- #{tstm},
- #{sendType})
- </insert>
- <update id="update" parameterType="com.kmall.admin.entity.mk.store.MkStoreTicketDiscountEntity">
- update mk_store_ticket_discount
- <set>
- <if test="tickDiscType != null">`tick_disc_type` = #{tickDiscType}, </if>
- <if test="tickDiscSubTitle != null">`tick_disc_sub_title` = #{tickDiscSubTitle}, </if>
- <if test="merchSn != null">`merch_sn` = #{merchSn}, </if>
- <if test="thirdMerchSn != null">`third_merch_sn` = #{thirdMerchSn}, </if>
- <if test="storeId != null">`store_id` = #{storeId}, </if>
- <if test="goodsBizType != null">`goods_biz_type` = #{goodsBizType}, </if>
- <if test="storeTopicId != null">`store_topic_id` = #{storeTopicId}, </if>
- <if test="name != null">`name` = #{name}, </if>
- <if test="voucherMoney != null">`voucher_money` = #{voucherMoney}, </if>
- <if test="voucherCond != null">`voucher_cond` = #{voucherCond}, </if>
- <if test="discRatio != null">`disc_ratio` = #{discRatio}, </if>
- <if test="discCond != null">`disc_cond` = #{discCond}, </if>
- <if test="exchCond != null">`exch_cond` = #{exchCond}, </if>
- <if test="effectTimeType != null">`effect_time_type` = #{effectTimeType}, </if>
- <if test="fixBegTime != null">`fix_beg_time` = #{fixBegTime}, </if>
- <if test="fixEndTime != null">`fix_end_time` = #{fixEndTime}, </if>
- <if test="postponeNum != null">`postpone_num` = #{postponeNum}, </if>
- <if test="validDayNum != null">`valid_day_num` = #{validDayNum}, </if>
- <if test="ticketNum != null">`ticket_num` = #{ticketNum}, </if>
- <if test="applyType != null">`apply_type` = #{applyType}, </if>
- <if test="getEnter != null">`get_enter` = #{getEnter}, </if>
- <if test="canShareGet != null">`can_share_get` = #{canShareGet}, </if>
- <if test="limitNum != null">`limit_num` = #{limitNum}, </if>
- <if test="advImgUrl != null">`adv_img_url` = #{advImgUrl}, </if>
- <if test="storeLogoUrl != null">`store_logo_url` = #{storeLogoUrl}, </if>
- <if test="storeName != null">`store_name` = #{storeName}, </if>
- <if test="ticketColor != null">`ticket_color` = #{ticketColor}, </if>
- <if test="optDecl != null">`opt_decl` = #{optDecl}, </if>
- <if test="discDecl != null">`disc_decl` = #{discDecl}, </if>
- <if test="useNoti != null">`use_noti` = #{useNoti}, </if>
- <if test="svrTel != null">`svr_tel` = #{svrTel}, </if>
- <if test="isValid != null">`is_valid` = #{isValid}, </if>
- <if test="isPast != null">`is_past` = #{isPast}, </if>
- <if test="isStoreShow != null">`is_store_show` = #{isStoreShow}, </if>
- <if test="discSellCount != null">`disc_sell_count` = #{discSellCount}, </if>
- <if test="discSellDoller != null">`disc_sell_doller` = #{discSellDoller}, </if>
- <if test="guid != null">`guid` = #{guid}, </if>
- <if test="note != null">`note` = #{note}, </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>
- <if test="sendType != null">`send_type` = #{sendType}</if>
- </set>
- where tick_disc_id = #{tickDiscId}
- </update>
- <delete id="delete">
- delete from mk_store_ticket_discount where tick_disc_id = #{value}
- </delete>
- <delete id="deleteBatch">
- delete from mk_store_ticket_discount where tick_disc_id in
- <foreach item="tickDiscId" collection="array" open="(" separator="," close=")">
- #{tickDiscId}
- </foreach>
- </delete>
- <select id="queryByGoodsId" resultType="com.kmall.admin.entity.mk.store.MkStoreTicketDiscountEntity">
- select distinct
- mktd.tick_disc_id,
- mktd.tick_disc_type,
- mktd.tick_disc_sub_title,
- mktd.merch_sn,
- mktd.third_merch_sn,
- mktd.store_id,
- mktd.goods_biz_type,
- mktd.is_store_show,
- mktd.store_topic_id,
- mktd.name,
- mktd.voucher_money,
- mktd.voucher_cond,
- mktd.disc_ratio,
- mktd.disc_cond,
- mktd.exch_cond,
- mktd.effect_time_type,
- mktd.fix_beg_time,
- mktd.fix_end_time,
- mktd.postpone_num,
- mktd.valid_day_num,
- mktd.ticket_num,
- mktd.apply_type,
- mktd.get_enter,
- mktd.can_share_get,
- mktd.limit_num,
- mktd.adv_img_url,
- mktd.store_logo_url,
- mktd.store_name,
- mktd.ticket_color,
- mktd.opt_decl,
- mktd.disc_decl,
- mktd.use_noti,
- mktd.svr_tel,
- mktd.is_valid,
- mktd.is_past,
- mktd.disc_sell_count,
- mktd.disc_sell_doller,
- mktd.note,
- mktd.creater_sn,
- mktd.create_time,
- mktd.moder_sn,
- mktd.mod_time,
- mktd.tstm,
- mktd.send_type,
- mktd.guid
- from mk_store_ticket_discount mktd
- left join mk_store_ticket_discount_goods mstdg on mstdg.tick_disc_id = mktd.tick_disc_id
- left join mall_product_store_rela rela on mstdg.store_rela_id = rela.id
- where rela.goods_id = #{goodsId} and mktd.fix_beg_time < now() and mktd.fix_end_time > now() and mktd.apply_type != '02'
- </select>
- <select id="queryByStoreId" resultType="com.kmall.admin.entity.mk.store.MkStoreTicketDiscountEntity">
- select distinct
- `mktd.tick_disc_id`,
- `mktd.tick_disc_type`,
- `mktd.tick_disc_sub_title`,
- `mktd.merch_sn`,
- `mktd.third_merch_sn`,
- `mktd.store_id`,goods_biz_type,is_store_show,
- `mktd.store_topic_id`,
- `mktd.name`,
- `mktd.voucher_money`,
- `mktd.voucher_cond`,
- `mktd.disc_ratio`,
- `mktd.disc_cond`,
- `mktd.exch_cond`,
- `mktd.effect_time_type`,
- `mktd.fix_beg_time`,
- `mktd.fix_end_time`,
- `mktd.postpone_num`,
- `mktd.valid_day_num`,
- `mktd.ticket_num`,
- `mktd.apply_type`,
- `mktd.get_enter`,
- `mktd.can_share_get`,
- `mktd.limit_num`,
- `mktd.adv_img_url`,
- `mktd.store_logo_url`,
- `mktd.store_name`,
- `mktd.ticket_color`,
- `mktd.opt_decl`,
- `mktd.disc_decl`,
- `mktd.use_noti`,
- `mktd.svr_tel`,
- `mktd.is_valid`,
- mktd.is_past,
- mktd.disc_sell_count,
- mktd.disc_sell_doller,
- `mktd.note`,
- `mktd.creater_sn`,
- `mktd.create_time`,
- `mktd.moder_sn`,
- `mktd.mod_time`,
- `mktd.tstm`,
- `mktd.send_type`,
- mktd.guid
- from mk_store_ticket_discount mktd
- where mktd.store_id = #{storeId}
- </select>
- </mapper>
|