You've already forked FrameTour-BE
后台部分修改
This commit is contained in:
@ -23,12 +23,20 @@
|
||||
delete from broker where id = #{id}
|
||||
</delete>
|
||||
<select id="list" resultType="com.ycwl.basic.model.pc.broker.entity.BrokerEntity">
|
||||
select id, `name`, promo_code, status, create_at, update_at
|
||||
select id, `name`, phone, promo_code, status,
|
||||
(select count(1) from `order` where broker_id = broker.id) as broker_order_count,
|
||||
(select sum(pay_price) from `order` where broker_id = broker.id) as broker_order_amount,
|
||||
(select create_at from `order` where broker_id = broker.id and status = 1 order by create_at desc limit 1) as last_broker_date,
|
||||
(select create_at from `order` where broker_id = broker.id and status = 1 order by create_at asc limit 1) as first_broker_date,
|
||||
create_at, update_at
|
||||
from broker
|
||||
<where>
|
||||
<if test="name!= null and name!= ''">
|
||||
and `name` like concat('%', #{name}, '%')
|
||||
</if>
|
||||
<if test="phone!= null and phone!= ''">
|
||||
and `phone` like concat('%', #{phone}, '%')
|
||||
</if>
|
||||
<if test="promoCode!= null and promoCode!= ''">
|
||||
and promo_code like concat('%', #{promoCode}, '%')
|
||||
</if>
|
||||
|
52
src/main/resources/mapper/pc/ScenicAccountMapper.xml
Normal file
52
src/main/resources/mapper/pc/ScenicAccountMapper.xml
Normal file
@ -0,0 +1,52 @@
|
||||
<?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.ScenicAccountMapper">
|
||||
<insert id="add">
|
||||
insert into scenic_account(id, scenic_id, is_super, name, account, password, create_time, update_time)
|
||||
values (#{id}, #{scenicId}, #{isSuper}, #{name}, #{account}, #{password}, now(), now())
|
||||
</insert>
|
||||
<update id="update">
|
||||
update scenic_account
|
||||
<set>
|
||||
<if test="name != null and name != ''">
|
||||
name = #{name},
|
||||
</if>
|
||||
<if test="account != null and account != ''">
|
||||
account = #{account},
|
||||
</if>
|
||||
<if test="password != null and password != ''">
|
||||
password = #{password},
|
||||
</if>
|
||||
update_time = now()
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateStatus">
|
||||
update scenic_account
|
||||
set status = (CASE
|
||||
WHEN status = 1 THEN
|
||||
0
|
||||
WHEN status = 0 THEN
|
||||
1
|
||||
ELSE null
|
||||
END)
|
||||
where id = #{id}
|
||||
</update>
|
||||
<delete id="deleteById">
|
||||
delete from scenic_account where id = #{id}
|
||||
</delete>
|
||||
<delete id="deleteByScenicId">
|
||||
delete from scenic_account where scenic_id = #{scenicId}
|
||||
</delete>
|
||||
<select id="getSuperAccountOfScenic"
|
||||
resultType="com.ycwl.basic.model.pc.scenic.entity.ScenicAccountEntity">
|
||||
select id, scenic_id, is_super, name, account, password, create_time, update_time
|
||||
from scenic_account
|
||||
where scenic_id = #{scenicId} and is_super = 1
|
||||
</select>
|
||||
<select id="getByAccount" resultType="com.ycwl.basic.model.pc.scenic.entity.ScenicAccountEntity">
|
||||
select id, scenic_id, is_super, name, account, password, create_time, update_time
|
||||
from scenic_account
|
||||
where account = #{account}
|
||||
</select>
|
||||
</mapper>
|
@ -16,6 +16,9 @@
|
||||
<if test="name!=null and name!=''">
|
||||
`name`=#{name},
|
||||
</if>
|
||||
<if test="phone!=null and phone!=''">
|
||||
`phone`=#{phone},
|
||||
</if>
|
||||
<if test="introduction!=null and introduction!=''">
|
||||
introduction=#{introduction},
|
||||
</if>
|
||||
@ -77,8 +80,10 @@
|
||||
delete from scenic_config where scenic_id = #{scenicId}
|
||||
</delete>
|
||||
<select id="list" resultMap="scenicAndConfig">
|
||||
select s.id, `name`, introduction, longitude, latitude, radius, province, city, area, address, `status`, s.create_time, update_time,
|
||||
c.start_time, c.end_time, c.is_default, c.create_time
|
||||
select s.id, `name`, `phone`, introduction, longitude, latitude, radius, province, city, area, address, `status`, s.create_time, update_time,
|
||||
c.start_time, c.end_time,
|
||||
(select scenic_account.account from scenic_account where scenic_account.scenic_id = s.id and scenic_account.is_super = 1 limit 1) as account,
|
||||
c.is_default, c.create_time
|
||||
from scenic s
|
||||
left join scenic_config c on s.id = c.id
|
||||
<where>
|
||||
@ -106,7 +111,7 @@
|
||||
</where>
|
||||
</select>
|
||||
<select id="getById" resultMap="scenicAndConfig">
|
||||
select s.id, `name`, introduction, longitude, latitude, radius, province, city, area, address, `status`, s.create_time, update_time,
|
||||
select s.id, `name`, `phone`, introduction, longitude, latitude, radius, province, city, area, address, `status`, s.create_time, update_time,
|
||||
c.start_time, c.end_time, c.is_default, c.create_time,s.price
|
||||
from scenic s
|
||||
left join scenic_config c on s.id = c.id
|
||||
@ -114,8 +119,10 @@
|
||||
</select>
|
||||
|
||||
<resultMap id="scenicAndConfig" type="com.ycwl.basic.model.pc.scenic.resp.ScenicRespVO">
|
||||
<id property="id" column="s.id"/>
|
||||
<id property="id" column="id"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="account" column="account"/>
|
||||
<result property="phone" column="phone"/>
|
||||
<result property="introduction" column="introduction"/>
|
||||
<result property="longitude" column="longitude"/>
|
||||
<result property="latitude" column="latitude"/>
|
||||
|
Reference in New Issue
Block a user