12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <?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.ygj.yuemum.dao.admin.PhotoDao" >
- <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.admin.Photo" >
- <id column="id" property="id" jdbcType="INTEGER" />
- <result column="photo_code" property="photo_code" jdbcType="INTEGER" />
- <result column="photo_title" property="photo_title" jdbcType="VARCHAR" />
- </resultMap>
- <sql id="Base_Column_List" >
- id, photo_code, photo_title
- </sql>
- <!-- 得到所有的照片信息 -->
- <select id="getAll" resultMap="BaseResultMap" >
- select
- <include refid="Base_Column_List" />
- from photo
- </select>
- <!-- 根据id查找某个照片信息 -->
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from photo
- where photo_code = #{photo_code,jdbcType=INTEGER}
- </select>
- <!-- 根据id删除某个照片信息 -->
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from photo
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <!-- 插入一条照片信息 -->
- <insert id="insertSelective" parameterType="com.ygj.yuemum.domain.admin.Photo" >
- insert into photo
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="photo_code != null" >
- photo_code,
- </if>
- <if test="photo_title != null" >
- photo_title,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="photo_code != null" >
- #{photo_code,jdbcType=INTEGER},
- </if>
- <if test="photo_title != null" >
- #{photo_title,jdbcType=VARCHAR}
- </if>
- </trim>
- </insert>
- <!-- 根据id更新一条照片信息 -->
- <update id="updateByPrimaryKeySelective" parameterType="com.ygj.yuemum.domain.admin.Photo" >
- update photo
- <set >
- <if test="photo_code != null" >
- photo_code = #{photo_code,jdbcType=INTEGER},
- </if>
- <if test="photo_title != null" >
- photo_title = #{photo_title,jdbcType=VARCHAR}
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- </mapper>
|