Fixiaobai
2023-09-04 dd2554435b9ced61e2a6a06627145fca3bf2685b
inspection-server/src/main/resources/mapper/QualificationRateStatisticsMapper.xml
@@ -11,9 +11,9 @@
        i.end_time endTime
        FROM inspection i
        INNER JOIN inspection_material im ON i.id = im.inspection_id
        where (i.state = 1 AND i.inspection_status is NOT NULL and im.state=1)
        where (i.state = 1  and im.state=1)
        <if test="dto.beginDate!=null and dto.endDate!=null">
            DATE_FORMAT( i.end_time, '%Y-%m-%d' ) BETWEEN #{dto.beginDate}
            and DATE_FORMAT( i.end_time, '%Y-%m-%d' ) BETWEEN #{dto.beginDate}
            AND #{dto.endDate}
            AND DATE_FORMAT( i.start_time, '%Y-%m-%d' )>= #{dto.beginDate}
        </if>
@@ -27,7 +27,7 @@
            and im.name=#{dto.sample}
        </if>
        <if test="dto.code!=null and dto.code!=''">
            and i.code=#{dto.code}
            and im.code=#{dto.code}
        </if>
    </select>
    <select id="selectProjectionsByCondition" resultMap="ImInfoMap">
@@ -40,7 +40,7 @@
        ipr.id iprId,
        ipr.`name` iprName,
        ipr.test_state testState,
        i.code iCode,
        im.code imCode,
        i.type type
        FROM
        inspection i,
@@ -56,7 +56,7 @@
        AND ipr.test_state is not null
        AND ipr.test_state = 0
        <if test="dto.beginDate!=null and dto.endDate!=null">
            DATE_FORMAT( i.end_time, '%Y-%m-%d' ) BETWEEN #{dto.beginDate}
            and DATE_FORMAT( i.end_time, '%Y-%m-%d' ) BETWEEN #{dto.beginDate}
            AND #{dto.endDate}
            AND DATE_FORMAT( i.start_time, '%Y-%m-%d' )>= #{dto.beginDate}
        </if>
@@ -70,7 +70,7 @@
            and im.name=#{dto.sample}
        </if>
        <if test="dto.code!=null and dto.code!=''">
            and i.code=#{dto.code}
            and im.code=#{dto.code}
        </if>
    </select>
    <select id="selectProjection" resultMap="ImInfoMap">
@@ -86,10 +86,8 @@
        AND  i.state = 1
        AND im.state = 1
        AND ipr.state = 1
        AND i.inspection_status is NOT NULL
        AND ipr.test_state is not null
        <if test="dto.beginDate!=null and dto.endDate!=null">
            DATE_FORMAT( i.end_time, '%Y-%m-%d' ) BETWEEN #{dto.beginDate}
            and DATE_FORMAT( i.end_time, '%Y-%m-%d' ) BETWEEN #{dto.beginDate}
            AND #{dto.endDate}
            AND DATE_FORMAT( i.start_time, '%Y-%m-%d' )>= #{dto.beginDate}
        </if>
@@ -103,9 +101,9 @@
            and im.name=#{dto.sample}
        </if>
        <if test="dto.code!=null and dto.code!=''">
            and i.code=#{dto.code}
            and im.code=#{dto.code}
        </if>
        and i.code in
        and im.code in
        <foreach collection="list" item="l" open="(" close=")" separator="," >
            #{l.code}
        </foreach>
@@ -124,9 +122,9 @@
        i.end_time endTime
        FROM inspection i
        INNER JOIN inspection_material im ON i.id = im.inspection_id
        where (i.state = 1 AND i.inspection_status is NOT NULL and im.state=1)
        where (i.state = 1 and im.state=1)
        <if test="dto.beginDate!=null and dto.endDate!=null">
            DATE_FORMAT( i.end_time, '%Y-%m-%d' ) BETWEEN #{dto.beginDate}
           and  DATE_FORMAT( i.end_time, '%Y-%m-%d' ) BETWEEN #{dto.beginDate}
            AND #{dto.endDate}
            AND DATE_FORMAT( i.start_time, '%Y-%m-%d' )>= #{dto.beginDate}
        </if>
@@ -140,7 +138,7 @@
            and im.name=#{dto.sample}
        </if>
        <if test="dto.code!=null and dto.code!=''">
            and i.code=#{dto.code}
            and im.code=#{dto.code}
        </if>
    </select>
    <select id="getSampleOptions" resultType="java.util.Map">
@@ -152,17 +150,17 @@
            i.inspection_status inspectionStatus,
            i.start_time startTime,
            i.end_time endTime,
            i.`code`
            im.`code` code
        FROM
            inspection i
                INNER JOIN inspection_material im ON i.id = im.inspection_id
        WHERE
            ( i.state = 1 AND i.inspection_status IS NOT NULL AND im.state = 1 )
            ( i.state = 1  AND im.state = 1 )
    </select>
    <resultMap id="ImInfoMap" type="com.yuanchu.limslaboratory.pojo.ImInfo">
        <result property="imId" column="imId"/>
        <result property="iCode" column="iCode"/>
        <result property="imCode" column="imCode"/>
        <result property="imName" column="imName"/>
        <result property="startTime" column="startTime"/>
        <result property="endTime" column="endTime"/>