zss
2023-09-25 d1ea726be5628c46fb6be700a0197002d55d39f1
inspect-server/src/main/resources/mapper/RawInsProductMapper.xml
@@ -1,36 +1,6 @@
<?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="com.yuanchu.mom.mapper.RawInsProductMapper">
    <!--批量清空检验状态-->
    <update id="updateBatch">
        UPDATE mom_ocean.raw_ins_product o
        <trim prefix="set" suffixOverrides=",">
            <trim prefix="test_value=case" suffix="end,">
                <foreach collection="rawInsProductList" item="item" index="index">
                    WHEN o.id = #{item.id} THEN null
                </foreach>
            </trim>
            <trim prefix="device_id=case" suffix="end,">
                <foreach collection="rawInsProductList" item="item" index="index">
                    WHEN o.id = #{item.id} THEN null
                </foreach>
            </trim>
            <trim prefix="test_state=case" suffix="end,">
                <foreach collection="rawInsProductList" item="item" index="index">
                    WHEN o.id = #{item.id} THEN null
                </foreach>
            </trim>
            <trim prefix="user_id=case" suffix="end,">
                <foreach collection="rawInsProductList" item="item" index="index">
                    WHEN o.id = #{item.id} THEN null
                </foreach>
            </trim>
        </trim>
        WHERE o.id in
        <foreach collection="rawInsProductList" index="index" item="item" separator="," open="(" close=")">
            #{item.id, jdbcType=BIGINT}
        </foreach>
    </update>
    <!--根据原材料检验单id查询检验项目-->
    <select id="getresult" resultType="java.lang.Integer">
        select test_state