Newer
Older
newfiber-termite / newfiber-termites / newfiber-termites-dataup / src / main / resources / mapper / termite / JingchuProjectConfigMapper.xml
@xiongkai xiongkai on 13 Jun 3 KB 对接荆楚
<?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.JingchuProjectConfigMapper">

    <!-- 通用查询映射结果 -->
    <resultMap type="com.newfiber.termite.domain.jingchu.JingchuProjectConfig" id="JingchuProjectConfigResult">
        <result property="id" column="id"/>
        <result property="projectCode" column="project_code"/>
        <result property="mnNo" column="mn_no"/>
        <result property="stationId" column="station_id"/>
        <result property="stationName" column="station_name"/>
        <result property="deviceId" column="device_id"/>
        <result property="deviceName" column="device_name"/>
        <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.project_code
    	, t.mn_no
    	, t.station_id
    	, t.station_name
    	, t.device_id
    	, t.device_name
    	, 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.projectCode != null and request.projectCode != ''">
            and t.project_code = #{request.projectCode}
        </if>
        <if test="request.mnNo != null and request.mnNo != ''">
            and t.mn_no = #{request.mnNo}
        </if>
        <if test="request.stationId != null and request.stationId != ''">
            and t.station_id = #{request.stationId}
        </if>
        <if test="request.stationName != null and request.stationName != ''">
            and t.station_name = #{request.stationName}
        </if>
        <if test="request.deviceId != null and request.deviceId != ''">
            and t.device_id = #{request.deviceId}
        </if>
        <if test="request.deviceName != null and request.deviceName != ''">
            and t.device_name = #{request.deviceName}
        </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="JingchuProjectConfigResult">
        select
        <include refid="Base_Column_List"/>
        from thi_jingchu_project_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="JingchuProjectConfigResult">
        select
        <include refid="Base_Column_List"/>
        from thi_jingchu_project_config t
        <include refid="Join_Table"/>
        where t.id = #{id} and t.del_flag = 0
    </select>

</mapper>