首页上半,

This commit is contained in:
liuyingfang
2024-04-01 17:25:36 +08:00
parent 09e29ca20b
commit fc3d04ca33
16 changed files with 996 additions and 0 deletions

View File

@@ -0,0 +1,248 @@
<?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.TbPlatformDictMapper">
<resultMap type="com.chaozhanggui.system.cashierservice.entity.TbPlatformDict" id="TbPlatformDictMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="name" column="name" 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="absUrl" column="abs_url" jdbcType="VARCHAR"/>
<result property="createdAt" column="created_at" jdbcType="INTEGER"/>
<result property="updatedAt" column="updated_at" jdbcType="INTEGER"/>
<result property="isShowCash" column="is_show_cash" jdbcType="INTEGER"/>
<result property="isShowMall" column="is_show_mall" jdbcType="INTEGER"/>
<result property="isShowApp" column="is_show_app" jdbcType="INTEGER"/>
<result property="sort" column="sort" jdbcType="INTEGER"/>
</resultMap>
<!--查询单个-->
<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
from tb_platform_dict
where id = #{id}
</select>
<!--查询指定行数据-->
<select id="queryAllByLimit" 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
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}
</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
from tb_platform_dict
<where>
<if test="type != null and type != ''">
type = #{type}
</if>
<if test="environment == app">
and is_show_mall = 1
</if>
<if test="environment == wx">
and is_show_app = 1
</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>