yangys
2025-06-30 813f0f6d391b7f24682204c22c059ef69b124fa6
blade-service/blade-mdm/src/main/java/org/springblade/mdm/program/mapper/NcProgramMapper.xml
@@ -34,17 +34,29 @@
    <!--    <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,
    <sql id="all_columns">id,tenant_id,nc_node_id,code,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
        limit 1
    </select>
    <select id="pageQuery" resultType="org.springblade.mdm.program.vo.NcProgramVO">
        select id,nc_node_id,name,machine_code,part_no,part_no_edition,process_name,craft_edition from mdm_nc_program p
        where is_deleted=0 and is_last_edition=1 and (category='program' or category='subprogram')
        <where>
            <if test="query.name!=null and query.name!=''">
                and p.name like CONCAT('%', #{query.name,jdbcType=VARCHAR},'%')
            </if>
        </where>
    </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>