ShopZxMapper.xml 2.24 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
<?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>-->

    <!--资讯内容倒叙查询-->
licc's avatar
licc committed
51
    <select id="selectAll" parameterType="cn.wisenergy.model.app.shopZx" resultType="cn.wisenergy.model.app.shopZx">
52 53 54
    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,
55
    imgUrl as imgUrl,zxAddress as zxAddress from shop_zx order by zxid desc limit #{beginPos},#{pageSize}
56 57 58 59 60
    </select>

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

63 64


65
</mapper>