<select id="selectSelective" resultMap="xxx" parameterType="xxx"> select <include refid="Base_Column_List"/> from xxx where del_flag=0 <choose> <when test="xxx !=null and xxx != ''"> and xxx like concat(concat('%', #{xxx}), '%') </when> <otherwise> and xxx like '**%' </otherwise> </choose> </select>