<?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.jg.project.about.mapper.AboutPartThreeMapper"> <resultMap type="AboutPartThree" id="AboutPartThreeResult"> <result property="id" column="id" /> <result property="titleOne" column="title_one" /> <result property="titleTwo" column="title_two" /> <result property="remarks" column="remarks" /> <result property="icon" column="icon" /> <result property="createTime" column="create_time" /> <result property="updateTime" column="update_time" /> </resultMap> <sql id="selectAboutPartThreeVo"> select id, title_one, title_two, remarks, icon, create_time, update_time from about_part_three </sql> <select id="selectAboutPartThreeList" parameterType="AboutPartThree" resultMap="AboutPartThreeResult"> <include refid="selectAboutPartThreeVo"/> <where> <if test="titleOne != null and titleOne != ''"> and title_one = #{titleOne}</if> <if test="titleTwo != null and titleTwo != ''"> and title_two = #{titleTwo}</if> <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if> <if test="icon != null and icon != ''"> and icon = #{icon}</if> <if test="id != null and id != ''"> and id = #{id}</if> </where> </select> </mapper>