TrialDriveShopMapper.xml 3.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="cn.com.glsx.admin.modules.mapper.TrialDriveShopMapper">
    <resultMap id="BaseResultMap" type="cn.com.glsx.admin.modules.entity.TrialDriveShop">
        <!--
          WARNING - @mbg.generated
        -->
        <id column="id" jdbcType="INTEGER" property="id"/>
        <result column="shop_name" jdbcType="VARCHAR" property="shopName"/>
        <result column="shop_code" jdbcType="VARCHAR" property="shopCode"/>
        <result column="shop_level" jdbcType="VARCHAR" property="shopLevel"/>
        <result column="area" jdbcType="VARCHAR" property="area"/>
        <result column="province" jdbcType="VARCHAR" property="province"/>
        <result column="city" jdbcType="VARCHAR" property="city"/>
        <result column="address" jdbcType="VARCHAR" property="address"/>
        <result column="fence_id" jdbcType="INTEGER" property="fenceId"/>
        <result column="del_flag" jdbcType="TINYINT" property="delFlag"/>
        <result column="created_date" jdbcType="TIMESTAMP" property="createdDate"/>
        <result column="created_by" jdbcType="INTEGER" property="createdBy"/>
        <result column="updated_date" jdbcType="TIMESTAMP" property="updatedDate"/>
        <result column="updated_by" jdbcType="INTEGER" property="updatedBy"/>
    </resultMap>
    <sql id="Base_Column_List">
        <!--
          WARNING - @mbg.generated
        -->
        id, shop_name, shop_code, shop_level, area, province, city, address, fence_id,
        del_flag, created_date, created_by, updated_date, updated_by
    </sql>

    <select id="search" resultType="cn.com.glsx.admin.modules.model.TrialDriveShopDTO">
        select ttds.id         shopId,
               ttds.shop_name  shopName,
               ttds.shop_code  shopCode,
               ttds.shop_level shopLevel,
               ttds.area,
               ttds.province,
               ttds.city,
               ttds.address,
               tef.id          fenceId,
               tef.fence_name  fenceName
        from t_trial_drive_shop ttds
                 left join t_electric_fence tef on tef.created_by = ttds.created_by
        where ttds.del_flag = 0
          and tef.biz_fence_type = 13
    </select>

    <select id="export" resultType="cn.com.glsx.admin.modules.model.export.TrialDriveShopExport">
        select ttds.id         shopId,
               ttds.shop_name  shopName,
               ttds.shop_code  shopCode,
               ttds.shop_level shopLevel,
               ttds.area,
               ttds.province,
               ttds.city,
               ttds.address,
               tef.lnglat,
               tef.radius,
               tef.fence_name  fenceName
        from t_trial_drive_shop ttds
                 left join t_electric_fence tef on tef.created_by = ttds.created_by
        where ttds.del_flag = 0
          and tef.biz_fence_type = 13
    </select>

    <select id="selectById" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from t_trial_drive_shop ttds
        where ttds.del_flag = 0
        and ttds.id = #{id}
    </select>

    <update id="logicDeleteById">
        update t_electric_fence
        set del_flag = -1
        where id = #{id}
    </update>
</mapper>