<?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.hxhq.business.mapper.BacteriaMapper">
    <update id="updateKcBatch">
        UPDATE t_bacteria SET tj = #{kc} WHERE id in
        <foreach item="item" index="index" collection="idList"  open="(" separator="," close=")">
            #{item}
        </foreach>
    </update>
    <select id="queryStudyList" resultType="com.hxhq.business.domain.Bacteria">
        SELECT b.*, s.name AS studyName
        FROM `t_bacteria`  b
        LEFT JOIN `t_study_bacteria` sb  ON b.id=sb.resource_id
        LEFT JOIN `t_study` s ON s.id = b.study_id
        <if test="ew.sqlSegment != '' and ew.sqlSegment != null">
            <where>
                ${ew.sqlSegment}
            </where>
        </if>
    </select>
</mapper>