下面展示一些 内联代码片
。
// A code block
var foo = 'bar';
// An highlighted block
select * from 表明
insert into 表明 values()//添加
update 表明 set 各种数据 where id=xx//修改
dalete from 表明 where id=xx//根据id查询
select * from 表明 where name like '%xx%' and xx>x and
xx<x limit 1,5//分页
select count(*) from 表明 where name like '%xx%' and xx>x and xx<x//查询数据总条数
//分页and查询总条数 简便集合
<sql id="sqlwhere">
<where>
<if test="name!=null and name!=''">
and StudentName like "%"#{
name}"%"
</if>
<if test="beginAge>0">
and age >#{
beginAge}
</if>
<if test="endAge>0">
and age < #{
endAge}
</if>
</where>
</sql>
<select id="selByPage" resultType="student" parameterType="dto">
select * from studentinfo
<include refid="sqlwhere"></include>
limit #{
offSet},#{
pageSize}
</select>
<select id="countStu" resultType="Integer" parameterType="dto">
select count(*) from studentinfo
<include refid="sqlwhere"></include>
</