yangys
2025-09-29 4c7296d45efe849dc70a3b2e2240c905481a91c9
blade-service/blade-mdm/src/main/java/org/springblade/mdm/machinefile/mapper/MachineFileMapper.xml
@@ -11,6 +11,12 @@
        <result column="is_deleted" property="isDeleted"/>
    </resultMap>
    <!--删除没有引用的,且标记为删除的文件记录-->
    <delete id="deleteNotUseRecords">
        delete from mdm_machine_file_change_his where machine_file_id in (select id mdm_machine_file where id not in (select machine_file_id from mdm_machine_accepted_file) and status=4);
        delete from mdm_machine_file where id not in (select machine_file_id from mdm_machine_accepted_file) and status=4;
    </delete>
    <!--待接收机床文件分页查询-->
    <select id="filePageForAccept" resultType="org.springblade.mdm.machinefile.entity.MachineFile">
        select f.id,f.name,f.machine_code,f.file_create_time,f.md5,f.file_size,f.dir_type,f.program_status
@@ -65,7 +71,7 @@
    -->
    <!--工控网首页文件查询-->
    <select id="pageQuery" resultType="org.springblade.mdm.machinefile.entity.MachineFile">
        select f.id,f.name,f.machine_code,f.file_create_time, f.file_modify_time,f.md5,f.file_size,f.create_time,f.update_time
        select f.id,f.name,f.machine_code,f.dir_type,f.file_create_time, f.file_modify_time,f.md5,f.oss_name,f.file_size,f.create_time,f.update_time
        from mdm_machine_file f join mdm_machine m on f.machine_code=m.code and m.is_deleted=0
        <where>
            f.is_deleted=0 and f.status &lt;&gt; 4
@@ -89,4 +95,25 @@
        </where>
        order by f.file_create_time desc
    </select>
    <!--异常文件记录查询-->
    <select id="exceptionFilePageQuery" resultType="org.springblade.mdm.machinefile.entity.MachineFile">
        select f.id,f.name,f.machine_code,f.file_create_time, f.file_modify_time,f.md5,f.file_size,f.exception_type,f.create_time,f.update_time
        from mdm_machine_file f join mdm_machine m on f.machine_code=m.code and m.is_deleted=0
        <where>
            f.status &lt;&gt; 4 and f.dir_type='REC' and f.is_deleted=0 and f.exception_type is not null and f.exception_type &lt;&gt; 0
            <if test="query.name!=null and query.name!=''">
                and f.name like CONCAT('%', #{query.name,jdbcType=VARCHAR},'%')
            </if>
            <if test="query.fileCreateTimeBegin!=null">
                and  f.file_create_time &gt;= #{query.fileCreateTimeBegin}
            </if>
            <if test="query.fileCreateTimeEnd!=null">
                and  f.file_create_time &lt;= #{query.fileCreateTimeEnd}
            </if>
        </where>
        order by f.file_create_time desc
    </select>
</mapper>