微信小程序点歌接口
This commit is contained in:
156
src/main/resources/mapper/TbShopSongMapper.xml
Normal file
156
src/main/resources/mapper/TbShopSongMapper.xml
Normal file
@@ -0,0 +1,156 @@
|
||||
<?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.TbShopSongMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbShopSong">
|
||||
<id property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="shopId" column="shop_id" jdbcType="INTEGER"/>
|
||||
<result property="img" column="img" jdbcType="VARCHAR"/>
|
||||
<result property="name" column="name" jdbcType="VARCHAR"/>
|
||||
<result property="originSinger" column="origin_singer" jdbcType="VARCHAR"/>
|
||||
<result property="singerId" column="singer_id" jdbcType="INTEGER"/>
|
||||
<result property="singer" column="singer" jdbcType="VARCHAR"/>
|
||||
<result property="price" column="price" jdbcType="DECIMAL"/>
|
||||
<result property="salesNumber" column="sales_number" jdbcType="INTEGER"/>
|
||||
<result property="status" column="status" jdbcType="TINYINT"/>
|
||||
<result property="sort" column="sort" jdbcType="INTEGER"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,shop_id,img,
|
||||
name,origin_singer,singer_id,
|
||||
singer,price,sales_number,
|
||||
status,sort,create_time,
|
||||
update_time
|
||||
</sql>
|
||||
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from tb_shop_song
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<select id="selectAllAndSearch" resultType="com.chaozhanggui.system.cashierservice.entity.TbShopSong">
|
||||
select *
|
||||
from fycashier.tb_shop_song where shop_id=#{shopId}
|
||||
and status=1
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and name like CONCAT('%',#{keyWord},'%')
|
||||
</if>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from tb_shop_song
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopSong" useGeneratedKeys="true">
|
||||
insert into tb_shop_song
|
||||
( id,shop_id,img
|
||||
,name,origin_singer,singer_id
|
||||
,singer,price,sales_number
|
||||
,status,sort,create_time
|
||||
,update_time)
|
||||
values (#{id,jdbcType=INTEGER},#{shopId,jdbcType=INTEGER},#{img,jdbcType=VARCHAR}
|
||||
,#{name,jdbcType=VARCHAR},#{originSinger,jdbcType=VARCHAR},#{singerId,jdbcType=INTEGER}
|
||||
,#{singer,jdbcType=VARCHAR},#{price,jdbcType=DECIMAL},#{salesNumber,jdbcType=INTEGER}
|
||||
,#{status,jdbcType=TINYINT},#{sort,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP}
|
||||
,#{updateTime,jdbcType=TIMESTAMP})
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopSong" useGeneratedKeys="true">
|
||||
insert into tb_shop_song
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="shopId != null">shop_id,</if>
|
||||
<if test="img != null">img,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="originSinger != null">origin_singer,</if>
|
||||
<if test="singerId != null">singer_id,</if>
|
||||
<if test="singer != null">singer,</if>
|
||||
<if test="price != null">price,</if>
|
||||
<if test="salesNumber != null">sales_number,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="sort != null">sort,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id,jdbcType=INTEGER},</if>
|
||||
<if test="shopId != null">#{shopId,jdbcType=INTEGER},</if>
|
||||
<if test="img != null">#{img,jdbcType=VARCHAR},</if>
|
||||
<if test="name != null">#{name,jdbcType=VARCHAR},</if>
|
||||
<if test="originSinger != null">#{originSinger,jdbcType=VARCHAR},</if>
|
||||
<if test="singerId != null">#{singerId,jdbcType=INTEGER},</if>
|
||||
<if test="singer != null">#{singer,jdbcType=VARCHAR},</if>
|
||||
<if test="price != null">#{price,jdbcType=DECIMAL},</if>
|
||||
<if test="salesNumber != null">#{salesNumber,jdbcType=INTEGER},</if>
|
||||
<if test="status != null">#{status,jdbcType=TINYINT},</if>
|
||||
<if test="sort != null">#{sort,jdbcType=INTEGER},</if>
|
||||
<if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
||||
<if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopSong">
|
||||
update tb_shop_song
|
||||
<set>
|
||||
<if test="shopId != null">
|
||||
shop_id = #{shopId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="img != null">
|
||||
img = #{img,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="originSinger != null">
|
||||
origin_singer = #{originSinger,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="singerId != null">
|
||||
singer_id = #{singerId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="singer != null">
|
||||
singer = #{singer,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="price != null">
|
||||
price = #{price,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="salesNumber != null">
|
||||
sales_number = #{salesNumber,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="sort != null">
|
||||
sort = #{sort,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopSong">
|
||||
update tb_shop_song
|
||||
set
|
||||
shop_id = #{shopId,jdbcType=INTEGER},
|
||||
img = #{img,jdbcType=VARCHAR},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
origin_singer = #{originSinger,jdbcType=VARCHAR},
|
||||
singer_id = #{singerId,jdbcType=INTEGER},
|
||||
singer = #{singer,jdbcType=VARCHAR},
|
||||
price = #{price,jdbcType=DECIMAL},
|
||||
sales_number = #{salesNumber,jdbcType=INTEGER},
|
||||
status = #{status,jdbcType=TINYINT},
|
||||
sort = #{sort,jdbcType=INTEGER},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
||||
165
src/main/resources/mapper/TbShopSongOrderMapper.xml
Normal file
165
src/main/resources/mapper/TbShopSongOrderMapper.xml
Normal file
@@ -0,0 +1,165 @@
|
||||
<?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.TbShopSongOrderMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbShopSongOrder">
|
||||
<id property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="songId" column="song_id" jdbcType="INTEGER"/>
|
||||
<result property="songName" column="song_name" jdbcType="VARCHAR"/>
|
||||
<result property="userId" column="user_id" jdbcType="INTEGER"/>
|
||||
<result property="payMoney" column="pay_money" jdbcType="DECIMAL"/>
|
||||
<result property="state" column="state" jdbcType="TINYINT"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="clientType" column="client_type" jdbcType="TINYINT"/>
|
||||
<result property="orderNo" column="order_no" jdbcType="VARCHAR"/>
|
||||
<result property="fromName" column="from_name" jdbcType="VARCHAR"/>
|
||||
<result property="toName" column="to_name" jdbcType="VARCHAR"/>
|
||||
<result property="note" column="note" jdbcType="VARCHAR"/>
|
||||
<result property="shopId" column="shop_id" jdbcType="INTEGER"/>
|
||||
<result property="realMoney" column="real_money" jdbcType="DECIMAL"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,song_id,song_name,
|
||||
user_id,pay_money,state,
|
||||
create_time,client_type,order_no,
|
||||
from_name,to_name,note,
|
||||
shop_id,real_money
|
||||
</sql>
|
||||
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from tb_shop_song_order
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from tb_shop_song_order
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopSongOrder" useGeneratedKeys="true">
|
||||
insert into tb_shop_song_order
|
||||
( id,song_id,song_name
|
||||
,user_id,pay_money,state
|
||||
,create_time,client_type,order_no
|
||||
,from_name,to_name,note
|
||||
,shop_id,real_money)
|
||||
values (#{id,jdbcType=INTEGER},#{songId,jdbcType=INTEGER},#{songName,jdbcType=VARCHAR}
|
||||
,#{userId,jdbcType=INTEGER},#{payMoney,jdbcType=DECIMAL},#{state,jdbcType=TINYINT}
|
||||
,#{createTime,jdbcType=TIMESTAMP},#{clientType,jdbcType=TINYINT},#{orderNo,jdbcType=VARCHAR}
|
||||
,#{fromName,jdbcType=VARCHAR},#{toName,jdbcType=VARCHAR},#{note,jdbcType=VARCHAR}
|
||||
,#{shopId,jdbcType=INTEGER},#{realMoney,jdbcType=DECIMAL})
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopSongOrder" useGeneratedKeys="true">
|
||||
insert into tb_shop_song_order
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="songId != null">song_id,</if>
|
||||
<if test="songName != null">song_name,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="payMoney != null">pay_money,</if>
|
||||
<if test="state != null">state,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="clientType != null">client_type,</if>
|
||||
<if test="orderNo != null">order_no,</if>
|
||||
<if test="fromName != null">from_name,</if>
|
||||
<if test="toName != null">to_name,</if>
|
||||
<if test="note != null">note,</if>
|
||||
<if test="shopId != null">shop_id,</if>
|
||||
<if test="realMoney != null">real_money,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id,jdbcType=INTEGER},</if>
|
||||
<if test="songId != null">#{songId,jdbcType=INTEGER},</if>
|
||||
<if test="songName != null">#{songName,jdbcType=VARCHAR},</if>
|
||||
<if test="userId != null">#{userId,jdbcType=INTEGER},</if>
|
||||
<if test="payMoney != null">#{payMoney,jdbcType=DECIMAL},</if>
|
||||
<if test="state != null">#{state,jdbcType=TINYINT},</if>
|
||||
<if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
||||
<if test="clientType != null">#{clientType,jdbcType=TINYINT},</if>
|
||||
<if test="orderNo != null">#{orderNo,jdbcType=VARCHAR},</if>
|
||||
<if test="fromName != null">#{fromName,jdbcType=VARCHAR},</if>
|
||||
<if test="toName != null">#{toName,jdbcType=VARCHAR},</if>
|
||||
<if test="note != null">#{note,jdbcType=VARCHAR},</if>
|
||||
<if test="shopId != null">#{shopId,jdbcType=INTEGER},</if>
|
||||
<if test="realMoney != null">#{realMoney,jdbcType=DECIMAL},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopSongOrder">
|
||||
update tb_shop_song_order
|
||||
<set>
|
||||
<if test="songId != null">
|
||||
song_id = #{songId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="songName != null">
|
||||
song_name = #{songName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="payMoney != null">
|
||||
pay_money = #{payMoney,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="state != null">
|
||||
state = #{state,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="clientType != null">
|
||||
client_type = #{clientType,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="orderNo != null">
|
||||
order_no = #{orderNo,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="fromName != null">
|
||||
from_name = #{fromName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="toName != null">
|
||||
to_name = #{toName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="note != null">
|
||||
note = #{note,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="shopId != null">
|
||||
shop_id = #{shopId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="realMoney != null">
|
||||
real_money = #{realMoney,jdbcType=DECIMAL},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopSongOrder">
|
||||
update tb_shop_song_order
|
||||
set
|
||||
song_id = #{songId,jdbcType=INTEGER},
|
||||
song_name = #{songName,jdbcType=VARCHAR},
|
||||
user_id = #{userId,jdbcType=INTEGER},
|
||||
pay_money = #{payMoney,jdbcType=DECIMAL},
|
||||
state = #{state,jdbcType=TINYINT},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
client_type = #{clientType,jdbcType=TINYINT},
|
||||
order_no = #{orderNo,jdbcType=VARCHAR},
|
||||
from_name = #{fromName,jdbcType=VARCHAR},
|
||||
to_name = #{toName,jdbcType=VARCHAR},
|
||||
note = #{note,jdbcType=VARCHAR},
|
||||
shop_id = #{shopId,jdbcType=INTEGER},
|
||||
real_money = #{realMoney,jdbcType=DECIMAL}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
<select id="selectByUserIdAndId" resultType="java.util.Map">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
tb_shop_song_order AS a
|
||||
LEFT JOIN tb_shop_song AS b ON a.song_id = b.id
|
||||
WHERE
|
||||
a.user_id = #{userId}
|
||||
AND a.id=#{id}
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user