首页 金刚区 标签 详情 标签VO一堆

This commit is contained in:
2024-04-11 14:26:35 +08:00
parent 1b9d069bc6
commit 9a6f6eb5b6
21 changed files with 592 additions and 633 deletions

View File

@@ -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>