You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

200 lines
9.3 KiB

<?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="cc.hiver.core.logisticsstation.mapper.LogisticsStationMapper">
<resultMap id="BaseResultMap" type="cc.hiver.core.logisticsstation.entity.LogisticsStation">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="del_flag" jdbcType="INTEGER" property="delFlag" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="circuit_id" jdbcType="VARCHAR" property="circuitId" />
<result column="station_name" jdbcType="VARCHAR" property="stationName" />
<result column="freight_rules" jdbcType="VARCHAR" property="freightRules" />
<result column="landing_fee_rules" jdbcType="VARCHAR" property="landingFeeRules" />
<result column="delivery_fee_rules" jdbcType="VARCHAR" property="deliveryFeeRules" />
</resultMap>
<sql id="Base_Column_List">
id, create_by, create_time, del_flag, update_by, update_time,circuit_id, station_name, freight_rules, landing_fee_rules, delivery_fee_rules
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_logistics_station
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from t_logistics_station
where id = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="cc.hiver.core.logisticsstation.entity.LogisticsStation">
insert into t_logistics_station
(id, create_by, create_time, del_flag, update_by, update_time, circuit_id, station_name, freight_rules, landing_fee_rules, delivery_fee_rules)
values (#{id,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{delFlag,jdbcType=INTEGER}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
#{circuitId,jdbcType=VARCHAR}, #{stationName,jdbcType=VARCHAR}, #{freightRules,jdbcType=VARCHAR}, #{landingFeeRules,jdbcType=VARCHAR}, #{deliveryFeeRules,jdbcType=VARCHAR})
</insert>
<update id="updateByExampleSelective" parameterType="map">
update t_logistics_station
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.createBy != null">
create_by = #{record.createBy,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.delFlag != null">
del_flag = #{record.delFlag,jdbcType=INTEGER},
</if>
<if test="record.updateBy != null">
update_by = #{record.updateBy,jdbcType=VARCHAR},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.circuitId != null">
circuit_id = #{record.circuitId,jdbcType=VARCHAR},
</if>
<if test="record.stationName != null">
station_name = #{record.stationName,jdbcType=VARCHAR},
</if>
<if test="record.freightRules != null">
freight_rules = #{record.freightRules,jdbcType=VARCHAR},
</if>
<if test="record.landingFeeRules != null">
landing_fee_rules = #{record.landingFeeRules,jdbcType=VARCHAR},
</if>
<if test="record.deliveryFeeRules != null">
delivery_fee_rules = #{record.deliveryFeeRules,jdbcType=VARCHAR},
</if>
</set>
</update>
<update id="updateByExample" parameterType="map">
update t_logistics_station
set id = #{record.id,jdbcType=VARCHAR},
create_by = #{record.createBy,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
del_flag = #{record.delFlag,jdbcType=INTEGER},
update_by = #{record.updateBy,jdbcType=VARCHAR},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
circuit_id = #{record.circuitId,jdbcType=VARCHAR},
station_name = #{record.stationName,jdbcType=VARCHAR},
freight_rules = #{record.freightRules,jdbcType=VARCHAR},
landing_fee_rules = #{record.landingFeeRules,jdbcType=VARCHAR},
delivery_fee_rules = #{record.deliveryFeeRules,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKeySelective" parameterType="cc.hiver.core.logisticsstation.entity.LogisticsStation">
update t_logistics_station
<set>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="delFlag != null">
del_flag = #{delFlag,jdbcType=INTEGER},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="circuitId != null">
circuit_id = #{circuitId,jdbcType=VARCHAR},
</if>
<if test="stationName != null">
station_name = #{stationName,jdbcType=VARCHAR},
</if>
<if test="freightRules != null">
freight_rules = #{freightRules,jdbcType=VARCHAR},
</if>
<if test="landingFeeRules != null">
landing_fee_rules = #{landingFeeRules,jdbcType=VARCHAR},
</if>
<if test="deliveryFeeRules != null">
delivery_fee_rules = #{deliveryFeeRules,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="cc.hiver.core.logisticsstation.entity.LogisticsStation">
update t_logistics_station
set create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
del_flag = #{delFlag,jdbcType=INTEGER},
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP},
circuit_id = #{circuitId,jdbcType=VARCHAR},
station_name = #{stationName,jdbcType=VARCHAR},
freight_rules = #{freightRules,jdbcType=VARCHAR},
landing_fee_rules = #{landingFeeRules,jdbcType=VARCHAR},
delivery_fee_rules = #{deliveryFeeRules,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<!--管理商品分页列表-->
<select id="getLogisticsStationPageList" resultMap="BaseResultMap" parameterType="cc.hiver.core.logisticsstation.vo.LogisticsStationQueryVo">
select
t.id, t.create_by,t.create_time,t.del_flag,t.update_by,t.update_time,t.circuit_id,t.station_name,t.freight_rules,t.landing_fee_rules,t.delivery_fee_rules
from t_logistics_station t
<where>
<!--反馈内容-->
<if test='queryParams.circuitId!=null and queryParams.circuitId.trim() neq ""'>
AND t.circuit_id = #{queryParams.circuitId}
</if>
<if test='queryParams.stationName!=null and queryParams.stationName.trim() neq ""'>
AND (t.station_name LIKE CONCAT( '%', #{queryParams.stationName}, '%' )
OR to_pinyin ( t.station_name ) LIKE CONCAT( '%', to_pinyin ( #{queryParams.stationName} ), '%' )
1 year ago
OR to_initial_pinyin ( t.station_name ) LIKE CONCAT( '%', to_initial_pinyin (#{queryParams.stationName}), '%' ))
</if>
</where>
ORDER BY
t.create_time desc
</select>
<select id="getLogisticsStationListByCompanyId" resultMap="BaseResultMap" parameterType="cc.hiver.core.logisticsstation.vo.LogisticsStationQueryVo">
select
t.id, t.create_by,t.create_time,t.del_flag,t.update_by,t.update_time,t.circuit_id,t.station_name,t.freight_rules,t.landing_fee_rules,t.delivery_fee_rules
from t_logistics_station t
1 year ago
<where>
and circuit_id in (
select circuit_id from t_logistics_company_route t where company_id = #{queryParams.companyId}
)
1 year ago
<if test='queryParams.stationName!=null and queryParams.stationName.trim() neq ""'>
AND (t.station_name LIKE CONCAT( '%', #{queryParams.stationName}, '%' )
OR to_pinyin ( t.station_name ) LIKE CONCAT( '%', to_pinyin ( #{queryParams.stationName} ), '%' )
OR to_initial_pinyin ( t.station_name ) LIKE CONCAT( '%', to_initial_pinyin (#{queryParams.stationName}), '%' ))
</if>
</where>
ORDER BY
t.create_time desc
</select>
2 years ago
<select id="getLogisticsStationListBystationName" resultMap="BaseResultMap" parameterType="cc.hiver.core.logisticsstation.vo.LogisticsStationQueryVo">
select
t.id, t.create_by,t.create_time,t.del_flag,t.update_by,t.update_time,t.circuit_id,t.station_name,t.freight_rules,t.landing_fee_rules,t.delivery_fee_rules
from t_logistics_station t
<where>
<if test='queryParams.stationName!=null and queryParams.stationName.trim() neq ""'>
AND (t.station_name LIKE CONCAT( '%', #{queryParams.stationName}, '%' )
OR to_pinyin ( t.station_name ) LIKE CONCAT( '%', to_pinyin ( #{queryParams.stationName} ), '%' )
1 year ago
OR to_initial_pinyin ( t.station_name ) LIKE CONCAT( '%', to_initial_pinyin (#{queryParams.stationName}), '%' ))
2 years ago
</if>
</where>
ORDER BY
t.create_time desc
</select>
</mapper>