4.30总结
代码量:300
今天遇到的问题如下:
<?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.lian.mapper.PolicyMapper">
<select id="selectAll" resultType="com.lian.pojo.Policy">
select name,organ,pubdata,type from policy
<where>
<if test="name!=null and name!=''">
name like concat('%',#{name},'%')
</if>
<if test="document!=null and document!=''">
document like concat('%',#{document},'%')
</if>
<if test="organ!=null and organ!=''">
organ like concat('%',#{organ},'%')
</if>
<if test="text!=null and text!=''">
text like concat('%',#{text},'%')
</if>
</where>
</select>
</mapper>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.lian.mapper.PolicyMapper">
<select id="selectAll" resultType="com.lian.pojo.Policy">
select name,organ,pubdata,type from policy
<where>
<if test="name!=null and name!=''">
name like concat('%',#{name},'%')
</if>
<if test="document!=null and document!=''">
document like concat('%',#{document},'%')
</if>
<if test="organ!=null and organ!=''">
organ like concat('%',#{organ},'%')
</if>
<if test="text!=null and text!=''">
text like concat('%',#{text},'%')
</if>
</where>
</select>
</mapper>