Ver Fonte

需求变更

huan.wang há 6 anos atrás
pai
commit
d7d01528de

+ 8 - 0
src/main/java/com/ygj/yuemum/controller/admin/ImageUploadController.java

@@ -5,6 +5,7 @@ import com.ygj.yuemum.component.Constant;
 import com.ygj.yuemum.domain.admin.Photo;
 import com.ygj.yuemum.domain.admin.Resume;
 import com.ygj.yuemum.domain.maternitymatron.JlServiceUser;
+import com.ygj.yuemum.domain.maternitymatron.MmInfoPhoto;
 import com.ygj.yuemum.domain.pay.CustomerPayVoucher;
 import com.ygj.yuemum.service.admin.PhotoService;
 import com.ygj.yuemum.service.admin.ResumeService;
@@ -57,6 +58,13 @@ public class ImageUploadController {
                          @RequestParam(value = "id") Integer id,
                          @RequestParam(value = "type") Integer type) {
 //       照片类型 1:display 2:certificate 3:comment 4:service 5:meal
+        // 删除display
+        if (type == 1) {
+            List<Photo> photos = photoService.queryDisplays(id);
+            for(Photo photo:photos) {
+                photoService.deletePhoto(photo);
+            }
+        }
         String folder = "";
         int dot = file.getOriginalFilename().lastIndexOf('.');
         String newName = file.getOriginalFilename().substring(dot);

+ 47 - 45
src/main/java/com/ygj/yuemum/dao/admin/PhotoDao.java

@@ -1,46 +1,48 @@
-package com.ygj.yuemum.dao.admin;
-
-import com.ygj.yuemum.domain.admin.Photo;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-@Repository
-public interface PhotoDao {
-
-    /**
-     * 得到所有的照片信息
-     * @return List<Photo>
-     */
-    List<Photo> getAll();
-
-    /**
-     * 根据id删除某个照片信息
-     * @param
-     * @return
-     */
-    int deletePhoto(Photo record);
-
-    /**
-     * 插入一条用照片息
-     * @param record
-     * @return
-     */
-    int insertSelective(Photo record);
-
-    List<Photo> queryPhoto(Photo record);
-    String selectDisplay(Photo record);
-    /**
-     * 根据id查找某个照片信息
-     * @param id
-     * @return User
-     */
-    Photo selectByPrimaryKey(Integer id);
-
-    /**
-     * 根据id更新一条照片信息
-     * @param record
-     * @return
-     */
-    int updateByPrimaryKeySelective(Photo record);
+package com.ygj.yuemum.dao.admin;
+
+import com.ygj.yuemum.domain.admin.Photo;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public interface PhotoDao {
+
+    /**
+     * 得到所有的照片信息
+     * @return List<Photo>
+     */
+    List<Photo> getAll();
+
+    /**
+     * 根据id删除某个照片信息
+     * @param
+     * @return
+     */
+    int deletePhoto(Photo record);
+
+    List<Photo> queryDisplays(Integer servant_code);
+
+    /**
+     * 插入一条用照片息
+     * @param record
+     * @return
+     */
+    int insertSelective(Photo record);
+
+    List<Photo> queryPhoto(Photo record);
+    String selectDisplay(Photo record);
+    /**
+     * 根据id查找某个照片信息
+     * @param id
+     * @return User
+     */
+    Photo selectByPrimaryKey(Integer id);
+
+    /**
+     * 根据id更新一条照片信息
+     * @param record
+     * @return
+     */
+    int updateByPrimaryKeySelective(Photo record);
 }

+ 43 - 43
src/main/java/com/ygj/yuemum/dao/maternitymatron/MmInfoPhotoDao.java

@@ -1,44 +1,44 @@
-package com.ygj.yuemum.dao.maternitymatron;
-
-import com.ygj.yuemum.domain.maternitymatron.MmInfoPhoto;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-@Repository
-public interface MmInfoPhotoDao {
-
-    /**
-     * 得到所有的照片信息
-     * @return List<Photo>
-     */
-    List<MmInfoPhoto> getAll();
-
-    /**
-     * 根据id删除某个照片信息
-     * @param id
-     * @return
-     */
-    int deleteByPrimaryKey(Integer id);
-
-    /**
-     * 插入一条用照片息
-     * @param record
-     * @return
-     */
-    int insertSelective(MmInfoPhoto record);
-
-    /**
-     * 根据id查找某个照片信息
-     * @param id
-     * @return User
-     */
-    MmInfoPhoto selectByPrimaryKey(Integer id);
-
-    /**
-     * 根据id更新一条照片信息
-     * @param record
-     * @return
-     */
-    int updateByPrimaryKeySelective(MmInfoPhoto record);
+package com.ygj.yuemum.dao.maternitymatron;
+
+import com.ygj.yuemum.domain.maternitymatron.MmInfoPhoto;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public interface MmInfoPhotoDao {
+
+    /**
+     * 得到所有的照片信息
+     * @return List<Photo>
+     */
+    List<MmInfoPhoto> getAll();
+
+    /**
+     * 根据id删除某个照片信息
+     * @param id
+     * @return
+     */
+    int deleteByPrimaryKey(Integer id);
+
+    /**
+     * 插入一条用照片息
+     * @param record
+     * @return
+     */
+    int insertSelective(MmInfoPhoto record);
+
+    /**
+     * 根据id查找某个照片信息
+     * @param id
+     * @return User
+     */
+    MmInfoPhoto selectByPrimaryKey(Integer id);
+
+    /**
+     * 根据id更新一条照片信息
+     * @param record
+     * @return
+     */
+    int updateByPrimaryKeySelective(MmInfoPhoto record);
 }

+ 3 - 0
src/main/java/com/ygj/yuemum/service/admin/PhotoService.java

@@ -58,6 +58,9 @@ public class PhotoService {
     public Photo getPhoto(Integer id) {
         return photoDao.selectByPrimaryKey(id);
     }
+    public List<Photo> queryDisplays(Integer servant_code) {
+        return photoDao.queryDisplays(servant_code);
+    }
 
     public int reBuildResume(String servant_code) {
         try {

+ 37 - 37
src/main/java/com/ygj/yuemum/service/maternitymatron/MmInfoPhotoService.java

@@ -1,38 +1,38 @@
-package com.ygj.yuemum.service.maternitymatron;
-
-import com.ygj.yuemum.dao.maternitymatron.MmInfoPhotoDao;
-import com.ygj.yuemum.domain.maternitymatron.MmInfoPhoto;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-@Service
-public class MmInfoPhotoService {
-
-    @Autowired
-
-
-    private MmInfoPhotoDao mmInfoPhotoDao;
-
-    public List<MmInfoPhoto> getMmInfoPhotos() {
-        List<MmInfoPhoto>  mmInfoPhotos = mmInfoPhotoDao.getAll();
-        return mmInfoPhotos;
-    }
-
-    public int addMmInfoPhoto(MmInfoPhoto mmInfoPhoto) {
-        return mmInfoPhotoDao.insertSelective(mmInfoPhoto);
-    }
-
-    public int deleteMmInfoPhoto(Integer id) {
-        return mmInfoPhotoDao.deleteByPrimaryKey(id);
-    }
-
-    public int updateMmInfoPhoto(MmInfoPhoto mmInfoPhoto) {
-        return mmInfoPhotoDao.updateByPrimaryKeySelective(mmInfoPhoto);
-    }
-
-    public MmInfoPhoto getMmInfoPhoto(Integer id) {
-        return mmInfoPhotoDao.selectByPrimaryKey(id);
-    }
+package com.ygj.yuemum.service.maternitymatron;
+
+import com.ygj.yuemum.dao.maternitymatron.MmInfoPhotoDao;
+import com.ygj.yuemum.domain.maternitymatron.MmInfoPhoto;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class MmInfoPhotoService {
+
+    @Autowired
+
+
+    private MmInfoPhotoDao mmInfoPhotoDao;
+
+    public List<MmInfoPhoto> getMmInfoPhotos() {
+        List<MmInfoPhoto>  mmInfoPhotos = mmInfoPhotoDao.getAll();
+        return mmInfoPhotos;
+    }
+
+    public int addMmInfoPhoto(MmInfoPhoto mmInfoPhoto) {
+        return mmInfoPhotoDao.insertSelective(mmInfoPhoto);
+    }
+
+    public int deleteMmInfoPhoto(Integer id) {
+        return mmInfoPhotoDao.deleteByPrimaryKey(id);
+    }
+
+    public int updateMmInfoPhoto(MmInfoPhoto mmInfoPhoto) {
+        return mmInfoPhotoDao.updateByPrimaryKeySelective(mmInfoPhoto);
+    }
+
+    public MmInfoPhoto getMmInfoPhoto(Integer id) {
+        return mmInfoPhotoDao.selectByPrimaryKey(id);
+    }
 }

+ 143 - 133
src/main/resources/mybatis/mapper/admin/PhotoMapper.xml

@@ -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>

+ 80 - 80
src/main/resources/mybatis/mapper/maternitymatron/MmInfoPhotoMapper.xml

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