<?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.termite.mapper.JingchuDeviceConfigMapper"> <!-- 通用查询映射结果 --> <resultMap type="com.newfiber.termite.domain.jingchu.JingchuDeviceConfig" id="JingchuDeviceConfigResult"> <result property="id" column="id"/> <result property="sn" column="sn"/> <result property="order" column="order"/> <result property="uploadConfirmFlag" column="upload_confirm_flag"/> <result property="remark" column="remark"/> <result property="status" column="status"/> <result property="createBy" column="create_by"/> <result property="createTime" column="create_time"/> <result property="updateBy" column="update_by"/> <result property="updateTime" column="update_time"/> <result property="delFlag" column="del_flag"/> </resultMap> <!-- 通用查询结果列 --> <sql id="Base_Column_List"> t.id , t.sn , t.order , t.upload_confirm_flag , t.remark , t.status , t.create_by , t.create_time , t.update_by , t.update_time , t.del_flag </sql> <sql id="Where_Condition"> <if test="request.sn != null and request.sn != ''"> and t.sn = #{request.sn} </if> <if test="request.order != null and request.order != ''"> and t.order = #{request.order} </if> <if test="request.uploadConfirmFlag != null and request.uploadConfirmFlag != ''"> and t.upload_confirm_flag = #{request.uploadConfirmFlag} </if> <if test="request.status != null and request.status != ''"> and t.status = #{request.status} </if> </sql> <sql id="Join_Table"> </sql> <select id="selectByCondition" resultMap="JingchuDeviceConfigResult"> select <include refid="Base_Column_List"/> from thi_jingchu_device_config t <include refid="Join_Table"/> where t.del_flag = 0 <include refid="Where_Condition"/> order by t.${request.orderBy} </select> <select id="selectOneById" resultMap="JingchuDeviceConfigResult"> select <include refid="Base_Column_List"/> from thi_jingchu_device_config t <include refid="Join_Table"/> where t.id = #{id} and t.del_flag = 0 </select> </mapper>