<?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.reptileclient.jlifeapp.dao.jz.DyLaikeAccountShopMapInfoMapper">
  <resultMap id="BaseResultMap" type="com.reptileclient.jlifeapp.entity.jz.DyLaikeAccountShopMapInfo">
    <!--@mbg.generated-->
    <!--@Table dy_laike_account_shop_map_info-->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="shop_account_id" jdbcType="VARCHAR" property="shopAccountId" />
    <result column="shop_name" jdbcType="VARCHAR" property="shopName" />
    <result column="shop_poi_id" jdbcType="VARCHAR" property="shopPoiId" />
    <result column="deleted" jdbcType="INTEGER" property="deleted" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, shop_account_id, shop_name, shop_poi_id, deleted
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select
    <include refid="Base_Column_List" />
    from jlife_reports.dy_laike_account_shop_map_info
    where id = #{id,jdbcType=INTEGER}
  </select>
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.reptileclient.jlifeapp.entity.jz.DyLaikeAccountShopMapInfo" useGeneratedKeys="true">
      <!--@mbg.generated-->
      insert into jlife_reports.dy_laike_account_shop_map_info
      <trim prefix="(" suffix=")" suffixOverrides=",">
          <if test="shopAccountId != null and shopAccountId != ''">
              shop_account_id,
          </if>
          <if test="shopName != null and shopName != ''">
              shop_name,
          </if>
          <if test="shopPoiId != null and shopPoiId != ''">
              shop_poi_id,
          </if>
          <if test="deleted != null">
              deleted,
          </if>
      </trim>
      <trim prefix="values (" suffix=")" suffixOverrides=",">
          <if test="shopAccountId != null and shopAccountId != ''">
              #{shopAccountId,jdbcType=VARCHAR},
          </if>
          <if test="shopName != null and shopName != ''">
              #{shopName,jdbcType=VARCHAR},
          </if>
          <if test="shopPoiId != null and shopPoiId != ''">
              #{shopPoiId,jdbcType=VARCHAR},
          </if>
          <if test="deleted != null">
              #{deleted,jdbcType=INTEGER},
          </if>
      </trim>
  </insert>

  <update id="updateDeleted">
     update  jlife_reports.dy_laike_account_shop_map_info set deleted =1 where shop_poi_id = #{shopPoiId,jdbcType=VARCHAR}
    </update>

  <select id="selectAll" resultMap="BaseResultMap">
      select *
      from jlife_reports.dy_laike_account_shop_map_info
      where deleted = 0
  </select>

  <update id="clear">
      update jlife_reports.dy_laike_account_shop_map_info
      set deleted = 1
  </update>
</mapper>
