mybatis问题整理

// List<String> findBuildByProject(String prjName);

//单参数时使用<if></if>标签判断采用“_parameter”
<select id="findBuildByProject" parameterType="string" resultType="string">
    select b.build_name
    FROM
    tb_project p inner join tb_build b on p.id = b.prj_id
    <where>
        <if test="_parameter != null and _parameter !=''">
            and p.prj_name = #{_parameter}
        </if>
    </where>
    order by b.id desc
</select>

猜你喜欢

转载自www.cnblogs.com/itzlg/p/11290817.html