a-tuoheng-airline/src/main/resources/mapper/airline/AirlineFileMapper.xml

98 lines
4.4 KiB
XML
Raw Normal View History

2026-01-23 18:42:11 +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.ruoyi.airline.mapper.AirlineFileMapper">
<!-- 结果映射 -->
<resultMap type="com.ruoyi.airline.mapper.entity.AirlineFileEntity" id="AirlineFileResult">
<id property="id" column="id" />
<result property="name" column="name" />
<result property="airVendor" column="air_vendor" />
<result property="airType" column="air_type" />
<result property="fileName" column="file_name" />
<result property="fileUrl" column="file_url" />
<result property="type" column="type" />
<result property="source" column="source" />
<result property="status" column="status" />
<result property="fileMd5" column="file_md5" />
<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>
<!-- 保存航线文件 -->
2026-01-27 17:30:13 +08:00
<insert id="save" parameterType="com.ruoyi.airline.mapper.entity.AirlineFileEntity" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
2026-01-23 18:42:11 +08:00
insert into airline_file (name, air_vendor, air_type, file_name, file_url, type, source, status, file_md5, create_by, create_time, update_by, update_time, remark)
2026-01-28 20:15:05 +08:00
values (#{name}, #{airVendor}, #{airType}, #{fileName}, #{fileUrl}, #{type}, #{source}, #{status}, #{fileMd5}, #{createBy}, now(), #{updateBy}, now(), #{remark})
2026-01-23 18:42:11 +08:00
</insert>
<!-- 根据ID列表查询航线文件 -->
<select id="selectFileListByIds" parameterType="java.util.List" resultMap="AirlineFileResult">
select id, name, air_vendor, air_type, file_name, file_url, type, source, status, file_md5, create_by, create_time, update_by, update_time, remark
from airline_file
where id in
<foreach item="id" collection="list" open="(" separator="," close=")">
#{id}
</foreach>
</select>
2026-01-28 20:15:05 +08:00
<!-- 根据航线名称模糊查询航线文件 -->
2026-01-28 09:11:59 +08:00
<select id="selectFileNameLike" parameterType="java.lang.String" resultMap="AirlineFileResult">
select id, name, air_vendor, air_type, file_name, file_url, type, source, status, file_md5, create_by, create_time, update_by, update_time, remark
from airline_file
where name like concat(#{name}, '%')
</select>
2026-01-28 20:15:05 +08:00
<!-- 根据分组ID和航线名称模糊查询航线文件 -->
<select id="selectFileNameLikeByGroupId" resultMap="AirlineFileResult">
select af.id, af.name, af.air_vendor, af.air_type, af.file_name, af.file_url, af.type, af.source, af.status, af.file_md5, af.create_by, af.create_time, af.update_by, af.update_time, af.remark
from airline_file af
inner join airline_file_group_info afgi on af.id = afgi.airline_id
where afgi.del_flag = 0
and afgi.group_id = #{groupId}
and af.name like concat(#{name}, '%')
</select>
<!-- 更新航线文件 -->
<update id="update" parameterType="com.ruoyi.airline.mapper.entity.AirlineFileEntity">
update airline_file
<trim prefix="set" suffixOverrides=",">
name = #{name},
<if test="airVendor != null">
air_vendor = #{airVendor},
</if>
<if test="airType != null">
air_type = #{airType},
</if>
<if test="fileName != null">
file_name = #{fileName},
</if>
<if test="fileUrl != null">
file_url = #{fileUrl},
</if>
<if test="type != null">
type = #{type},
</if>
<if test="source != null">
source = #{source},
</if>
<if test="status != null">
status = #{status},
</if>
<if test="fileMd5 != null">
file_md5 = #{fileMd5},
</if>
<if test="updateBy != null">
update_by = #{updateBy},
</if>
update_time = now(),
<if test="remark != null">
remark = #{remark},
</if>
</trim>
where id = #{id}
</update>
2026-01-23 18:42:11 +08:00
</mapper>