2024-11-22 17:41:27 +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.bonus.material.book.mapper.BookCarMapper">
|
|
|
|
|
|
|
|
|
|
<insert id="addBookCarDetail">
|
2024-12-16 13:31:52 +08:00
|
|
|
insert into book_car_detail(ma_id, order_status, order_company, order_user, address creater, create_time)
|
2024-11-25 14:46:39 +08:00
|
|
|
values(#{maId}, 0, #{orderCompany}, #{orderUser}, #{creater}, now())
|
2024-11-22 17:41:27 +08:00
|
|
|
</insert>
|
2024-11-23 17:15:01 +08:00
|
|
|
|
2024-11-26 10:59:41 +08:00
|
|
|
<delete id="deleteById">
|
|
|
|
|
delete from book_car_detail where id = #{id}
|
|
|
|
|
</delete>
|
|
|
|
|
|
2024-11-23 17:15:01 +08:00
|
|
|
<select id="getBookCarDetails" resultType="com.bonus.material.device.domain.vo.DevInfoVo">
|
2024-11-22 17:41:27 +08:00
|
|
|
SELECT
|
2024-11-26 10:59:41 +08:00
|
|
|
bcd.id as id,
|
2024-11-23 17:15:01 +08:00
|
|
|
d.ma_id as maId,
|
|
|
|
|
d.code as code,
|
|
|
|
|
d.device_name as deviceName,
|
|
|
|
|
d.device_weight as deviceWeight,
|
2024-11-26 10:25:17 +08:00
|
|
|
d.device_count as deviceCount,
|
2024-11-23 17:15:01 +08:00
|
|
|
d.type_id as typeId,
|
|
|
|
|
d.ma_status as maStatus,
|
|
|
|
|
d.brand as brand,
|
|
|
|
|
d.model_name as modelName,
|
|
|
|
|
mt.type_name as typeName,
|
2024-11-26 13:27:23 +08:00
|
|
|
mt.manage_type as manageType,
|
2024-11-23 17:15:01 +08:00
|
|
|
d.production_date as productionDate,
|
|
|
|
|
d.working_hours as workingHours,
|
|
|
|
|
d.serial_number as serialNumber,
|
2024-12-03 10:52:24 +08:00
|
|
|
mt.lease_price as dayLeasePrice,
|
2024-11-23 17:15:01 +08:00
|
|
|
d.person as person,
|
|
|
|
|
d.person_phone as personPhone,
|
|
|
|
|
c.company_name as companyName,
|
|
|
|
|
c.company_id as companyId,
|
|
|
|
|
c.operate_address as operateAddress,
|
2024-11-25 14:46:39 +08:00
|
|
|
d.create_time as createTime,
|
2024-12-16 13:31:52 +08:00
|
|
|
bcd.order_user as orderUser,
|
|
|
|
|
bcd.address as address
|
2024-11-23 17:15:01 +08:00
|
|
|
FROM ma_dev_info d
|
|
|
|
|
LEFT JOIN bm_company_info c ON d.own_co = c.company_id
|
|
|
|
|
LEFT JOIN book_car_detail bcd ON d.ma_id = bcd.ma_id
|
|
|
|
|
LEFT JOIN ma_type mt ON d.type_id = mt.type_id and mt.del_flag = '0'
|
|
|
|
|
where d.is_active = '1' and bcd.order_status = '0'
|
2024-11-26 11:15:54 +08:00
|
|
|
<if test="maId != null and maId != ''">
|
|
|
|
|
and bcd.ma_id = #{maId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="orderUser != null and orderUser != ''">
|
|
|
|
|
and bcd.order_user = #{orderUser}
|
|
|
|
|
</if>
|
2024-11-22 17:41:27 +08:00
|
|
|
</select>
|
|
|
|
|
|
2024-11-26 10:25:17 +08:00
|
|
|
<select id="selectDevInfoByMaId" resultType="com.bonus.material.device.domain.vo.DevInfoVo">
|
|
|
|
|
SELECT ma_id as maId,
|
|
|
|
|
order_user as orderUser
|
|
|
|
|
from book_car_detail
|
2024-11-26 18:55:15 +08:00
|
|
|
where ma_id = #{maId} and order_user = #{userId} and order_status = '0'
|
2024-11-26 10:25:17 +08:00
|
|
|
</select>
|
|
|
|
|
|
2024-11-22 17:41:27 +08:00
|
|
|
</mapper>
|