<?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.tms.mapper.TmsServiceProviderMapper">
|
|
<resultMap type="com.ruoyi.tms.domain.TmsServiceProvider" id="TmsServiceProviderResult">
|
<result property="id" column="id" />
|
<result property="serviceCode" column="service_code" />
|
<result property="serviceName" column="service_name" />
|
<result property="serviceShortName" column="service_short_name" />
|
<result property="serviceType" column="service_type" />
|
<result property="address" column="address" />
|
<result property="licenseNumber" column="license_number" />
|
<result property="businessStatus" column="business_status" />
|
<result property="isTransport" column="is_transport" />
|
<result property="isStorage" column="is_storage" />
|
<result property="isExpress" column="is_express" />
|
<result property="contactName" column="contact_name" />
|
<result property="contactPhone" column="contact_phone" />
|
<result property="contactEmail" column="contact_email" />
|
<result property="status" column="status" />
|
<result property="createBy" column="create_by" />
|
<result property="createTime" column="create_time" />
|
<result property="updateBy" column="update_by" />
|
<result property="updateTime" column="update_time" />
|
<result property="remark" column="remark" />
|
</resultMap>
|
|
<sql id="selectTmsServiceProviderVo">
|
select thisTab.id, thisTab.service_code, thisTab.service_name, thisTab.service_short_name, thisTab.service_type, thisTab.address, thisTab.license_number, thisTab.business_status, thisTab.is_transport, thisTab.is_storage, thisTab.is_express, thisTab.contact_name, thisTab.contact_phone, thisTab.contact_email, thisTab.status, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.remark from tms_service_provider AS thisTab
|
</sql>
|
<sql id="selectTmsServiceProviderVoCount">
|
select count(0) from tms_service_provider as thisTab
|
</sql>
|
|
<sql id="whereCondition">
|
<if test="serviceCode != null and serviceCode != ''"> and thisTab.service_code = #{serviceCode}</if>
|
<if test="serviceShortName != null and serviceShortName != ''"> and thisTab.service_short_name like concat('%', #{serviceShortName}, '%')</if>
|
<if test="serviceType != null and serviceType != ''"> and thisTab.service_type = #{serviceType}</if>
|
<if test="businessStatus != null and businessStatus != ''"> and thisTab.business_status = #{businessStatus}</if>
|
<if test="isTransport != null and isTransport != ''"> and thisTab.is_transport = #{isTransport}</if>
|
<if test="isStorage != null and isStorage != ''"> and thisTab.is_storage = #{isStorage}</if>
|
<if test="isExpress != null and isExpress != ''"> and thisTab.is_express = #{isExpress}</if>
|
<if test="contactName != null and contactName != ''"> and thisTab.contact_name like concat('%', #{contactName}, '%')</if>
|
<if test="status != null and status != ''"> and thisTab.status = #{status}</if>
|
<if test="createBy != null and createBy != ''"> and thisTab.create_by = #{createBy}</if>
|
<if test="createTime != null and createTime != ''"> and thisTab.create_time = #{createTime}</if>
|
<if test="updateBy != null and updateBy != ''"> and thisTab.update_by = #{updateBy}</if>
|
<if test="updateTime != null and updateTime != ''"> and thisTab.update_time = #{updateTime}</if>
|
</sql>
|
|
<!--查询-->
|
<select id="selectTmsServiceProviderById" parameterType="Integer" resultMap="TmsServiceProviderResult">
|
<include refid="selectTmsServiceProviderVo"/>
|
where id = #{id}
|
</select>
|
|
<select id="selectTmsServiceProviderCount" parameterType="com.ruoyi.tms.domain.TmsServiceProvider" resultType="int">
|
<include refid="selectTmsServiceProviderVoCount"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
</select>
|
|
<select id="selectTmsServiceProviderList" parameterType="com.ruoyi.tms.domain.TmsServiceProvider" resultMap="TmsServiceProviderResult">
|
<include refid="selectTmsServiceProviderVo"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
order by thisTab.id desc
|
</select>
|
|
<!-- 新增 -->
|
<insert id="insertTmsServiceProvider" parameterType="com.ruoyi.tms.domain.TmsServiceProvider" useGeneratedKeys="true" keyProperty="id">
|
insert into tms_service_provider
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="serviceCode != null and serviceCode != ''">service_code,</if>
|
<if test="serviceName != null and serviceName != ''">service_name,</if>
|
<if test="serviceShortName != null and serviceShortName != ''">service_short_name,</if>
|
<if test="serviceType != null">service_type,</if>
|
<if test="address != null">address,</if>
|
<if test="licenseNumber != null">license_number,</if>
|
<if test="businessStatus != null">business_status,</if>
|
<if test="isTransport != null">is_transport,</if>
|
<if test="isStorage != null">is_storage,</if>
|
<if test="isExpress != null">is_express,</if>
|
<if test="contactName != null and contactName != ''">contact_name,</if>
|
<if test="contactPhone != null">contact_phone,</if>
|
<if test="contactEmail != null">contact_email,</if>
|
<if test="status != null">status,</if>
|
<if test="createBy != null">create_by,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="updateBy != null">update_by,</if>
|
<if test="updateTime != null">update_time,</if>
|
<if test="remark != null">remark,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="serviceCode != null and serviceCode != ''">#{serviceCode},</if>
|
<if test="serviceName != null and serviceName != ''">#{serviceName},</if>
|
<if test="serviceShortName != null and serviceShortName != ''">#{serviceShortName},</if>
|
<if test="serviceType != null">#{serviceType},</if>
|
<if test="address != null">#{address},</if>
|
<if test="licenseNumber != null">#{licenseNumber},</if>
|
<if test="businessStatus != null">#{businessStatus},</if>
|
<if test="isTransport != null">#{isTransport},</if>
|
<if test="isStorage != null">#{isStorage},</if>
|
<if test="isExpress != null">#{isExpress},</if>
|
<if test="contactName != null and contactName != ''">#{contactName},</if>
|
<if test="contactPhone != null">#{contactPhone},</if>
|
<if test="contactEmail != null">#{contactEmail},</if>
|
<if test="status != null">#{status},</if>
|
<if test="createBy != null">#{createBy},</if>
|
<if test="createTime != null">#{createTime},</if>
|
<if test="updateBy != null">#{updateBy},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
<if test="remark != null">#{remark},</if>
|
</trim>
|
</insert>
|
|
<insert id="insertTmsServiceProviderBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
insert into tms_service_provider
|
<trim prefix="(" suffix=") values" suffixOverrides=",">
|
id,service_code,service_name,service_short_name,service_type,address,license_number,business_status,is_transport,is_storage,is_express,contact_name,contact_phone,contact_email,status,create_by,create_time,update_by,update_time,remark,
|
</trim>
|
<foreach item="item" index="index" collection="list" separator=",">
|
<trim prefix="(" suffix=") " suffixOverrides=",">
|
#{item.id},#{item.serviceCode},#{item.serviceName},#{item.serviceShortName},#{item.serviceType},#{item.address},#{item.licenseNumber},#{item.businessStatus},#{item.isTransport},#{item.isStorage},#{item.isExpress},#{item.contactName},#{item.contactPhone},#{item.contactEmail},#{item.status},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.remark},
|
</trim>
|
</foreach>
|
</insert>
|
|
<!-- 修改 -->
|
<update id="updateTmsServiceProvider" parameterType="com.ruoyi.tms.domain.TmsServiceProvider">
|
update tms_service_provider
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="serviceCode != null and serviceCode != ''">service_code = #{serviceCode},</if>
|
<if test="serviceName != null and serviceName != ''">service_name = #{serviceName},</if>
|
<if test="serviceShortName != null and serviceShortName != ''">service_short_name = #{serviceShortName},</if>
|
<if test="serviceType != null">service_type = #{serviceType},</if>
|
<if test="address != null">address = #{address},</if>
|
<if test="licenseNumber != null">license_number = #{licenseNumber},</if>
|
<if test="businessStatus != null">business_status = #{businessStatus},</if>
|
<if test="isTransport != null">is_transport = #{isTransport},</if>
|
<if test="isStorage != null">is_storage = #{isStorage},</if>
|
<if test="isExpress != null">is_express = #{isExpress},</if>
|
<if test="contactName != null and contactName != ''">contact_name = #{contactName},</if>
|
<if test="contactPhone != null">contact_phone = #{contactPhone},</if>
|
<if test="contactEmail != null">contact_email = #{contactEmail},</if>
|
<if test="status != null">status = #{status},</if>
|
<if test="createBy != null">create_by = #{createBy},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="remark != null">remark = #{remark},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
<!-- 修改 -->
|
<update id="updateTmsServiceProviderBatch" parameterType="java.util.List">
|
<foreach collection="list" item="item" index="index" separator=";">
|
update tms_service_provider
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="item.serviceCode != null and item.serviceCode != ''">service_code = #{item.serviceCode},</if>
|
<if test="item.serviceName != null and item.serviceName != ''">service_name = #{item.serviceName},</if>
|
<if test="item.serviceShortName != null and item.serviceShortName != ''">service_short_name = #{item.serviceShortName},</if>
|
<if test="item.serviceType != null">service_type = #{item.serviceType},</if>
|
<if test="item.address != null">address = #{item.address},</if>
|
<if test="item.licenseNumber != null">license_number = #{item.licenseNumber},</if>
|
<if test="item.businessStatus != null">business_status = #{item.businessStatus},</if>
|
<if test="item.isTransport != null">is_transport = #{item.isTransport},</if>
|
<if test="item.isStorage != null">is_storage = #{item.isStorage},</if>
|
<if test="item.isExpress != null">is_express = #{item.isExpress},</if>
|
<if test="item.contactName != null and item.contactName != ''">contact_name = #{item.contactName},</if>
|
<if test="item.contactPhone != null">contact_phone = #{item.contactPhone},</if>
|
<if test="item.contactEmail != null">contact_email = #{item.contactEmail},</if>
|
<if test="item.status != null">status = #{item.status},</if>
|
<if test="item.createBy != null">create_by = #{item.createBy},</if>
|
<if test="item.createTime != null">create_time = #{item.createTime},</if>
|
<if test="item.updateBy != null">update_by = #{item.updateBy},</if>
|
<if test="item.updateTime != null">update_time = #{item.updateTime},</if>
|
<if test="item.remark != null">remark = #{item.remark},</if>
|
</trim>
|
where id = #{item.id}
|
</foreach>
|
</update>
|
|
<!--删除-->
|
<delete id="deleteTmsServiceProviderById" parameterType="Integer">
|
delete from tms_service_provider where id = #{id}
|
</delete>
|
<delete id="deleteTmsServiceProviderByIds" parameterType="Integer">
|
delete from tms_service_provider where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
</mapper>
|