rtos-mini-service4/mapper/target/classes/mappers/base/DepartureDetailMapper.xml

118 lines
4.4 KiB
XML
Raw Normal View History

2024-06-13 15:27:54 +08:00
<?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.haitongauto.mapper.base.DepartureDetailMapper">
<!--添加-->
<select id="insert" parameterType="com.haitongauto.models.pojo.DepartureDetail" resultType="String">
insert into applet_departure_detail
(
id,
applet_departure_vehicle_id,
receiving_unit,ship_name,
voy_number,
customs_clearance_nature,
lading_no,
customs_declaration_no,
cargo_name,
cargo_quantity,
remarks,
vin_list,
create_time,
update_time,
is_del)
values
(
#{id},
#{applet_departure_vehicle_id},
#{receiving_unit},#{ship_name},
#{voy_number},
#{customs_clearance_nature},
#{lading_no},
#{customs_declaration_no},
#{cargo_name},
#{cargo_quantity},
#{remarks},
#{vin_list},
current_timestamp,
current_timestamp,
0
)
returning id
</select>
<!--软删除-->
<update id="logicDel" parameterType="String">
update applet_departure_detail set is_del=1 where id=#{id}
</update>
<!--硬删除-->
<delete id="delete" parameterType="String">
delete from applet_departure_detail where id=#{id}
</delete>
<!--数据更新-->
<update id="update" parameterType="com.haitongauto.models.pojo.DepartureDetail">
update applet_departure_detail
<set>
<if test="id != null and id != ''">
id = #{id},
</if>
<if test="applet_departure_vehicle_id != null and applet_departure_vehicle_id != ''">
applet_departure_vehicle_id = #{applet_departure_vehicle_id},
</if>
<if test="receiving_unit != null and receiving_unit != ''">
receiving_unit = #{receiving_unit},
</if>
<if test="ship_name != null and ship_name != ''">
ship_name = #{ship_name},
</if>
<if test="voy_number != null and voy_number != ''">
voy_number = #{voy_number},
</if>
<if test="customs_clearance_nature != null and customs_clearance_nature != ''">
customs_clearance_nature = #{customs_clearance_nature},
</if>
<if test="lading_no != null and lading_no != ''">
lading_no = #{lading_no},
</if>
<if test="customs_declaration_no != null and customs_declaration_no != ''">
customs_declaration_no = #{customs_declaration_no},
</if>
<if test="cargo_name != null and cargo_name != ''">
cargo_name = #{cargo_name},
</if>
<if test="cargo_quantity != null">
cargo_quantity = #{cargo_quantity},
</if>
<if test="remarks != null and remarks != ''">
remarks = #{remarks},
</if>
<if test="vin_list != null and vin_list != ''">
vin_list = #{vin_list},
</if>
<if test="create_time != null and create_time != ''">
create_time = #{create_time}::timestamp,
</if>
<if test="is_del != null">
is_del = #{is_del},
</if>
update_time = current_timestamp
</set>
where id = #{id}
</update>
<!--指定Id的记录-->
<select id="getById" parameterType="String" resultType="com.haitongauto.models.pojo.DepartureDetail">
select
id,applet_departure_vehicle_id,receiving_unit,ship_name,voy_number,customs_clearance_nature,lading_no,customs_declaration_no,cargo_name,cargo_quantity,remarks,vin_list,create_time,update_time,is_del
from applet_departure_detail
where id=#{id}
and is_del=0
</select>
<!--数据列表-->
<select id="getList" resultType="com.haitongauto.models.pojo.DepartureDetail">
select
id,applet_departure_vehicle_id,receiving_unit,ship_name,voy_number,customs_clearance_nature,lading_no,customs_declaration_no,cargo_name,cargo_quantity,remarks,vin_list,create_time,update_time,is_del
from applet_departure_detail
where is_del=0
order by create_time desc
</select>
</mapper>