<?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.zm.order.tool.server.design.ZmStoreConfigProfileDao">

    <resultMap id="OrderMap" type="com.zm.order.tool.server.model.ZmStoreConfigProfile">
        <id column="id" jdbcType="INTEGER" property="id"/>
        <result column = "store_id" jdbcType = "INTEGER" property = "storeId"/>
        <result column = "key" jdbcType = "VARCHAR" property = "key"/>
        <result column = "value" jdbcType = "VARCHAR" property = "value"/>
        <result column = "app" jdbcType = "VARCHAR" property = "app"/>
        <result column = "type" jdbcType = "VARCHAR" property = "type"/>
        <result column = "description" jdbcType = "VARCHAR" property = "description"/>
        <result column = "ext_info" jdbcType = "VARCHAR" property = "extInfo"/>
        <result column = "ext_write" jdbcType = "INTEGER" property = "extWrite"/>
        <result column = "ext_type" jdbcType = "INTEGER" property = "extType"/>
        <result column = "created_at" jdbcType = "TIMESTAMP" property = "createdAt"/>
        <result column = "updated_at" jdbcType = "TIMESTAMP" property = "updatedAt"/>
    </resultMap>

    <sql id="tb">
        zm_store_config_profile
    </sql>

    <sql id="cols_all">
        id,
        <include refid="cols_exclude_id"/>
    </sql>

    <sql id="cols_exclude_id">
        store_id,
        `key`,
        `value`,
        app,
        `type`,
        description,
        ext_info,
        ext_write,
        ext_type,
        created_at,
        updated_at
    </sql>

    <select id="selectList" parameterType="map" resultMap="OrderMap">
        select
        <include refid="cols_all"/>
        from
        <include refid="tb"/>
        where store_id = #{storeId} order by id desc
    </select>

    <update id="update" parameterType="map">
        update
        <include refid="tb"/>
        set value = #{value}
        where id = #{id}
    </update>

</mapper>