100 lines
4.6 KiB
XML
100 lines
4.6 KiB
XML
<?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.ruoyi.system.mapper.RlAgentMapper">
|
|
|
|
<resultMap type="RlAgentVO" id="RlAgentResult" autoMapping="true" />
|
|
|
|
<sql id="selectRlAgentVo">
|
|
select a.agent_id, a.name, a.service_phone, a.dispatch_fee, a.delivery_fee, a.city_id, a.contact, a.phone, a.userid, a.pay_channel, a.is_free_car,c.name cityName
|
|
from rl_agent a
|
|
left join rl_city c on c.city_id = a.city_id
|
|
</sql>
|
|
|
|
<select id="selectRlAgentList" parameterType="RlAgent" resultMap="RlAgentResult">
|
|
<include refid="selectRlAgentVo"/>
|
|
<where>
|
|
<if test="name != null and name != ''"> and a.name like concat('%', #{name}, '%')</if>
|
|
<if test="servicePhone != null and servicePhone != ''"> and a.service_phone = #{servicePhone}</if>
|
|
<if test="dispatchFee != null "> and a.dispatch_fee = #{dispatchFee}</if>
|
|
<if test="deliveryFee != null "> and a.delivery_fee = #{deliveryFee}</if>
|
|
<if test="cityId != null "> and a.city_id = #{cityId}</if>
|
|
<if test="contact != null and contact != ''"> and a.contact = #{contact}</if>
|
|
<if test="phone != null and phone != ''"> and a.phone = #{phone}</if>
|
|
<if test="userid != null "> and a.userid = #{userid}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectRlAgentByAgentId" parameterType="Long" resultMap="RlAgentResult">
|
|
<include refid="selectRlAgentVo"/>
|
|
where a.agent_id = #{agentId}
|
|
</select>
|
|
|
|
<select id="selectRlAgentByCityId" parameterType="Long" resultMap="RlAgentResult">
|
|
<include refid="selectRlAgentVo"/>
|
|
where a.city_id = #{cityId}
|
|
</select>
|
|
|
|
<select id="selectRlAgentByUserId" parameterType="Long" resultMap="RlAgentResult">
|
|
<include refid="selectRlAgentVo"/>
|
|
where a.userid = #{userid}
|
|
</select>
|
|
|
|
<insert id="insertRlAgent" parameterType="RlAgent" useGeneratedKeys="true" keyProperty="agentId">
|
|
insert into rl_agent
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="name != null">name,</if>
|
|
<if test="servicePhone != null">service_phone,</if>
|
|
<if test="dispatchFee != null">dispatch_fee,</if>
|
|
<if test="deliveryFee != null">delivery_fee,</if>
|
|
<if test="cityId != null">city_id,</if>
|
|
<if test="contact != null">contact,</if>
|
|
<if test="phone != null">phone,</if>
|
|
<if test="userid != null">userid,</if>
|
|
<if test="payChannel != null">pay_channel,</if>
|
|
<if test="isFreeCar != null">is_free_car,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="name != null">#{name},</if>
|
|
<if test="servicePhone != null">#{servicePhone},</if>
|
|
<if test="dispatchFee != null">#{dispatchFee},</if>
|
|
<if test="deliveryFee != null">#{deliveryFee},</if>
|
|
<if test="cityId != null">#{cityId},</if>
|
|
<if test="contact != null">#{contact},</if>
|
|
<if test="phone != null">#{phone},</if>
|
|
<if test="userid != null">#{userid},</if>
|
|
<if test="payChannel != null">#{payChannel},</if>
|
|
<if test="isFreeCar != null">#{isFreeCar},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateRlAgent" parameterType="RlAgent">
|
|
update rl_agent
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="name != null">name = #{name},</if>
|
|
<if test="servicePhone != null">service_phone = #{servicePhone},</if>
|
|
<if test="dispatchFee != null">dispatch_fee = #{dispatchFee},</if>
|
|
<if test="deliveryFee != null">delivery_fee = #{deliveryFee},</if>
|
|
<if test="cityId != null">city_id = #{cityId},</if>
|
|
<if test="contact != null">contact = #{contact},</if>
|
|
<if test="phone != null">phone = #{phone},</if>
|
|
<if test="userid != null">userid = #{userid},</if>
|
|
<if test="payChannel != null">pay_channel = #{payChannel},</if>
|
|
<if test="isFreeCar != null">is_free_car = #{isFreeCar},</if>
|
|
</trim>
|
|
where agent_id = #{agentId}
|
|
</update>
|
|
|
|
<delete id="deleteRlAgentByAgentId" parameterType="Long">
|
|
delete from rl_agent where agent_id = #{agentId}
|
|
</delete>
|
|
|
|
<delete id="deleteRlAgentByAgentIds" parameterType="String">
|
|
delete from rl_agent where agent_id in
|
|
<foreach item="agentId" collection="array" open="(" separator="," close=")">
|
|
#{agentId}
|
|
</foreach>
|
|
</delete>
|
|
</mapper>
|