1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <?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.kmall.api.dao.ApiAdPositionMapper">
- <!-- 可根据自己的需求,是否要使用 -->
- <resultMap type="com.kmall.api.entity.AdPositionVo" id="adPositionMap">
- <result property="id" column="id"/>
- <result property="name" column="name"/>
- <result property="width" column="width"/>
- <result property="height" column="height"/>
- <result property="desc" column="desc"/>
- </resultMap>
- <select id="queryObject" resultType="com.kmall.api.entity.AdPositionVo">
- select * from mall_ad_position where id = #{value}
- </select>
- <select id="queryList" resultType="com.kmall.api.entity.AdPositionVo">
- select * from mall_ad_position
- <choose>
- <when test="sidx != null and sidx.trim() != ''">
- order by ${sidx} ${order}
- </when>
- <otherwise>
- order by id desc
- </otherwise>
- </choose>
- <if test="offset != null and limit != null">
- limit #{offset}, #{limit}
- </if>
- </select>
- <select id="queryTotal" resultType="int">
- select count(*) from mall_ad_position
- </select>
- <insert id="save" parameterType="com.kmall.api.entity.AdPositionVo" useGeneratedKeys="true" keyProperty="id">
- insert into mall_ad_position
- (
- `name`,
- `width`,
- `height`,
- `desc`
- )
- values
- (
- #{name},
- #{width},
- #{height},
- #{desc}
- )
- </insert>
- <update id="update" parameterType="com.kmall.api.entity.AdPositionVo">
- update mall_ad_position
- <set>
- <if test="name != null">`name` = #{name},</if>
- <if test="width != null">`width` = #{width},</if>
- <if test="height != null">`height` = #{height},</if>
- <if test="desc != null">`desc` = #{desc}</if>
- </set>
- where id = #{id}
- </update>
- <delete id="delete">
- delete from mall_ad_position where id = #{value}
- </delete>
- <delete id="deleteBatch">
- delete from mall_ad_position where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|