<?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="Message">
<resultMap type="com.itewo.bean.Message" id="MessageResult">
<id column="ID" jdbcType="INTEGER" property="id"/>
<result column="COMMAND" jdbcType="VARCHAR" property="command"/>
<result column="DESCRIPTION" jdbcType="VARCHAR" property="description"/>
<result column="CONTENT" jdbcType="BOOLEAN" property="content"/>
</resultMap>
<select id="queryMessageList" parameterType="com.itewo.bean.Message" resultMap="MessageResult">
select ID,COMMAND,DESCRIPTION,CONTENT from message
<where>
<if test="description != null and ''!=description ">
and description like CONCAT(CONCAT('%', #{description:VARCHAR}),'%')
</if>
<if test="command != null and ''!=command ">
and command = #{command:VARCHAR}
</if>
</where>
</select>
</mapper>
分享sql map