|
@@ -1,134 +1,144 @@
|
|
|
-<?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,photo_type
|
|
|
- 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>
|
|
|
- order by photo_type asc
|
|
|
- </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>
|
|
|
-
|
|
|
+<?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="INTEGER" />
|
|
|
+ <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,photo_type
|
|
|
+ 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>
|
|
|
+ order by photo_type asc
|
|
|
+ </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>
|
|
|
+
|
|
|
+ <select id="queryDisplays" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
|
|
+ select
|
|
|
+ *
|
|
|
+ from mm_info_photo
|
|
|
+ where servant_code = #{servant_code,jdbcType=INTEGER}
|
|
|
+ and photo_type = 1
|
|
|
+ </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>
|