<?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.newfiber.system.mapper.SmsConfigMapper"> <!-- 通用查询映射结果 --> <resultMap type="com.newfiber.system.domain.SmsConfig" id="SmsConfigResult"> <result property="id" column="id"/> <result property="category" column="category"/> <result property="smsCode" column="sms_code"/> <result property="templateId" column="template_id"/> <result property="accessKey" column="access_key"/> <result property="secretKey" column="secret_key"/> <result property="regionId" column="region_id"/> <result property="signName" column="sign_name"/> <result property="remark" column="remark"/> <result property="status" column="status"/> <result property="delFlag" column="del_flag"/> <result property="createBy" column="create_by"/> <result property="createTime" column="create_time"/> <result property="updateBy" column="update_by"/> <result property="updateTime" column="update_time"/> </resultMap> <!-- 通用查询结果列 --> <sql id="Base_Column_List"> t.id , t.category , t.sms_code , t.template_id , t.access_key , t.secret_key , t.region_id , t.sign_name , t.remark , t.status , t.del_flag , t.create_by , t.create_time , t.update_by , t.update_time </sql> <sql id="Where_Condition"> <if test="request.category != null and request.category != ''"> and t.category = #{request.category} </if> <if test="request.smsCode != null and request.smsCode != ''"> and t.sms_code = #{request.smsCode} </if> <if test="request.templateId != null and request.templateId != ''"> and t.template_id = #{request.templateId} </if> <if test="request.regionId != null and request.regionId != ''"> and t.region_id = #{request.regionId} </if> <if test="request.signName != null and request.signName != ''"> and t.sign_name = #{request.signName} </if> <if test="request.status != null and request.status != ''"> and t.status = #{request.status} </if> </sql> <select id="selectByCondition" resultMap="SmsConfigResult"> select <include refid="Base_Column_List"/> from sys_sms_config t where t.del_flag = 0 <include refid="Where_Condition"/> order by t.${request.orderBy} </select> </mapper>