协议完善
This commit is contained in:
parent
e7246d6029
commit
cec8b55f51
|
@ -13,7 +13,10 @@ public class AgreementVO extends Agreement{
|
|||
@ApiModelProperty("运营区")
|
||||
private String areaName;
|
||||
|
||||
@ApiModelProperty("运营商ID")
|
||||
@ApiModelProperty("代理商ID")
|
||||
private Long agentId;
|
||||
|
||||
@ApiModelProperty("运营商ID")
|
||||
private Long storeId;
|
||||
|
||||
}
|
||||
|
|
|
@ -9,7 +9,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<sql id="selectAgreementVo">
|
||||
select
|
||||
bag.id,
|
||||
bag.store_id,
|
||||
bag.area_id,
|
||||
bag.title,
|
||||
bag.brief,
|
||||
|
@ -20,18 +19,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
bag.create_time,
|
||||
bag.update_time,
|
||||
su.nick_name as user_name,
|
||||
ba.name as area_name
|
||||
ba.name as area_name,
|
||||
ba.user_id as store_id,
|
||||
su.agent_id as agent_id
|
||||
from <include refid="searchTables"/>
|
||||
</sql>
|
||||
|
||||
<sql id="searchTables">
|
||||
bst_agreement bag
|
||||
left join sys_user su on bag.store_id = su.user_id
|
||||
left join bst_area ba on bag.area_id = ba.id
|
||||
left join sys_user su on ba.user_id = su.user_id
|
||||
</sql>
|
||||
|
||||
<sql id="searchCondition">
|
||||
<if test="query.storeId != null "> and bag.store_id = #{query.storeId}</if>
|
||||
<if test="query.areaId != null "> and bag.area_id = #{query.areaId}</if>
|
||||
<if test="query.title != null and query.title != ''"> and bag.title like concat('%', #{query.title}, '%')</if>
|
||||
<if test="query.brief != null and query.brief != ''"> and bag.brief like concat('%', #{query.brief}, '%')</if>
|
||||
|
@ -48,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</if>
|
||||
${@com.ruoyi.framework.util.DataScopeUtil@dataScope(
|
||||
null,
|
||||
"bag.store_id",
|
||||
"ba.user_id,su.agent_id",
|
||||
null,
|
||||
null,
|
||||
query.scope
|
||||
|
@ -80,7 +80,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<insert id="insertAgreement" parameterType="Agreement" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into bst_agreement
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="storeId != null">store_id,</if>
|
||||
<if test="areaId != null">area_id,</if>
|
||||
<if test="title != null and title != ''">title,</if>
|
||||
<if test="brief != null">brief,</if>
|
||||
|
@ -92,7 +91,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="storeId != null">#{storeId},</if>
|
||||
<if test="areaId != null">#{areaId},</if>
|
||||
<if test="title != null and title != ''">#{title},</if>
|
||||
<if test="brief != null">#{brief},</if>
|
||||
|
@ -108,7 +106,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<insert id="batchInsert" parameterType="Agreement" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into bst_agreement
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
store_id,
|
||||
area_id,
|
||||
title,
|
||||
brief,
|
||||
|
@ -121,8 +118,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
values
|
||||
<foreach collection="list" item="i" separator=",">
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="i.storeId != null ">#{i.storeId},</if>
|
||||
<if test="i.storeId == null ">default,</if>
|
||||
<if test="i.areaId != null ">#{i.areaId},</if>
|
||||
<if test="i.areaId == null ">default,</if>
|
||||
<if test="i.title != null and i.title != ''">#{i.title},</if>
|
||||
|
@ -146,16 +141,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<update id="batchUpdate">
|
||||
update bst_agreement
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<foreach open="store_id = CASE id" collection="list" item="item" close="END,">
|
||||
<choose>
|
||||
<when test="item.storeId != null ">
|
||||
WHEN #{item.id} THEN #{item.storeId}
|
||||
</when>
|
||||
<otherwise>
|
||||
WHEN #{item.id} THEN `store_id`
|
||||
</otherwise>
|
||||
</choose>
|
||||
</foreach>
|
||||
<foreach open="area_id = CASE id" collection="list" item="item" close="END,">
|
||||
<choose>
|
||||
<when test="item.areaId != null ">
|
||||
|
@ -252,7 +237,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</update>
|
||||
|
||||
<sql id="updateColumns">
|
||||
<if test="data.storeId != null">store_id = #{data.storeId},</if>
|
||||
<if test="data.areaId != null">area_id = #{data.areaId},</if>
|
||||
<if test="data.title != null and data.title != ''">title = #{data.title},</if>
|
||||
<if test="data.brief != null">brief = #{data.brief},</if>
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.ruoyi.bst.agreement.domain.AgreementVO;
|
|||
import com.ruoyi.bst.agreement.mapper.AgreementMapper;
|
||||
import com.ruoyi.bst.agreement.service.AgreementValidator;
|
||||
import com.ruoyi.bst.area.domain.AreaVO;
|
||||
import com.ruoyi.bst.area.service.AreaService;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.collection.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -18,6 +19,8 @@ public class AgreementValidatorImpl implements AgreementValidator {
|
|||
|
||||
@Autowired
|
||||
private AgreementMapper agreementMapper;
|
||||
@Autowired
|
||||
private AreaService areaService;
|
||||
|
||||
@Override
|
||||
public boolean canEdit(Long agreementId) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user