<?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="io.renren.modules.app.dao.GoodsDao">

    <!-- 可根据自己的需求，是否要使用 -->
    <resultMap type="io.renren.modules.app.entity.GoodsEntity" id="goodsMap">
                    <result property="goodsId" column="goods_id"/>
                    <result property="name" column="name"/>
                    <result property="intro" column="intro"/>
                    <result property="price" column="price"/>
                    <result property="num" column="num"/>
            </resultMap>

    <select id="queryByPage" parameterType="io.renren.modules.app.entity.GoodsEntity"
            resultType="io.renren.modules.app.entity.GoodsEntity">

        select * from tb_goods where 1=1

                    <if test=" goodsId!=null and goodsId!='' ">
                and goods_id like CONCAT(goodsId,"%")
            </if>
                    <if test=" name!=null and name!='' ">
                and name like CONCAT(name,"%")
            </if>
                    <if test=" intro!=null and intro!='' ">
                and intro like CONCAT(intro,"%")
            </if>
                    <if test=" price!=null and price!='' ">
                and price like CONCAT(price,"%")
            </if>
                    <if test=" num!=null and num!='' ">
                and num like CONCAT(num,"%")
            </if>
        
    </select>


</mapper>