123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <?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.admin.dao.AdPositionDao">
- <resultMap type="com.kmall.admin.entity.AdPositionEntity" 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.admin.entity.AdPositionEntity">
- select
- `id`,
- `name`,
- `width`,
- `height`,
- `desc`
- from mall_ad_position
- where id = #{id}
- </select>
- <select id="queryList" resultType="com.kmall.admin.entity.AdPositionEntity">
- select
- `id`,
- `name`,
- `width`,
- `height`,
- `desc`
- from mall_ad_position
- WHERE 1=1
- <if test="name != null and name.trim() != ''">
- AND name LIKE concat('%',#{name},'%')
- </if>
- <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
- WHERE 1=1
- <if test="name != null and name.trim() != ''">
- AND name LIKE concat('%',#{name},'%')
- </if>
- </select>
- <insert id="save" parameterType="com.kmall.admin.entity.AdPositionEntity" 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.admin.entity.AdPositionEntity">
- 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>
|