yangys
2025-09-22 12f2fafc574afb4c534ab59244f2b954d1876e9f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?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.program.mapper.DncBackFileMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="org.springblade.mdm.program.entity.DncBackFile">
        <id column="id" property="id"/>
        <result column="status" property="status"/>
        <result column="create_time" property="createTime"/>
        <result column="update_time" property="updateTime"/>
        <result column="is_deleted" property="isDeleted"/>
    </resultMap>
 
    <!--DNC回传程序处理分页-->
    <select id="pageQuery" resultType="org.springblade.mdm.program.vo.DncBackFileVO">
        select f.id,n.name name,m.code machine_code, m.name machine_name,f.create_time,currnode.process_instance_id
        from mdm_dnc_back_file f
        join mdm_nc_node_his n on f.nc_node_id=n.id
        left join mdm_nc_node currnode on f.nc_node_id=currnode.id
        left join mdm_machine m on n.machine_code=m.code
 
       <where>
           f.is_deleted=0
 
        <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 n.name like CONCAT('%', #{query.keyword,jdbcType=VARCHAR},'%')
                )
        </if>
       <if test="query.createTimeBegin!=null">
           and f.create_time &gt;= #{query.createTimeBegin}
       </if>
       <if test="query.createTimeEnd!=null">
           and f.create_time &lt;= #{query.createTimeEnd}
       </if>
      </where>
        order by f.id desc
    </select>
 
 
 
</mapper>