Newer
Older
smartwell_demos / src / main / resources / mapper / BusWellInfoMapper.xml
<?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.casic.dao.BusWellInfoMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.casic.model.BusWellInfo">
        <id column="ID" property="id"/>
        <result column="WELL_CODE" property="wellCode"/>
        <result column="WELL_NAME" property="wellName"/>
        <result column="DEEP" property="deep"/>
        <result column="COORDINATE_X" property="coordinateX"/>
        <result column="COORDINATE_Y" property="coordinateY"/>
        <result column="LAT_BAIDU" property="latBaidu"/>
        <result column="LNG_BAIDU" property="lngBaidu"/>
        <result column="LNG_GAODE" property="lngGaode"/>
        <result column="LAT_GAODE" property="latGaode"/>
        <result column="AREA" property="area"/>
        <result column="POSITION" property="position"/>
        <result column="DEPTID" property="deptid"/>
        <result column="PHOTOS" property="photos"/>
        <result column="NOTES" property="notes"/>
        <result column="WELL_TYPE" property="wellType"/>
        <result column="STAFF" property="staff"/>
        <result column="TEL" property="tel"/>
        <result column="TS" property="ts"/>
        <result column="VALID" property="valid"/>
        <result column="BFZT" property="bfzt"/>
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        ID AS id, WELL_CODE AS "wellCode", WELL_NAME AS "wellName", DEEP AS deep,
        COORDINATE_X AS "coordinateX", COORDINATE_Y AS "coordinateY", LAT_BAIDU AS "latBaidu",
        LNG_BAIDU AS "lngBaidu", LNG_GAODE AS "lngGaode", LAT_GAODE AS "latGaode", AREA AS area,
         POSITION AS position, DEPTID AS deptid, PHOTOS AS photos, NOTES AS notes,
         WELL_TYPE AS "wellType", STAFF AS staff, TEL AS tel, TS AS ts, VALID AS valid,
          BFZT AS bfzt,RESPONSIBLE_DEPT AS "responsibleDept",ROAD  AS road
    </sql>

    <select id="getWellListByCode" resultType="com.casic.model.BusWellInfo">
        SELECT
        <include refid="Base_Column_List"/>
        FROM bus_well_info
        WHERE VALID = '1' AND WELL_CODE = #{wellCode}
    </select>


</mapper>