为了账号安全,请及时绑定邮箱和手机立即绑定

<?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

正在回答

0 回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信