首页 金刚区 标签 详情 标签VO一堆
This commit is contained in:
@@ -2,116 +2,39 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.chaozhanggui.system.cashierservice.dao.TagProductDeptsMapper">
|
||||
|
||||
<resultMap type="com.chaozhanggui.system.cashierservice.entity.TagProductDepts" id="TagProductDeptsMap">
|
||||
<result property="tagId" column="tag_id" jdbcType="INTEGER"/>
|
||||
<result property="productId" column="product_id" jdbcType="INTEGER"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="TagProductDeptsMap">
|
||||
select
|
||||
tag_id, product_id, create_time
|
||||
from tag_product_depts
|
||||
where tag_id = #{tagId}
|
||||
</select>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAllByLimit" resultMap="TagProductDeptsMap">
|
||||
select
|
||||
tag_id, product_id, create_time
|
||||
from tag_product_depts
|
||||
<where>
|
||||
<if test="tagId != null">
|
||||
and tag_id = #{tagId}
|
||||
</if>
|
||||
<if test="productId != null">
|
||||
and product_id = #{productId}
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
and create_time = #{createTime}
|
||||
</if>
|
||||
</where>
|
||||
limit #{pageable.offset}, #{pageable.pageSize}
|
||||
</select>
|
||||
|
||||
<!--统计总行数-->
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
select count(1)
|
||||
from tag_product_depts
|
||||
<where>
|
||||
<if test="tagId != null">
|
||||
and tag_id = #{tagId}
|
||||
</if>
|
||||
<if test="productId != null">
|
||||
and product_id = #{productId}
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
and create_time = #{createTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="queryTagAndProduct" resultType="com.chaozhanggui.system.cashierservice.entity.vo.TagProductVO">
|
||||
SELECT
|
||||
pro.id AS productId,
|
||||
pro.`name` AS `name`,
|
||||
GROUP_CONCAT(dict.`name`) AS tags
|
||||
depts.product_id AS productId,
|
||||
dict.share_img AS shareImg,
|
||||
dict.name AS name,
|
||||
dict.font_color AS fontColor,
|
||||
dict.back_color AS backColor
|
||||
FROM
|
||||
tag_product_depts AS depts
|
||||
LEFT JOIN tb_product AS pro ON depts.product_id = pro.id
|
||||
LEFT JOIN tb_platform_dict AS dict ON dict.id = depts.tag_id
|
||||
LEFT JOIN tb_platform_dict AS dict ON dict.id = depts.tag_id
|
||||
WHERE
|
||||
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
GROUP BY
|
||||
pro.id,
|
||||
pro.name;
|
||||
dict.type='proTag' AND
|
||||
depts.product_id IN
|
||||
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
order by dict.sort
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="tagId" useGeneratedKeys="true">
|
||||
insert into tag_product_depts(product_id, create_time)
|
||||
values (#{productId}, #{createTime})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="tagId" useGeneratedKeys="true">
|
||||
insert into tag_product_depts(product_id, create_time)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.productId}, #{entity.createTime})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="insertOrUpdateBatch" keyProperty="tagId" useGeneratedKeys="true">
|
||||
insert into tag_product_depts(product_id, create_time)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.productId}, #{entity.createTime})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
product_id = values(product_id),
|
||||
create_time = values(create_time)
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
update tag_product_depts
|
||||
<set>
|
||||
<if test="productId != null">
|
||||
product_id = #{productId},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime},
|
||||
</if>
|
||||
</set>
|
||||
where tag_id = #{tagId}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
delete from tag_product_depts where tag_id = #{tagId}
|
||||
</delete>
|
||||
<select id="queryTagByProductId" resultType="com.chaozhanggui.system.cashierservice.entity.vo.TagProductVO">
|
||||
SELECT
|
||||
depts.product_id AS productId,
|
||||
dict.share_img AS shareImg,
|
||||
dict.name AS name,
|
||||
dict.font_color AS fontColor,
|
||||
dict.back_color AS backColor
|
||||
FROM
|
||||
tag_product_depts AS depts
|
||||
LEFT JOIN tb_platform_dict AS dict ON dict.id = depts.tag_id
|
||||
WHERE
|
||||
depts.product_id=#{productId}
|
||||
ORDER BY dict.sort
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
@@ -4,13 +4,15 @@
|
||||
|
||||
<resultMap type="com.chaozhanggui.system.cashierservice.entity.TbPlatformDict" id="TbPlatformDictMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="shareImg" column="share_img" jdbcType="VARCHAR"/>
|
||||
<result property="name" column="name" jdbcType="VARCHAR"/>
|
||||
<result property="fontColor" column="font_color" jdbcType="VARCHAR"/>
|
||||
<result property="backColor" column="back_color" jdbcType="VARCHAR"/>
|
||||
<result property="type" column="type" jdbcType="VARCHAR"/>
|
||||
<result property="coverImg" column="cover_img" jdbcType="VARCHAR"/>
|
||||
<result property="shareImg" column="share_img" jdbcType="VARCHAR"/>
|
||||
<result property="video" column="video" jdbcType="VARCHAR"/>
|
||||
<result property="videoCoverImg" column="video_cover_img" jdbcType="VARCHAR"/>
|
||||
<result property="relUrl" column="rel_url" jdbcType="VARCHAR"/>
|
||||
<result property="jumpType" column="jump_type" jdbcType="VARCHAR"/>
|
||||
<result property="absUrl" column="abs_url" jdbcType="VARCHAR"/>
|
||||
<result property="createdAt" column="created_at" jdbcType="INTEGER"/>
|
||||
<result property="updatedAt" column="updated_at" jdbcType="INTEGER"/>
|
||||
@@ -23,121 +25,25 @@
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="TbPlatformDictMap">
|
||||
select
|
||||
id, name, type, cover_img, share_img, video, video_cover_img, rel_url, abs_url, created_at, updated_at, is_show_cash, is_show_mall, is_show_app, sort
|
||||
id, name, type,font_color,back_color, cover_img, share_img, video, video_cover_img, jump_type, abs_url, created_at, updated_at, is_show_cash, is_show_mall, is_show_app, sort
|
||||
from tb_platform_dict
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAllByLimit" resultMap="TbPlatformDictMap">
|
||||
|
||||
<select id="queryByIdList" resultMap="TbPlatformDictMap">
|
||||
select
|
||||
id, name, type, cover_img, share_img, video, video_cover_img, rel_url, abs_url, created_at, updated_at, is_show_cash, is_show_mall, is_show_app, sort
|
||||
id, name, type, font_color, back_color, cover_img, share_img, video, video_cover_img, jump_type, abs_url, created_at, updated_at, is_show_cash, is_show_mall, is_show_app, sort
|
||||
from tb_platform_dict
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
and name = #{name}
|
||||
</if>
|
||||
<if test="type != null and type != ''">
|
||||
and type = #{type}
|
||||
</if>
|
||||
<if test="coverImg != null and coverImg != ''">
|
||||
and cover_img = #{coverImg}
|
||||
</if>
|
||||
<if test="shareImg != null and shareImg != ''">
|
||||
and share_img = #{shareImg}
|
||||
</if>
|
||||
<if test="video != null and video != ''">
|
||||
and video = #{video}
|
||||
</if>
|
||||
<if test="videoCoverImg != null and videoCoverImg != ''">
|
||||
and video_cover_img = #{videoCoverImg}
|
||||
</if>
|
||||
<if test="relUrl != null and relUrl != ''">
|
||||
and rel_url = #{relUrl}
|
||||
</if>
|
||||
<if test="absUrl != null and absUrl != ''">
|
||||
and abs_url = #{absUrl}
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
and created_at = #{createdAt}
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
and updated_at = #{updatedAt}
|
||||
</if>
|
||||
<if test="isShowCash != null">
|
||||
and is_show_cash = #{isShowCash}
|
||||
</if>
|
||||
<if test="isShowMall != null">
|
||||
and is_show_mall = #{isShowMall}
|
||||
</if>
|
||||
<if test="isShowApp != null">
|
||||
and is_show_app = #{isShowApp}
|
||||
</if>
|
||||
<if test="sort != null">
|
||||
and sort = #{sort}
|
||||
</if>
|
||||
</where>
|
||||
limit #{pageable.offset}, #{pageable.pageSize}
|
||||
where id IN
|
||||
<foreach collection="idList" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<!--统计总行数-->
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
select count(1)
|
||||
from tb_platform_dict
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
and name = #{name}
|
||||
</if>
|
||||
<if test="type != null and type != ''">
|
||||
and type = #{type}
|
||||
</if>
|
||||
<if test="coverImg != null and coverImg != ''">
|
||||
and cover_img = #{coverImg}
|
||||
</if>
|
||||
<if test="shareImg != null and shareImg != ''">
|
||||
and share_img = #{shareImg}
|
||||
</if>
|
||||
<if test="video != null and video != ''">
|
||||
and video = #{video}
|
||||
</if>
|
||||
<if test="videoCoverImg != null and videoCoverImg != ''">
|
||||
and video_cover_img = #{videoCoverImg}
|
||||
</if>
|
||||
<if test="relUrl != null and relUrl != ''">
|
||||
and rel_url = #{relUrl}
|
||||
</if>
|
||||
<if test="absUrl != null and absUrl != ''">
|
||||
and abs_url = #{absUrl}
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
and created_at = #{createdAt}
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
and updated_at = #{updatedAt}
|
||||
</if>
|
||||
<if test="isShowCash != null">
|
||||
and is_show_cash = #{isShowCash}
|
||||
</if>
|
||||
<if test="isShowMall != null">
|
||||
and is_show_mall = #{isShowMall}
|
||||
</if>
|
||||
<if test="isShowApp != null">
|
||||
and is_show_app = #{isShowApp}
|
||||
</if>
|
||||
<if test="sort != null">
|
||||
and sort = #{sort}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="queryAllByType" resultType="com.chaozhanggui.system.cashierservice.entity.TbPlatformDict">
|
||||
select
|
||||
id, name, type, cover_img, share_img, video, video_cover_img, rel_url, abs_url, created_at, updated_at, is_show_cash, is_show_mall, is_show_app, sort
|
||||
id, name, type,font_color,back_color, cover_img, share_img, video, video_cover_img, jump_type, abs_url, created_at, updated_at, is_show_cash, is_show_mall, is_show_app, sort
|
||||
from tb_platform_dict
|
||||
<where>
|
||||
<if test="type != null and type != ''">
|
||||
@@ -151,98 +57,5 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into tb_platform_dict(name, type, cover_img, share_img, video, video_cover_img, rel_url, abs_url, created_at, updated_at, is_show_cash, is_show_mall, is_show_app, sort)
|
||||
values (#{name}, #{type}, #{coverImg}, #{shareImg}, #{video}, #{videoCoverImg}, #{relUrl}, #{absUrl}, #{createdAt}, #{updatedAt}, #{isShowCash}, #{isShowMall}, #{isShowApp}, #{sort})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into tb_platform_dict(name, type, cover_img, share_img, video, video_cover_img, rel_url, abs_url, created_at, updated_at, is_show_cash, is_show_mall, is_show_app, sort)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.name}, #{entity.type}, #{entity.coverImg}, #{entity.shareImg}, #{entity.video}, #{entity.videoCoverImg}, #{entity.relUrl}, #{entity.absUrl}, #{entity.createdAt}, #{entity.updatedAt}, #{entity.isShowCash}, #{entity.isShowMall}, #{entity.isShowApp}, #{entity.sort})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into tb_platform_dict(name, type, cover_img, share_img, video, video_cover_img, rel_url, abs_url, created_at, updated_at, is_show_cash, is_show_mall, is_show_app, sort)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.name}, #{entity.type}, #{entity.coverImg}, #{entity.shareImg}, #{entity.video}, #{entity.videoCoverImg}, #{entity.relUrl}, #{entity.absUrl}, #{entity.createdAt}, #{entity.updatedAt}, #{entity.isShowCash}, #{entity.isShowMall}, #{entity.isShowApp}, #{entity.sort})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
name = values(name),
|
||||
type = values(type),
|
||||
cover_img = values(cover_img),
|
||||
share_img = values(share_img),
|
||||
video = values(video),
|
||||
video_cover_img = values(video_cover_img),
|
||||
rel_url = values(rel_url),
|
||||
abs_url = values(abs_url),
|
||||
created_at = values(created_at),
|
||||
updated_at = values(updated_at),
|
||||
is_show_cash = values(is_show_cash),
|
||||
is_show_mall = values(is_show_mall),
|
||||
is_show_app = values(is_show_app),
|
||||
sort = values(sort)
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
update tb_platform_dict
|
||||
<set>
|
||||
<if test="name != null and name != ''">
|
||||
name = #{name},
|
||||
</if>
|
||||
<if test="type != null and type != ''">
|
||||
type = #{type},
|
||||
</if>
|
||||
<if test="coverImg != null and coverImg != ''">
|
||||
cover_img = #{coverImg},
|
||||
</if>
|
||||
<if test="shareImg != null and shareImg != ''">
|
||||
share_img = #{shareImg},
|
||||
</if>
|
||||
<if test="video != null and video != ''">
|
||||
video = #{video},
|
||||
</if>
|
||||
<if test="videoCoverImg != null and videoCoverImg != ''">
|
||||
video_cover_img = #{videoCoverImg},
|
||||
</if>
|
||||
<if test="relUrl != null and relUrl != ''">
|
||||
rel_url = #{relUrl},
|
||||
</if>
|
||||
<if test="absUrl != null and absUrl != ''">
|
||||
abs_url = #{absUrl},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at = #{createdAt},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at = #{updatedAt},
|
||||
</if>
|
||||
<if test="isShowCash != null">
|
||||
is_show_cash = #{isShowCash},
|
||||
</if>
|
||||
<if test="isShowMall != null">
|
||||
is_show_mall = #{isShowMall},
|
||||
</if>
|
||||
<if test="isShowApp != null">
|
||||
is_show_app = #{isShowApp},
|
||||
</if>
|
||||
<if test="sort != null">
|
||||
sort = #{sort},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
delete from tb_platform_dict where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
@@ -381,6 +381,14 @@
|
||||
GROUP BY
|
||||
product_id
|
||||
</select>
|
||||
<select id="selectSku" resultType="com.chaozhanggui.system.cashierservice.entity.TbProductSku">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
tb_product_sku
|
||||
WHERE
|
||||
product_id = #{productId}
|
||||
</select>
|
||||
<select id="selectSale" resultType="com.chaozhanggui.system.cashierservice.entity.vo.HomeVO">
|
||||
SELECT
|
||||
pro.id as id,
|
||||
|
||||
34
src/main/resources/mapper/TbPurchaseNoticeMapper.xml
Normal file
34
src/main/resources/mapper/TbPurchaseNoticeMapper.xml
Normal file
@@ -0,0 +1,34 @@
|
||||
<?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.chaozhanggui.system.cashierservice.dao.TbPurchaseNoticeMapper">
|
||||
|
||||
<resultMap type="com.chaozhanggui.system.cashierservice.entity.TbPurchaseNotice" id="TbPurchaseNoticeMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="couponId" column="coupon_id" jdbcType="INTEGER"/>
|
||||
<result property="dateUsed" column="date_used" jdbcType="VARCHAR"/>
|
||||
<result property="availableTime" column="available_time" jdbcType="VARCHAR"/>
|
||||
<result property="bookingType" column="booking_type" jdbcType="VARCHAR"/>
|
||||
<result property="refundPolicy" column="refund_policy" jdbcType="VARCHAR"/>
|
||||
<result property="usageRules" column="usage_rules" jdbcType="VARCHAR"/>
|
||||
<result property="invoiceInfo" column="invoice_info" jdbcType="VARCHAR"/>
|
||||
<result property="groupPurInfo" column="group_pur_info" jdbcType="VARCHAR"/>
|
||||
<result property="marketPriceInfo" column="market_price_Info" jdbcType="VARCHAR"/>
|
||||
<result property="discountInfo" column="discount_Info" jdbcType="VARCHAR"/>
|
||||
<result property="platformTips" column="platform_tips" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id
|
||||
, coupon_id, date_used, available_time, booking_type, refund_policy, usage_rules, invoice_info, group_pur_info, market_price_Info, discount_Info, platform_tips </sql>
|
||||
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="TbPurchaseNoticeMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
|
||||
from tb_purchase_notice
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user