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

175 lines
5.2 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.haitongauto.mapper.base.DepartureVehicleMapper">
<!--添加-->
<select id="insert" parameterType="com.haitongauto.models.pojo.DepartureVehicle" resultType="String">
insert into applet_departure_vehicle
(
id,
voucher_number,
users_id,users_name,
tel_number,operators,
phone_number,
truck_number,
trade_type,
cargo_type,
cargo_quantity,
delivery_time,
checker,
check_status,
check_time,
remarks,
create_time,
update_time,
is_del
)
values
(
#{id},
#{voucher_number},
#{users_id},
#{users_name},
#{tel_number},
#{operators},
#{phone_number},
#{truck_number},
#{trade_type},
#{cargo_type},
#{cargo_quantity},
#{delivery_time}::timestamp,
#{checker},
#{check_status},
#{check_time}::timestamp,
#{remarks},
current_timestamp,
current_timestamp,
0
)
returning id
</select>
<!--软删除-->
<update id="logicDel" parameterType="String">
update applet_departure_vehicle set is_del=1 where id=#{id}
</update>
<!--硬删除-->
<delete id="delete" parameterType="String">
delete from applet_departure_vehicle where id=#{id}
</delete>
<!--数据更新-->
<update id="update" parameterType="com.haitongauto.models.pojo.DepartureVehicle">
update applet_departure_vehicle
<set>
<if test="id != null and id != ''">
id = #{id},
</if>
<if test="voucher_number != null and voucher_number != ''">
voucher_number = #{voucher_number},
</if>
<if test="users_id != null and users_id != ''">
users_id = #{users_id},
</if>
<if test="users_name != null and users_name != ''">
users_name = #{users_name},
</if>
<if test="tel_number != null and tel_number != ''">
tel_number = #{tel_number},
</if>
<if test="operators != null and operators != ''">
operators = #{operators},
</if>
<if test="phone_number != null and phone_number != ''">
phone_number = #{phone_number},
</if>
<if test="truck_number != null and truck_number != ''">
truck_number = #{truck_number},
</if>
<if test="trade_type != null and trade_type != ''">
trade_type = #{trade_type},
</if>
<if test="cargo_type != null and cargo_type != ''">
cargo_type = #{cargo_type},
</if>
<if test="cargo_quantity != null">
cargo_quantity = #{cargo_quantity},
</if>
<if test="delivery_time != null and delivery_time != ''">
delivery_time = #{delivery_time}::timestamp,
</if>
<if test="checker != null and checker != ''">
checker = #{checker},
</if>
<if test="check_status != null and check_status != ''">
check_status = #{check_status},
</if>
<if test="check_time != null and check_time != ''">
check_time = #{check_time}::timestamp,
</if>
<if test="remarks != null and remarks != ''">
remarks = #{remarks},
</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.DepartureVehicle">
select
id,
voucher_number,
users_id,
users_name,
tel_number,
operators,
phone_number,
truck_number,
trade_type,
cargo_type,
cargo_quantity,
delivery_time,
checker,
check_status,
check_time,
remarks,
create_time,
update_time,
is_del
from applet_departure_vehicle
where id=#{id}
and is_del=0
</select>
<!--数据列表-->
<select id="getList" resultType="com.haitongauto.models.pojo.DepartureVehicle">
select
id,
voucher_number,
users_id,
users_name,
tel_number,
operators,
phone_number,
truck_number,
trade_type,
cargo_type,
cargo_quantity,
delivery_time,
checker,
check_status,
check_time,
remarks,
create_time,
update_time,
is_del
from applet_departure_vehicle
where is_del=0
order by create_time desc
</select>
</mapper>