<?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="org.springblade.mdm.machinefile.mapper.MachineFileMapper">
|
<resultMap id="BaseResultMap" type="org.springblade.mdm.machinefile.entity.MachineFile">
|
<id column="id" property="id"/>
|
<result column="name" property="name"/>
|
<result column="node_type" property="dirType"/>
|
<result column="status" property="status"/>
|
<result column="create_time" property="createTime"/>
|
<result column="update_time" property="updateTime"/>
|
<result column="is_deleted" property="isDeleted"/>
|
</resultMap>
|
|
<!--待接收机床文件分页查询-->
|
<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
|
from mdm_machine_file f join mdm_machine m on f.machine_code=m.code and m.is_deleted=0
|
<where>
|
f.status=1 and f.is_deleted=0
|
|
<if test="query.machineSpec!=null and query.machineSpec!=''">
|
and m.machine_spec=#{query.machineSpec,jdbcType=VARCHAR}
|
</if>
|
<if test="query.keyword!=null and query.keyword!=''">
|
and (
|
m.code like CONCAT('%', #{query.keyword,jdbcType=VARCHAR},'%') or m.name like CONCAT('%', #{query.keyword,jdbcType=VARCHAR},'%')
|
or f.name like CONCAT('%', #{query.keyword,jdbcType=VARCHAR},'%')
|
)
|
</if>
|
|
<if test="query.machineCode!=null and query.machineCode!=''">
|
and m.code= #{query.machineCode,jdbcType=VARCHAR}
|
</if>
|
<if test="query.deptIds!=null and query.deptIds.size()>0">
|
and m.owner_dept in
|
<foreach item="item" collection="query.deptIds" open="(" separator="," close=")">
|
#{item}
|
</foreach>
|
</if>
|
<if test="query.dirType!=null and query.dirType!=''">
|
and f.dir_type= #{query.dirType,jdbcType=VARCHAR}
|
</if>
|
<if test="query.dirType==null or query.dirType==''">
|
and f.dir_type='TEMP'
|
</if>
|
</where>
|
order by f.file_create_time desc
|
</select>
|
<!--
|
<select id="handlePageQuery" resultType="org.springblade.mdm.machinefile.vo.MachineAcceptedFileVO">
|
select f.id,f.name,f.machine_code,f.file_create_time arrived_time,f.md5,f.file_size,f.determine_time
|
from mdm_machine_file f join mdm_machine m on f.machine_code=m.code and m.is_deleted=0
|
<where>
|
f.dir_type='TEMP' and f.status=2 and f.is_deleted=0
|
|
<if test="query.confirmTimeBegin!=null">
|
and f.determine_time>=#{query.confirmTimeBegin}
|
</if>
|
<if test="query.confirmTimeEnd!=null">
|
and f.determine_time<=#{query.confirmTimeEnd}
|
</if>
|
order by f.file_create_time desc
|
</where>
|
</select>
|
-->
|
<!--工控网首页文件查询-->
|
<select id="pageQuery" resultType="org.springblade.mdm.machinefile.entity.MachineFile">
|
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 <> 4
|
|
<if test="query.name!=null and query.name!=''">
|
and f.name like CONCAT('%', #{query.name,jdbcType=VARCHAR},'%')
|
</if>
|
|
<if test="query.machineCode!=null and query.machineCode!=''">
|
and f.machine_code= #{query.machineCode,jdbcType=VARCHAR}
|
</if>
|
<if test="query.deptIds!=null and query.deptIds.size()>0">
|
and m.owner_dept in
|
<foreach item="item" collection="query.deptIds" open="(" separator="," close=")">
|
#{item}
|
</foreach>
|
</if>
|
<if test="query.dirType!=null and query.dirType!=''">
|
and f.dir_type= #{query.dirType,jdbcType=VARCHAR}
|
</if>
|
</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 <> 4 and f.dir_type='REC' and f.is_deleted=0 and f.exception_type is not null and f.exception_type <> 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 >= #{query.fileCreateTimeBegin}
|
</if>
|
<if test="query.fileCreateTimeEnd!=null">
|
and f.file_create_time <= #{query.fileCreateTimeEnd}
|
</if>
|
</where>
|
order by f.file_create_time desc
|
</select>
|
</mapper>
|