-
懒羊羊
2024-03-23 e20d7373595960ad6be9bd6373a3c6f186e76e5c
jcdm-main/src/main/resources/mapper/bs/formulaChild/BsFormulaChildInfoMapper.xml
@@ -29,6 +29,8 @@
        <result property="spareField4"    column="spare_field_4"    />
        <result property="collectData"    column="collect_data"    />
        <result property="results"    column="results"    />
        <result property="counts"    column="counts"    />
    </resultMap>
    <sql id="selectBsFormulaChildInfoVo">
@@ -47,6 +49,10 @@
            <if test="collectData != null  and collectData != ''"> and collect_data = #{collectData}</if>
            <if test="results != null  and result != ''"> and result = #{results}</if>
            <if test="materialCode != null  and materialCode != ''"> and material_code = #{materialCode}</if>
            <if test="paramCode != null  and paramCode != ''"> and param_code = #{paramCode}</if>
            <if test="spareField4 != null  and spareField4 != ''"> and spare_field_4 = #{spareField4}</if>
        </where>
        ORDER BY step_sort ASC
@@ -153,26 +159,39 @@
    </delete>
    <select id="selectBsFormulaChildInfoByTypeTopOne" parameterType="BsFormulaChildInfo" resultMap="BsFormulaChildInfoResult">
--         SELECT
--             TOP 1 *
--         FROM
--             bs_formula_child_info
--         WHERE NOT results = 'OK'
--           AND product_code =  #{productCode}
--           AND processes_code = #{processesCode}
--           AND operation_type = #{operationType}
--         ORDER BY step_sort ASC
        SELECT
            TOP 1 *
        FROM
            bs_formula_child_info
        WHERE NOT results = 'OK'
          AND product_code =  #{productCode}
          AND processes_code = #{processesCode}
        WHERE
            processes_code = #{processesCode}
          AND product_code = #{productCode}
          AND operation_type = #{operationType}
          AND (results IS NULL OR results = '')
        ORDER BY step_sort ASC
    </select>
    <select id="releaseCheck" resultMap="BsFormulaChildInfoResult" parameterType="BsFormulaChildInfo">
        SELECT
            *
        FROM
            bs_formula_child_info
        WHERE
            NOT results = 'OK'
          AND product_code = #{productCode}
          AND processes_code = #{processesCode};
    <select id="getCount" parameterType="BsFormulaChildInfo" resultMap="BsFormulaChildInfoResult">
        SELECT COUNT(*) AS counts
        FROM bs_formula_child_info
        WHERE (processes_code = #{processesCode} AND product_code = #{productCode})
          AND (results IS NULL OR results = '');
    </select>
    <select id="releaseCheck" parameterType="BsFormulaChildInfo" resultMap="BsFormulaChildInfoResult">
        SELECT COUNT(*) AS counts
        FROM bs_formula_child_info
        WHERE (processes_code = #{processesCode} AND product_code = #{productCode})
          AND (results IS NULL OR results = '');
    </select>
    <update id="workpieceRelease" parameterType="BsFormulaChildInfo">