123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- <?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_type" property="photo_type" jdbcType="INTEGER" />
- <result column="resume_code" property="resume_code" jdbcType="INTEGER" />
- <result column="servant_code" property="servant_code" jdbcType="VARCHAR" />
- <result column="photo_path" property="photo_path" jdbcType="VARCHAR" />
- <result column="photo_name" property="photo_name" jdbcType="VARCHAR" />
- <result column="comment" property="comment" jdbcType="VARCHAR" />
- </resultMap>
- <sql id="Base_Column_List" >
- id, photo_type, resume_code,photo_path,servant_code,photo_name,comment
- </sql>
- <!-- 得到所有的照片信息 -->
- <select id="getAll" resultMap="BaseResultMap" >
- select
- <include refid="Base_Column_List" />
- from mm_info_photo
- </select>
- <select id="queryPhoto" resultMap="BaseResultMap" parameterType="com.ygj.yuemum.domain.admin.Photo">
- select
- photo_name,photo_path
- from mm_info_photo
- where 1=1
- <if test="photo_type != null and photo_type !=''">
- and photo_type = #{photo_type,jdbcType=VARCHAR}
- </if>
- <if test="servant_code != null and servant_code !=''">
- and servant_code = #{servant_code,jdbcType=VARCHAR}
- </if>
- </select>
- <!-- 根据id查找某个照片信息 -->
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from mm_info_photo
- where resume_code = #{resume_code,jdbcType=INTEGER}
- </select>
- <select id="selectDisplay" resultType="java.lang.String" parameterType="com.ygj.yuemum.domain.admin.Photo" >
- select
- photo_name
- from mm_info_photo
- where 1=1
- <if test="servant_code != null and servant_code !=''">
- and servant_code = #{servant_code,jdbcType=INTEGER}
- </if>
- <if test="photo_type != null and photo_type !=''">
- and photo_type = #{photo_type,jdbcType=INTEGER}
- </if>
- </select>
- <!-- 根据id删除某个照片信息 -->
- <delete id="deletePhoto" parameterType="com.ygj.yuemum.domain.admin.Photo">
- delete from mm_info_photo
- where 1 = 1
- <if test="photo_name != null and photo_name !=''">
- and photo_name = #{photo_name,jdbcType=VARCHAR}
- </if>
- <if test="servant_code != null and servant_code !=''">
- and servant_code = #{servant_code,jdbcType=VARCHAR}
- </if>
- </delete>
- <!-- 插入一条照片信息 -->
- <insert id="insertSelective" parameterType="com.ygj.yuemum.domain.admin.Photo" >
- insert into mm_info_photo
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="resume_code != null" >
- resume_code,
- </if>
- <if test="photo_type != null" >
- photo_type,
- </if>
- <if test="photo_path != null" >
- photo_path,
- </if>
- <if test="servant_code != null" >
- servant_code,
- </if>
- <if test="photo_name != null" >
- photo_name
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="resume_code != null" >
- #{resume_code,jdbcType=INTEGER},
- </if>
- <if test="photo_type != null" >
- #{photo_type,jdbcType=VARCHAR},
- </if>
- <if test="photo_path != null" >
- #{photo_path,jdbcType=VARCHAR},
- </if>
- <if test="servant_code != null" >
- #{servant_code,jdbcType=VARCHAR},
- </if>
- <if test="photo_name != null" >
- #{photo_name,jdbcType=VARCHAR}
- </if>
- </trim>
- </insert>
- <!-- 根据id更新一条照片信息 -->
- <update id="updateByPrimaryKeySelective" parameterType="com.ygj.yuemum.domain.admin.Photo" >
- update mm_info_photo
- <set >
- <if test="resume_code != null" >
- resume_code = #{resume_code,jdbcType=INTEGER},
- </if>
- <if test="photo_type != null" >
- photo_type = #{photo_type,jdbcType=VARCHAR},
- </if>
- <if test="photo_path != null" >
- photo_path = #{photo_path,jdbcType=VARCHAR},
- </if>
- <if test="servant_code != null" >
- servant_code = #{servant_code,jdbcType=VARCHAR},
- </if>
- <if test="photo_name != null" >
- photo_name = #{photo_name,jdbcType=VARCHAR}
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- </mapper>
|