sql mybatis
来源:互联网 发布:淘宝网美国大樱桃 编辑:程序博客网 时间:2024/05/29 14:26
<select id="selectStudentByCondition" resultType="Student">
select * from student where name like '%' #{namecon} '%' and age>#{agecon}
</select>
<select id="selectStudentByCondition2" resultType="Student">
select * from student where name like '%' #{0} '%' and age>#{1}
</select>
<select id="selectStudentByMap" resultType="Student">
select * from student where name like '%' #{nameCondition} '%'
and age> #{ageCondition}
</select>
<select id="selectStudentByConditions" resultType="Student">
select * from student where name like '%' #{0} '%' and age > #{1}
</select>
<select id="selectStudentIf" resultType="Student">
select * from student where 1=1
<if test="name !=null and name!=''">
and name like '%' #{name} '%'
</if>
<if test="age > 0">
and age > #{age}
</if>
</select>
<select id="selectStudentWhere" resultType="Student">
select * from student
<where>
<if test="name!=null and name!=''">
and name like '%' #{name} '%'
</if>
<if test="age>0">
and age>#{age}
</if>
</where>
</select>
select * from student where name like '%' #{namecon} '%' and age>#{agecon}
</select>
<select id="selectStudentByCondition2" resultType="Student">
select * from student where name like '%' #{0} '%' and age>#{1}
</select>
<select id="selectStudentByMap" resultType="Student">
select * from student where name like '%' #{nameCondition} '%'
and age> #{ageCondition}
</select>
<select id="selectStudentByConditions" resultType="Student">
select * from student where name like '%' #{0} '%' and age > #{1}
</select>
<select id="selectStudentIf" resultType="Student">
select * from student where 1=1
<if test="name !=null and name!=''">
and name like '%' #{name} '%'
</if>
<if test="age > 0">
and age > #{age}
</if>
</select>
<select id="selectStudentWhere" resultType="Student">
select * from student
<where>
<if test="name!=null and name!=''">
and name like '%' #{name} '%'
</if>
<if test="age>0">
and age>#{age}
</if>
</where>
</select>
阅读全文
0 0
- mybatis-sql
- Mybatis-sql
- mybatis sql
- sql mybatis
- MyBatis--动态SQL---sql片断
- MyBatis dynamic sql demo!!!
- mybatis动态SQL语句
- MyBatis动态SQL
- mybatis 打印sql语句
- MyBatis 动态SQL
- Mybatis 动态SQL
- MyBatis动态SQL
- MyBatis动态SQL完整版
- MyBatis显示SQL语句
- Mybatis Dynamic SQL
- mybatis动态sql
- mybatis动态SQL语句
- mybatis动态SQL语句
- java金额数字转中文工具类
- 百度语音使用
- spring四种依赖注入方式
- 【每日一题(7)】8球胜负(eight) UESTC
- 【每日一题(8)】Mammoth's Genome Decoding CodeForces
- sql mybatis
- jar包,war包和tar包的区别
- linux实现彩色进度条,rpm和yum安装的区别和进程的task_struck结构
- CSAPP第三章学习笔记(二)
- Java开发-Java中代理设计模式的实现
- 【每日一题(9)】Duizi and Shunzi HDU
- LeetCode:Best Time to Buy and Sell Stock with Transaction Fee
- 【每日一题(10)】Hero HDU-4310
- 抖动