<select id="select1" resultType="BaseresultMap">
SELECT * FROM User WHERE Age = ‘18'
<if test="name != null">
AND name like #{name}
</if>
</select>
<select id="select2" resultType="BaseresultMap">
SELECT * FROM User WHERE Age = ‘18'
<choose>
<when test="Job != null">
AND Job =#{Job}
</when>
<otherwise>
AND Job="none"
</otherwise>
</choose>
</select>
<select id="select5" resultType="BaseresultBase">
select * from User where id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
public List<User> select5(List<Integer> ids);
<select id="select3" resultType="BaseresultMap">
SELECT * FROM User
<where>
<if test="Age != null">
Age = #{Age}
</if>
<if test="Job != null">
AND Job like #{Job}
</if>
<where>
</select>
<update id="update1">
update User
<set>
<if test="username != null">username=#{username},</if>
<if test="password != null">password=#{password},</if>
<if test="Age != null">Age =#{Age}</if>
</set>
where id=#{id}
</update>
<pre code_snippet_id="2048504" snippet_file_name="blog_20161214_2_7439616" class="prettyprint lang-xml" name="code"><pre code_snippet_id="2048504" snippet_file_name="blog_20161214_2_7439616" name="code" class="html"><pre code_snippet_id="2048504" snippet_file_name="blog_20161214_2_7439616"></pre> <pre></pre> <pre></pre> <p></p> <pre></pre> <pre></pre> <pre></pre> <pre code_snippet_id="2048504" snippet_file_name="blog_20161214_3_3393435" name="code" class="html"></pre><pre code_snippet_id="2048504" snippet_file_name="blog_20161214_3_3393435"></pre> <pre></pre> <pre></pre> <pre></pre> <pre></pre> <pre></pre> </pre><div class="save_code tracking-ad" data-mod="popu_249"><a href="javascript:;" rel="external nofollow" ><img src="http://static.blog.csdn.net/images/save_snippets.png"></a></div></pre>
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有