153 lines
5.5 KiB
XML
153 lines
5.5 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.ReceivingVehicleMapper">
|
|
<!--添加-->
|
|
<select id="insert" parameterType="com.haitongauto.models.pojo.ReceivingVehicle" resultType="String">
|
|
insert into applet_receiving_vehicle
|
|
(
|
|
id,
|
|
voucher_number,
|
|
users_id,
|
|
users_name,
|
|
tel_number,
|
|
operators,
|
|
phone_number,
|
|
numbers,
|
|
number_type,
|
|
trade_type,
|
|
cargo_type,
|
|
cargo_quantity,
|
|
collect_time,
|
|
checker,
|
|
check_status,
|
|
check_time,
|
|
remarks,
|
|
create_time,
|
|
update_time,
|
|
is_del
|
|
)
|
|
values
|
|
(
|
|
#{id},
|
|
#{voucherNumber},
|
|
#{users_id},
|
|
#{users_name},
|
|
#{tel_number},
|
|
#{operators},
|
|
#{phone_number},
|
|
#{numbers},
|
|
#{number_type},
|
|
#{trade_type},
|
|
#{cargo_type},
|
|
#{cargo_quantity},
|
|
#{collect_time}::timestamp,
|
|
#{checker},
|
|
#{check_status},
|
|
#{check_time}::timestamp,
|
|
#{remarks},
|
|
current_timestamp,
|
|
current_timestamp,
|
|
0
|
|
)
|
|
returning id
|
|
</select>
|
|
<!--软删除-->
|
|
<update id="logicDel" parameterType="String">
|
|
update applet_receiving_vehicle set is_del=1 where id=#{id}
|
|
</update>
|
|
<!--硬删除-->
|
|
<delete id="delete" parameterType="String">
|
|
delete from applet_receiving_vehicle where id=#{id}
|
|
</delete>
|
|
<!--数据更新-->
|
|
<update id="update" parameterType="com.haitongauto.models.pojo.ReceivingVehicle">
|
|
update applet_receiving_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="numbers != null and numbers != ''">
|
|
numbers = #{numbers},
|
|
</if>
|
|
<if test="number_type != null and number_type != ''">
|
|
number_type = #{number_type},
|
|
</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="collect_time != null and collect_time != ''">
|
|
collect_time = #{collect_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.ReceivingVehicle">
|
|
select
|
|
id,voucher_number,users_id,users_name,tel_number,operators,phone_number,numbers,number_type,trade_type,cargo_type,cargo_quantity,collect_time,checker,check_status,check_time,remarks,create_time,update_time,is_del
|
|
from applet_receiving_vehicle
|
|
where id=#{id} and is_del=0
|
|
</select>
|
|
<!--数据列表-->
|
|
<select id="getList" resultType="com.haitongauto.models.pojo.ReceivingVehicle">
|
|
select
|
|
id,voucher_number,users_id,users_name,tel_number,operators,phone_number,numbers,number_type,trade_type,cargo_type,cargo_quantity,collect_time,checker,check_status,check_time,remarks,create_time,update_time,is_del
|
|
from applet_receiving_vehicle
|
|
where is_del=0
|
|
order by create_time desc
|
|
</select>
|
|
|
|
<!--根据凭证编号获取凭证数据-->
|
|
<select id="getIdByVoucherNo" resultType="com.haitongauto.models.pojo.ReceivingVehicle">
|
|
select
|
|
id,voucher_number,users_id,users_name,tel_number,operators,phone_number,numbers,number_type,trade_type,cargo_type,cargo_quantity,collect_time,checker,check_status,check_time,remarks,create_time,update_time,is_del
|
|
where is_del=0 and voucher_number=#{voucher_number}
|
|
limit 1
|
|
</select>
|
|
|
|
</mapper> |