yangys
2025-09-22 0bdfd76339bb58be09927b8c2fe268175c3a7cc8
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
43
44
45
46
47
48
<?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.NcProgramApprovedMapper">
    <resultMap id="BaseResultMap" type="org.springblade.mdm.program.entity.NcProgramApproved">
        <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>
    <!--导出工控网分页查询-->
    <select id="exportDncPageQuery" resultType="org.springblade.mdm.program.vo.NcProgramExportDncPageVO">
        select a.id,a.title,n.name,a.nc_node_id,n.process_no,n.process_edition,n.drawing_no,n.drawing_no_edition,n.process_name,a.create_time,a.update_time,u.name exporter
        from mdm_nc_program_approved a
            inner join mdm_nc_node_his n on a.nc_node_id=n.id
            left join blade_user u on a.update_user=u.id
 
        <where>
            a.is_deleted=0 and a.status=#{query.status}
            <if test="query.name!=null and query.name!=''">
                and n.name like CONCAT('%', #{query.name,jdbcType=VARCHAR},'%')
            </if>
 
            <if test="query.createTimeBegin!=null">
                and a.create_time &gt;= #{query.createTimeBegin}
            </if>
            <if test="query.createTimeEnd!=null">
                and a.create_time &lt;= #{query.createTimeEnd}
            </if>
            <if test="query.queryType == 'self'">
                and a.programmer_id = #{query.userId}
            </if>
            <if test="query.queryType=='group'">
               and a.programmer_id IN
                    (
                        select id from blade_user where
                        <foreach collection="query.userDeptIds" item="deptId"  open="(" separator="or" close=")" >
                            dept_id like #{deptId}
                        </foreach>
                    )
 
            </if>
        </where>
        order by a.create_time desc
    </select>
</mapper>