queryModel.xml
661 Bytes
<?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.mapping.queryModel" >
<!--banner查询 -->
<select id="queryBanner" resultType="java.util.HashMap" parameterType="java.util.HashMap">
SELECT
t.id,
t.title,
t.pic_url AS picUrl,
t.is_up AS isUp,
t.weight,
t.jump_type as jumpType
FROM
t_base_banner t
WHERE
t.is_delete =0
<if test="title != null">
AND t.title LIKE #{title}
</if>
ORDER BY t.create_dt DESC, t.weight DESC
</select>
</mapper>