123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?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.ApiSpecificationMapper">
- <!-- 可根据自己的需求,是否要使用 -->
- <resultMap type="com.kmall.api.entity.SpecificationVo" id="specificationMap">
- <result property="id" column="id"/>
- <result property="name" column="name"/>
- <result property="sort_order" column="sort_order"/>
- </resultMap>
- <select id="queryObject" resultMap="specificationMap">
- select * from mall_specification where id = #{value}
- </select>
- <select id="queryList" resultMap="specificationMap">
- select * from mall_specification
- <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_specification
- </select>
- <insert id="save" parameterType="com.kmall.api.entity.SpecificationVo" useGeneratedKeys="true" keyProperty="id">
- insert into mall_specification
- (
- `name`,
- `sort_order`
- )
- values
- (
- #{name},
- #{sort_order}
- )
- </insert>
- <update id="update" parameterType="com.kmall.api.entity.SpecificationVo">
- update mall_specification
- <set>
- <if test="name != null">`name` = #{name},</if>
- <if test="sort_order != null">`sort_order` = #{sort_order}</if>
- </set>
- where id = #{id}
- </update>
- <delete id="delete">
- delete from mall_specification where id = #{value}
- </delete>
- <delete id="deleteBatch">
- delete from mall_specification where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|