ElectricInStoreMapper.xml 2.24 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="cn.com.glsx.stdinterface.modules.mapper.ElectricInStoreMapper">

    <resultMap id="BaseResultMap" type="cn.com.glsx.stdinterface.modules.model.ElectricInStoreDrive">
        <id property="id" column="id" jdbcType="INTEGER"/>
        <result property="sn" column="sn" jdbcType="VARCHAR"/>
        <result property="fenceId" column="fence_id" jdbcType="INTEGER"/>
        <result property="sveSystemId" column="sve_system_id" jdbcType="INTEGER"/>
        <result property="positionState" column="position_state" jdbcType="TINYINT"/>
        <result property="gpsState" column="gps_state" jdbcType="TINYINT"/>
        <result property="gpsTime" column="gps_time" jdbcType="TIMESTAMP"/>
        <result property="createdTime" column="created_time" jdbcType="TIMESTAMP"/>
        <result property="updatedTime" column="updated_time" jdbcType="TIMESTAMP"/>
    </resultMap>

    <resultMap id="ElectricInStoreMap" type="cn.com.glsx.stdinterface.dto.ElectricInStoreDto">
        <id property="id" column="id" jdbcType="INTEGER"/>
        <result property="sn" column="sn" jdbcType="VARCHAR"/>
        <result property="fenceId" column="fence_id" jdbcType="INTEGER"/>
        <result property="sveSystemId" column="sve_system_id" jdbcType="INTEGER"/>
        <result property="positionState" column="position_state" jdbcType="TINYINT"/>
        <result property="gpsState" column="gps_state" jdbcType="TINYINT"/>
        <result property="gpsTime" column="gps_time" jdbcType="TIMESTAMP"/>
        <result property="createdTime" column="created_time" jdbcType="TIMESTAMP"/>
        <result property="updatedTime" column="updated_time" jdbcType="TIMESTAMP"/>
    </resultMap>

    <sql id="Base_Column_List">
        id,sn,fence_id,
        sve_system_id,position_state,gps_state,
        gps_time,created_time,updated_time
    </sql>

    <select id="getElectricInStore" resultMap="ElectricInStoreMap">
        select *
        from t_electric_instore_drive teid
        where teid.fence_id=#{fenceId}
        and teid.sn=#{sn}
        and teid.gps_state=0
        and teid.gps_time=#{gpsTime}
    </select>
</mapper>