<?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.wisenergy.mapper.ShopZxMapper">
    <resultMap id="zxMap" type="cn.wisenergy.model.app.shopZx">
        <id column="zxid" property="zxid"/>
        <result column="zxUrl" property="zxUrl"/>
        <result column="zxLikes" property="zxLikes"/>
        <result column="userid" property="userid"/>
        <result column="zxName" property="zxName"/>
        <result column="zxShenHe" property="zxShenHe"/>
        <result column="zxField" property="zxField"/>
        <result column="zxAddress" property="zxAddress"/>
        <result column="imgUrl" property="imgUrl"/>
    </resultMap>
    <sql id="table">
        shop_zx
    </sql>

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

    <sql id="cols_exclude_id">
        zxUrl,userId,zxName,zxField,imgUrl,zxAddress
    </sql>

    <sql id="vals">
        #{zxUrl},#{userId},#{zxName},#{zxField},#{imgUrl},#{zxAddress}
    </sql>
    <!--资讯内容插入-->
    <insert id="zxadd" parameterType="cn.wisenergy.model.app.shopZx">
        insert into
        <include refid="table"/>
        (<include refid="cols_exclude_id"/>)
        value(
        <include refid="vals"/>
        )
    </insert>

    <!--资讯内容插入-->
    <!--<insert id="zxadd" parameterType="cn.wisenergy.model.app.shopZx" >-->
      <!--INSERT INTO-->
          <!--(zxUrl, userId,zxName,zxField,imgUrl)-->
      <!--VALUES(-->
         <!--#{zxUrl},#{userid},#{zxName},#{zxField},#{imgUrl}-->
       <!--）-->
    <!--</insert>-->

    <!--资讯内容倒叙查询-->
    <select id="selectAll" parameterType="cn.wisenergy.model.app.shopZx" resultType="cn.wisenergy.model.app.shopZx">
    select zxid as zxid,zxUrl as zxUrl,
    zxLikes as zxLikes,userid as userid,zxName as zxName,
    zxShenHe as zxShenHe,zxField as zxField,zxDate as zxDate,
    imgUrl as imgUrl,zxAddress as zxAddress from shop_zx order by zxid desc LIMIT PageSize,10
    </select>

    <!--资讯总记录数查询-->
    <select id="selectAllNum" parameterType="cn.wisenergy.model.app.shopZx" >
    select count (*) from shop_zx
    </select>

</mapper>