yangys
2025-06-30 532611ebe6ccecd6d17930c33a24ddfd5b1c2610
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
49
50
51
<?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.NcProgramMapper">
    <resultMap id="BaseResultMap" type="org.springblade.mdm.program.entity.NcProgram">
        <id column="id" property="id"/>
        <result column="code" property="code"/>
        <result column="name" property="name"/>
        <result column="package_name" property="packageName"/>
        <result column="machine_code" property="machineCode"/>
 
        <result column="part_no" property="partNo"/>
        <result column="is_cured" property="isCured"/>
        <result column="expire_date" property="expireDate"/>
        <result column="process_edition" property="processEdition"/>
        <result column="is_last_edition" property="isLastEdition"/>
        <result column="is_locked" property="isLocked"/>
        <result column="task_assign_time" property="taskAssignTime"/>
 
        <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="pageQuery" resultType="org.springblade.mdm.basesetting.machine.vo.MachineVO">
        select m.id,m.name,m.code,g.dict_key machine_group_code,g.dict_value machine_group_name,m.machine_spec,m.manufacturer,m.operator
        from mdm_machine m join blade_dict_biz g on m.machine_group_code=g.dict_key and g.code='machine_group' and g.is_deleted=0
            ${ew.customSqlSegment}
    </select>
-->
 
 
    <!--    <select id="parentTree" resultMap="treeNodeResultMap">-->
<!--        select id, parent_id, dict_value as title, id as "value", id as "key" from blade_dict where is_deleted = 0 and parent_id = 0-->
<!--    </select>-->
    <sql id="all_columns">id,tenant_id,nc_node_id,code,name,package_name,machine_code,part_no,is_cured,
  expire_date,process_edition,is_last_edition,is_locked,task_assign_time,status,create_dept,is_deleted,create_time,create_user,update_time,update_user</sql>
    <select id="getCuredNcProgram" resultMap="BaseResultMap">
        select <include refid="all_columns"/> from mdm_nc_program
        where is_deleted=0 and is_cured=1 and part_no=#{partNo} and is_last_edition=1
        and machine_code in (select code from mdm_machine where machine_group_code=#{machineGroupCode})
        order by create_time desc
    </select>
    <!--
    <select id="getLastNcProgram" resultType="org.springblade.mdm.program.entity.NcProgram">
        select <include refid="all_columns"/> from mdm_nc_program
        where is_deleted=0 and is_last_edition=1 order by create_time desc limit 1
    </select>
    -->
</mapper>