You've already forked FrameTour-BE
修改bug
添加“source”相关CRUD代码
This commit is contained in:
@ -114,7 +114,7 @@
|
||||
<result property="status" column="status"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<association property="scenicConfig" column="id" javaType="com.ycwl.basic.model.pc.scenic.entity.ScenicConfigEntity">
|
||||
<association property="scenicConfig" javaType="com.ycwl.basic.model.pc.scenic.entity.ScenicConfigEntity">
|
||||
<id property="id" column="c.id"/>
|
||||
<result property="scenicId" column="s.id"/>
|
||||
<result property="startTime" column="c.start_time"/>
|
||||
|
38
src/main/resources/mapper/pc/SourceMapper.xml
Normal file
38
src/main/resources/mapper/pc/SourceMapper.xml
Normal file
@ -0,0 +1,38 @@
|
||||
<?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.ycwl.basic.mapper.pc.SourceMapper">
|
||||
<insert id="add">
|
||||
insert into source(id, scenic_id, device_id, member_id, url) values (#{id}, #{scenicId}, #{deviceId}, #{memberId}, #{url})
|
||||
</insert>
|
||||
<update id="update">
|
||||
update source
|
||||
<set>
|
||||
<if test="scenicId!= null">scenic_id = #{scenicId}, </if>
|
||||
<if test="deviceId!= null">device_id = #{deviceId}, </if>
|
||||
<if test="memberId!= null">member_id = #{memberId}, </if>
|
||||
<if test="url!= null">url = #{url}, </if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<delete id="deleteById">
|
||||
delete from source where id = #{id}
|
||||
</delete>
|
||||
|
||||
<select id="list" resultType="com.ycwl.basic.model.pc.source.resp.SourceRespVO">
|
||||
select so.id, scenic_id, device_id, member_id, url, so.create_time, so.update_time,sc.`name` as scenicName
|
||||
from source so
|
||||
left join scenic sc on sc.id = so.scenic_id
|
||||
<where>
|
||||
<if test="scenicId!= null">and scenic_id = #{scenicId} </if>
|
||||
<if test="deviceId!= null">and device_id = #{deviceId} </if>
|
||||
<if test="memberId!= null">and member_id = #{memberId} </if>
|
||||
<if test="url!= null">and url = #{url} </if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="getById" resultType="com.ycwl.basic.model.pc.source.resp.SourceRespVO">
|
||||
select so.id, scenic_id, device_id, member_id, url, so.create_time, so.update_time,sc.`name` as scenicName
|
||||
from source so
|
||||
left join scenic sc on sc.id = so.scenic_id
|
||||
where id = #{id}
|
||||
</select>
|
||||
</mapper>
|
Reference in New Issue
Block a user