瀏覽代碼

志愿者信息列表查询以及回显和详情

LiRong 1 月之前
父節點
當前提交
f3544086df

+ 101 - 0
leromro-core/src/main/java/com/leromro/core/controller/AddressController.java

@@ -0,0 +1,101 @@
+package com.leromro.core.controller;
+
+import java.util.List;
+
+
+import com.leromro.common.utils.SecurityUtils;
+import com.leromro.core.service.AddressService;
+import io.swagger.annotations.Api;
+import com.leromro.common.core.domain.R;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.leromro.common.annotation.Log;
+import com.leromro.common.core.controller.BaseController;
+import com.leromro.common.core.domain.AjaxResult;
+import com.leromro.common.enums.BusinessType;
+import com.leromro.system.domain.Address;
+
+
+/**
+ * 受服务地址Controller
+ * 
+ * @author ruoyi
+ * @date 2025-04-08
+ */
+@RestController
+@Api(tags = "受服务地址")
+@RequestMapping("/system/address")
+public class AddressController extends BaseController
+{
+    @Autowired
+    private AddressService addressService;
+
+    /**
+     * 查询受服务地址列表
+     */
+    @ApiOperation("查询受服务地址列表")
+   // @PreAuthorize("@ss.hasPermi('system:address:list')")
+    @GetMapping("/list")
+    public R<List<Address>> list()
+    {
+        Long userId = SecurityUtils.getUserId();
+        List<Address> list = addressService.selectLAddressList(userId);
+        return R.ok(list);
+    }
+
+    /**
+     * 获取受服务地址详细信息
+     */
+    @ApiOperation("获取受服务地址详细信息")
+   // @PreAuthorize("@ss.hasPermi('system:address:query')")
+    @GetMapping(value = "/{addressId}")
+    public R<Address> getInfo(@PathVariable("addressId") Long addressId)
+    {
+        return R.ok(addressService.selectLAddressByAddressId(addressId));
+    }
+
+    /**
+     * 新增受服务地址
+     */
+    @ApiOperation("新增受服务地址")
+  //  @PreAuthorize("@ss.hasPermi('system:address:add')")
+    @Log(title = "受服务地址", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody Address address)
+    {   Long userId = SecurityUtils.getUserId();
+        address.setUserId(userId);
+        return toAjax(addressService.insertLAddress(address));
+    }
+
+    /**
+     * 修改受服务地址
+     */
+    @ApiOperation("修改受服务地址")
+   // @PreAuthorize("@ss.hasPermi('system:address:edit')")
+    @Log(title = "受服务地址", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody Address address)
+    {
+        return toAjax(addressService.updateLAddress(address));
+    }
+
+    /**
+     * 删除受服务地址
+     */
+    @ApiOperation("删除受服务地址")
+  //  @PreAuthorize("@ss.hasPermi('system:address:remove')")
+    @Log(title = "受服务地址", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{addressIds}")
+    public R<Integer> remove(@PathVariable Long[] addressIds)
+    {
+        return R.ok(addressService.deleteLAddressByAddressIds(addressIds));
+    }
+}

+ 39 - 7
leromro-core/src/main/java/com/leromro/core/controller/VolunteerInfoController.java

@@ -3,6 +3,7 @@ package com.leromro.core.controller;
 
 import com.leromro.common.core.domain.AjaxResult;
 import com.leromro.common.core.domain.R;
+import com.leromro.common.core.page.TableDataInfo;
 import com.leromro.common.utils.SecurityUtils;
 import com.leromro.core.domain.VolunteerInfo;
 import com.leromro.core.domain.vo.VolunteerInfoVO;
@@ -11,14 +12,19 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.List;
+
+import static com.leromro.common.utils.PageUtils.startPage;
+
 /**
  * 志愿者信息
  * @author lr
  * @since 2025-04-07
  */
-@Api(tags = "志愿者注册")
+@Api(tags = "志愿者注册以及查询")
 @RestController
 @RequestMapping("/core/volunteer/info")
 public class VolunteerInfoController {
@@ -26,9 +32,9 @@ public class VolunteerInfoController {
     private IVolunteerInfoService volunteerInfoService;
     /**
      * 新增志愿者信息
+     * 已测试
      */
-    @ApiOperation("新增志愿者信息")
-    //@PreAuthorize("@ss.hasPermi('volunteer:info:newVolunteerInfo')")
+    @ApiOperation( value = "新增志愿者信息",notes = "传入路径参数 大分类,传入对象参数志愿者信息")
     @PostMapping("/newVolunteerInfo/{serviceCategory}")
     public AjaxResult newVolunteerInfoByuserId(@RequestBody VolunteerInfo volunteerInfo, @PathVariable Long serviceCategory){
         Long userId = SecurityUtils.getUserId();
@@ -37,21 +43,47 @@ public class VolunteerInfoController {
     }
     /**
      * 修改志愿者信息
+     * 未测试
      */
-    @ApiOperation("修改志愿者信息")
-    //@PreAuthorize("@ss.hasPermi('volunteer:info:newVolunteerInfo')")
-    @PutMapping
+    @ApiOperation(value = "修改志愿者信息" , notes = "传入志愿者修改后的对象")
+    @PutMapping("/updateInfo")
     public AjaxResult updateVolunteerInfo(@RequestBody VolunteerInfoVO volunteerInfoVO){
         boolean b = volunteerInfoService.updateById(volunteerInfoVO);
         return AjaxResult.success();
     }
-    @ApiOperation("志愿者信息回显")
+    /**
+     * 修改志愿者信息
+     * 已测试
+     */
+    @ApiOperation(value = "志愿者信息回显" , notes = "传入大分类,返回大分类中志愿者已有信息")
     @GetMapping("/volunteerInfo")
     public R<VolunteerInfo> selectVolunteerInfo(Long serviceCategory){
         Long userId = SecurityUtils.getUserId();
         VolunteerInfo info = volunteerInfoService.selectByUserID(serviceCategory,userId);
         return R.ok(info);
     }
+    /**
+     * 修改志愿者信息
+     * 已测试
+     */
+    @ApiOperation(value = "查询志愿者信息列表",notes = "传入进行分类的字段,根据分类字段查询,返回List 集合")
+    @GetMapping("/list")
+    public R<List<VolunteerInfo>> list(VolunteerInfo volunteerInfo)
+    {
+        startPage();
+        List<VolunteerInfo> list = volunteerInfoService.selectVolunteerInfoList(volunteerInfo);
+        return R.ok(list);
+    }
+    /**
+     * 获取志愿者信息详细信息
+     * 已测试
+     */
+    @ApiOperation( value = "获取志愿者信息详细信息",notes = "传入志愿者id, 返回志愿者的信息")
+    @GetMapping(value = "/getDetails/{volunteerId}")
+    public R<VolunteerInfo> getInfo(@PathVariable("volunteerId") Long volunteerId)
+    {
+        return R.ok(volunteerInfoService.selectLVolunteerInfoByVolunteerId(volunteerId));
+    }
 
   /*  @ApiOperation("用户已注册志愿者查询")
     @GetMapping("/havenRegister")

+ 85 - 0
leromro-core/src/main/java/com/leromro/core/domain/Address.java

@@ -0,0 +1,85 @@
+package com.leromro.system.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.*;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.leromro.common.annotation.Excel;
+import com.leromro.common.core.domain.BaseEntity;
+
+/**
+ * 受服务地址对象 l_address
+ * 
+ * @author ruoyi
+ * @date 2025-04-08
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@TableName("l_address")
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "LAddress", description = "受服务地址")
+public class Address extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键 */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty("主键")
+    private Long addressId;
+
+    /** 用户id */
+    @Excel(name = "用户id")
+    @ApiModelProperty("用户id")
+    private Long userId;
+
+    /** 联系人号码 */
+    @Excel(name = "联系人号码")
+    @ApiModelProperty("联系人号码")
+    private String telephone;
+
+    /** 收货人姓名 */
+    @Excel(name = "收货人姓名")
+    @ApiModelProperty("收货人姓名")
+    private String name;
+
+    /** 年龄 */
+    @Excel(name = "年龄")
+    @ApiModelProperty("年龄")
+    private Long age;
+
+    /** 是否有传染病  0否  1是 */
+    @Excel(name = "是否有传染病  0否  1是")
+    @ApiModelProperty("是否有传染病  0否  1是")
+    private Long isContagion;
+
+    /** 传染病内容 */
+    @Excel(name = "传染病内容")
+    @ApiModelProperty("传染病内容")
+    private String haveContagion;
+
+    /** 地区 */
+    @Excel(name = "地区")
+    @ApiModelProperty("地区")
+    private String area;
+
+    /** 地址 */
+    @Excel(name = "地址")
+    @ApiModelProperty("地址")
+    private String address;
+
+    /** 是否为默认地址 0否 1是 */
+    @Excel(name = "是否为默认地址 0否 1是")
+    @ApiModelProperty("是否为默认地址 0否 1是")
+    private Long isDefault;
+
+    /** 是否删除 0否 1是 */
+    @Excel(name = "是否删除 0否 1是")
+    @ApiModelProperty("是否删除 0否 1是")
+    private Long isDelete;
+
+
+}

+ 57 - 0
leromro-core/src/main/java/com/leromro/core/mapper/AddressMapper.java

@@ -0,0 +1,57 @@
+package com.leromro.core.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.leromro.system.domain.Address;
+
+/**
+ * 受服务地址Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2025-04-08
+ */
+public interface AddressMapper extends BaseMapper<Address>
+{
+    /**
+     * 查询受服务地址
+     * 
+     * @param addressId 受服务地址主键
+     * @return 受服务地址
+     */
+    public Address selectLAddressByAddressId(Long addressId);
+
+
+    /**
+     * 新增受服务地址
+     * 
+     * @param address 受服务地址
+     * @return 结果
+     */
+    public int insertLAddress(Address address);
+
+    /**
+     * 修改受服务地址
+     * 
+     * @param address 受服务地址
+     * @return 结果
+     */
+    public int updateLAddress(Address address);
+
+    /**
+     * 删除受服务地址
+     * 
+     * @param addressId 受服务地址主键
+     * @return 结果
+     */
+    public int deleteLAddressByAddressId(Long addressId);
+
+    /**
+     * 批量删除受服务地址
+     * 
+     * @param addressIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteLAddressByAddressIds(Long[] addressIds);
+
+    List<Address> selectByUserId(Long userId);
+}

+ 6 - 0
leromro-core/src/main/java/com/leromro/core/mapper/VolunteerInfoMapper.java

@@ -3,6 +3,8 @@ package com.leromro.core.mapper;
 import com.leromro.core.domain.VolunteerInfo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
+import java.util.List;
+
 /**
  * <p>
  * 志愿者信息表 Mapper 接口
@@ -14,4 +16,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 public interface VolunteerInfoMapper extends BaseMapper<VolunteerInfo> {
 
     void newVolunteerByUserId(VolunteerInfo volunteerInfo);
+
+    List<VolunteerInfo> selectVolunteerInfoSimple(VolunteerInfo volunteerInfo);
+
+    VolunteerInfo selectLVolunteerInfoByVolunteerId(Long volunteerId);
 }

+ 62 - 0
leromro-core/src/main/java/com/leromro/core/service/AddressService.java

@@ -0,0 +1,62 @@
+package com.leromro.core.service;
+
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.leromro.system.domain.Address;
+
+/**
+ * 受服务地址Service接口
+ * 
+ * @author ruoyi
+ * @date 2025-04-08
+ */
+public interface AddressService extends IService<Address>
+{
+    /**
+     * 查询受服务地址
+     * 
+     * @param addressId 受服务地址主键
+     * @return 受服务地址
+     */
+    public Address selectLAddressByAddressId(Long addressId);
+
+    /**
+     * 查询受服务地址列表
+     * 
+     * @param userId 受服务地址
+     * @return 受服务地址集合
+     */
+    public List<Address> selectLAddressList(Long userId);
+
+    /**
+     * 新增受服务地址
+     * 
+     * @param address 受服务地址
+     * @return 结果
+     */
+    public Boolean insertLAddress(Address address);
+
+    /**
+     * 修改受服务地址
+     * 
+     * @param address 受服务地址
+     * @return 结果
+     */
+    public Boolean updateLAddress(Address address);
+
+    /**
+     * 批量删除受服务地址
+     * 
+     * @param addressIds 需要删除的受服务地址主键集合
+     * @return 结果
+     */
+    public int deleteLAddressByAddressIds(Long[] addressIds);
+
+    /**
+     * 删除受服务地址信息
+     * 
+     * @param addressId 受服务地址主键
+     * @return 结果
+     */
+    public int deleteLAddressByAddressId(Long addressId);
+}

+ 6 - 0
leromro-core/src/main/java/com/leromro/core/service/IVolunteerInfoService.java

@@ -3,6 +3,8 @@ package com.leromro.core.service;
 import com.leromro.core.domain.VolunteerInfo;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+
 /**
  * <p>
  * 志愿者信息表 服务类
@@ -16,4 +18,8 @@ public interface IVolunteerInfoService extends IService<VolunteerInfo> {
     void newVolunteerInfoByuserId(VolunteerInfo volunteerInfo, Long userId,Long serviceCategory);
 
     VolunteerInfo selectByUserID(Long serviceCategory, Long userId);
+
+    List<VolunteerInfo> selectVolunteerInfoList(VolunteerInfo volunteerInfo);
+
+    VolunteerInfo selectLVolunteerInfoByVolunteerId(Long volunteerId);
 }

+ 93 - 0
leromro-core/src/main/java/com/leromro/core/service/impl/AddressServiceImpl.java

@@ -0,0 +1,93 @@
+package com.leromro.core.service.impl;
+
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.leromro.core.mapper.AddressMapper;
+import com.leromro.core.service.AddressService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.leromro.system.domain.Address;
+
+/**
+ * 受服务地址Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2025-04-08
+ */
+@Service
+public class AddressServiceImpl extends ServiceImpl<AddressMapper, Address> implements AddressService
+{
+    @Autowired
+    private AddressMapper addressMapper;
+
+    /**
+     * 查询受服务地址
+     * 
+     * @param addressId 受服务地址主键
+     * @return 受服务地址
+     */
+    @Override
+    public Address selectLAddressByAddressId(Long addressId)
+    {
+        return addressMapper.selectLAddressByAddressId(addressId);
+    }
+
+    /**
+     * @param userId 受服务地址
+     * @return
+     */
+    @Override
+    public List<Address> selectLAddressList(Long userId) {
+
+        return addressMapper.selectByUserId(userId);
+    }
+
+
+    /**
+     * 新增受服务地址
+     * 
+     * @param address 受服务地址
+     * @return 结果
+     */
+    @Override
+    public Boolean insertLAddress(Address address)
+    {
+        return this.save(address);
+    }
+
+    /**
+     * 修改受服务地址
+     * 
+     * @param address 受服务地址
+     * @return 结果
+     */
+    @Override
+    public Boolean updateLAddress(Address address)
+    {
+        return this.updateById(address);
+    }
+
+    /**
+     * 批量删除受服务地址
+     * 
+     * @param addressIds 需要删除的受服务地址主键
+     * @return 结果
+     */
+    @Override
+    public int deleteLAddressByAddressIds(Long[] addressIds)
+    {
+        return addressMapper.deleteLAddressByAddressIds(addressIds);
+    }
+
+    /**
+     * 删除受服务地址信息
+     * 
+     * @param addressId 受服务地址主键
+     * @return 结果
+     */
+    @Override
+    public int deleteLAddressByAddressId(Long addressId)
+    {
+        return addressMapper.deleteLAddressByAddressId(addressId);
+    }
+}

+ 22 - 3
leromro-core/src/main/java/com/leromro/core/service/impl/VolunteerInfoServiceImpl.java

@@ -33,11 +33,9 @@ public class VolunteerInfoServiceImpl extends ServiceImpl<VolunteerInfoMapper, V
     @Override
     public void newVolunteerInfoByuserId(VolunteerInfo volunteerInfo, Long userId, Long serviceCategory) {
         volunteerInfo.setUserId(userId);
+        volunteerInfo.setServiceCategory(serviceCategory);
         QueryWrapper<VolunteerInfo> wrapper = new QueryWrapper<>();
         wrapper.eq("user_id",userId).eq("service_category",serviceCategory);
-        /*LambdaQueryWrapper<VolunteerInfo> wrapper = new LambdaQueryWrapper<>()
-        wrapper.eq(VolunteerInfo::getVolunteerId, userId)
-               .eq(VolunteerInfo::getServiceCategory, serviceCategory);*/
 
         Integer i = volunteerInfoMapper.selectCount(wrapper);
         if(i>0){
@@ -60,4 +58,25 @@ public class VolunteerInfoServiceImpl extends ServiceImpl<VolunteerInfoMapper, V
         VolunteerInfo infos = volunteerInfoMapper.selectOne(wrapper);
         return infos;
     }
+
+    /**
+     * @param volunteerInfo
+     * @return
+     */
+    @Override
+    public List<VolunteerInfo> selectVolunteerInfoList(VolunteerInfo volunteerInfo) {
+
+        List<VolunteerInfo> infos = volunteerInfoMapper.selectVolunteerInfoSimple(volunteerInfo);
+        return infos;
+    }
+
+    /**
+     * @param volunteerId
+     * @return
+     */
+    @Override
+    public VolunteerInfo selectLVolunteerInfoByVolunteerId(Long volunteerId) {
+        VolunteerInfo info = volunteerInfoMapper.selectLVolunteerInfoByVolunteerId(volunteerId);
+        return info;
+    }
 }

+ 119 - 0
leromro-core/src/main/resources/mapper/core/AddressMapper.xml

@@ -0,0 +1,119 @@
+<?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.leromro.core.mapper.AddressMapper">
+    
+    <resultMap type="Address" id="AddressResult">
+        <result property="addressId"    column="address_id"    />
+        <result property="userId"    column="user_id"    />
+        <result property="telephone"    column="telephone"    />
+        <result property="name"    column="name"    />
+        <result property="age"    column="age"    />
+        <result property="isContagion"    column="is_contagion"    />
+        <result property="haveContagion"    column="have_contagion"    />
+        <result property="area"    column="area"    />
+        <result property="address"    column="address"    />
+        <result property="isDefault"    column="is_default"    />
+        <result property="isDelete"    column="is_delete"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectLAddressVo">
+        select address_id, user_id, telephone, name, age, is_contagion, have_contagion, area, address, is_default, is_delete, create_time, update_time, remark from l_address
+    </sql>
+
+    <select id="selectLAddressList" parameterType="Address" resultMap="AddressResult">
+        <include refid="selectLAddressVo"/>
+        <where>  
+            <if test="userId != null "> and user_id = #{userId}</if>
+            <if test="telephone != null  and telephone != ''"> and telephone = #{telephone}</if>
+            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
+            <if test="age != null "> and age = #{age}</if>
+            <if test="isContagion != null "> and is_contagion = #{isContagion}</if>
+            <if test="haveContagion != null  and haveContagion != ''"> and have_contagion = #{haveContagion}</if>
+            <if test="area != null  and area != ''"> and area = #{area}</if>
+            <if test="address != null  and address != ''"> and address = #{address}</if>
+            <if test="isDefault != null "> and is_default = #{isDefault}</if>
+            <if test="isDelete != null "> and is_delete = #{isDelete}</if>
+        </where>
+    </select>
+    
+    <select id="selectLAddressByAddressId" parameterType="Long" resultMap="AddressResult">
+        <include refid="selectLAddressVo"/>
+        where address_id = #{addressId}
+    </select>
+    <select id="selectByUserId" resultType="com.leromro.system.domain.Address" parameterType="java.lang.Long">
+        <include refid="selectLAddressVo"/>
+        <where>
+            user_id = #{userId}
+        </where>
+    </select>
+
+    <insert id="insertLAddress" parameterType="Address" useGeneratedKeys="true" keyProperty="addressId">
+        insert into l_address
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="userId != null">user_id,</if>
+            <if test="telephone != null">telephone,</if>
+            <if test="name != null">name,</if>
+            <if test="age != null">age,</if>
+            <if test="isContagion != null">is_contagion,</if>
+            <if test="haveContagion != null">have_contagion,</if>
+            <if test="area != null">area,</if>
+            <if test="address != null">address,</if>
+            <if test="isDefault != null">is_default,</if>
+            <if test="isDelete != null">is_delete,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="userId != null">#{userId},</if>
+            <if test="telephone != null">#{telephone},</if>
+            <if test="name != null">#{name},</if>
+            <if test="age != null">#{age},</if>
+            <if test="isContagion != null">#{isContagion},</if>
+            <if test="haveContagion != null">#{haveContagion},</if>
+            <if test="area != null">#{area},</if>
+            <if test="address != null">#{address},</if>
+            <if test="isDefault != null">#{isDefault},</if>
+            <if test="isDelete != null">#{isDelete},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateLAddress" parameterType="Address">
+        update l_address
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="telephone != null">telephone = #{telephone},</if>
+            <if test="name != null">name = #{name},</if>
+            <if test="age != null">age = #{age},</if>
+            <if test="isContagion != null">is_contagion = #{isContagion},</if>
+            <if test="haveContagion != null">have_contagion = #{haveContagion},</if>
+            <if test="area != null">area = #{area},</if>
+            <if test="address != null">address = #{address},</if>
+            <if test="isDefault != null">is_default = #{isDefault},</if>
+            <if test="isDelete != null">is_delete = #{isDelete},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where address_id = #{addressId}
+    </update>
+
+    <delete id="deleteLAddressByAddressId" parameterType="Long">
+        delete from l_address where address_id = #{addressId}
+    </delete>
+
+    <delete id="deleteLAddressByAddressIds" parameterType="String">
+        delete from l_address where address_id in 
+        <foreach item="addressId" collection="array" open="(" separator="," close=")">
+            #{addressId}
+        </foreach>
+    </delete>
+</mapper>

+ 103 - 46
leromro-core/src/main/resources/mapper/core/VolunteerInfoMapper.xml

@@ -3,54 +3,111 @@
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.leromro.core.mapper.VolunteerInfoMapper">
+
+    <resultMap type="VolunteerInfo" id="VolunteerInfoResult">
+        <result property="volunteerId"    column="volunteer_id"    />
+        <result property="userId"    column="user_id"    />
+        <result property="name"    column="name"    />
+        <result property="idCard"    column="id_card"    />
+        <result property="score"    column="score"    />
+        <result property="serviceCategory"    column="service_category"    />
+        <result property="serviceType"    column="service_type"    />
+        <result property="serviceSubject"    column="service_subject"    />
+        <result property="skillDescribe"    column="skill_describe"    />
+        <result property="phonenumber"    column="phonenumber"    />
+        <result property="sex"    column="sex"    />
+        <result property="status"    column="status"    />
+        <result property="idCardPicture"    column="id_card_picture"    />
+        <result property="certificationPicture"    column="certification_picture"    />
+        <result property="volunteerPicture"    column="volunteer_picture"    />
+        <result property="workedCompany"    column="worked_company"    />
+        <result property="level"    column="level"    />
+        <result property="isOnJob"    column="is_on_job"    />
+        <result property="city"    column="city"    />
+        <result property="address"    column="address"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectLVolunteerInfoVo">
+        select volunteer_id, user_id, name, id_card, score, service_category, service_type, service_subject, skill_describe, phonenumber, sex, status, id_card_picture, certification_picture, volunteer_picture, worked_company, level, is_on_job, city, address, create_time, update_time, remark from l_volunteer_info
+    </sql>
+
+
     <insert id="newVolunteerByUserId">
-        INSERT INTO l_volunteer_info (
-        <if test="userId != null">user_id,</if>
-        <if test="name != null">name,</if>
-        <if test="idCard != null">id_card,</if>
-        <if test="idCardPicture != null">id_card_picture,</if>
-        <if test="serviceCategory != null">service_category,</if>
-        <if test="serviceType != null">service_type,</if>
-        <if test="serviceSubject != null">service_subject,</if>
-        <if test="skillDescribe != null">skill_describe,</if>
-        <if test="phonenumber != null">phonenumber,</if>
-        <if test="sex != null">sex,</if>
-        <if test="status != null">status,</if>
-        <if test="certificationPicture != null">certification_picture,</if>
-        <if test="volunteerPicture!= null">volunteer_picture,</if>
-        <if test="workedCompany != null">worked_company,</if>
-        <if test="level != null">level,</if>
-        <if test="isOnJob != null">is_on_job,</if>
-        <if test="city != null">city,</if>
-        <if test="address != null">address,</if>
-        <if test="createTime != null">create_time,</if>
-        <if test="updateTime != null">update_time,</if>
-        <if test="remark != null">remark</if>
-        )
-        VALUES (
-        <if test="userId != null">#{userId},</if>
-        <if test="name != null">#{name},</if>
-        <if test="idCard != null">#{idCard},</if>
-        <if test="idCardPicture != null">#{idCardPicture},</if>
-        <if test="serviceCategory != null">#{serviceCategory},</if>
-        <if test="serviceType != null">#{serviceType},</if>
-        <if test="serviceSubject != null">#{serviceSubject},</if>
-        <if test="skillDescribe != null">#{skillDescribe},</if>
-        <if test="phonenumber != null">#{phonenumber},</if>
-        <if test="sex != null">#{sex},</if>
-        <if test="status != null">#{status},</if>
-        <if test="certificationPicture != null">#{certificationPicture},</if>
-        <if test="volunteerPicture!= null">#{volunteerPicture},</if>
-        <if test="workedCompany != null">#{workedCompany},</if>
-        <if test="level != null">#{level},</if>
-        <if test="isOnJob != null">#{isOnJob},</if>
-        <if test="city != null">#{city},</if>
-        <if test="address != null">#{address},</if>
-        <if test="createTime != null">#{createTime},</if>
-        <if test="updateTime != null">#{updateTime},</if>
-        <if test="remark != null">#{remark}</if>
-        )
+        INSERT INTO l_volunteer_info
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="userId != null">user_id,</if>
+            <if test="name != null">name,</if>
+            <if test="idCard != null">id_card,</if>
+            <if test="idCardPicture != null">id_card_picture,</if>
+            <if test="serviceCategory != null">service_category,</if>
+            <if test="serviceType != null">service_type,</if>
+            <if test="serviceSubject != null">service_subject,</if>
+            <if test="skillDescribe != null">skill_describe,</if>
+            <if test="phonenumber != null">phonenumber,</if>
+            <if test="sex != null">sex,</if>
+            <if test="status != null">status,</if>
+            <if test="certificationPicture != null">certification_picture,</if>
+            <if test="volunteerPicture != null">volunteer_picture,</if>
+            <if test="workedCompany != null">worked_company,</if>
+            <if test="level != null">level,</if>
+            <if test="isOnJob != null">is_on_job,</if>
+            <if test="city != null">city,</if>
+            <if test="address != null">address,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+        </trim>
+        VALUES
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="userId != null">#{userId},</if>
+            <if test="name != null">#{name},</if>
+            <if test="idCard != null">#{idCard},</if>
+            <if test="idCardPicture != null">#{idCardPicture},</if>
+            <if test="serviceCategory != null">#{serviceCategory},</if>
+            <if test="serviceType != null">#{serviceType},</if>
+            <if test="serviceSubject != null">#{serviceSubject},</if>
+            <if test="skillDescribe != null">#{skillDescribe},</if>
+            <if test="phonenumber != null">#{phonenumber},</if>
+            <if test="sex != null">#{sex},</if>
+            <if test="status != null">#{status},</if>
+            <if test="certificationPicture != null">#{certificationPicture},</if>
+            <if test="volunteerPicture != null">#{volunteerPicture},</if>
+            <if test="workedCompany != null">#{workedCompany},</if>
+            <if test="level != null">#{level},</if>
+            <if test="isOnJob != null">#{isOnJob},</if>
+            <if test="city != null">#{city},</if>
+            <if test="address != null">#{address},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+        </trim>
     </insert>
 
+    <select id="selectVolunteerInfoSimple" resultType="com.leromro.core.domain.VolunteerInfo"
+            parameterType="com.leromro.core.domain.VolunteerInfo">
+        select skill_describe ,service_category,name,volunteer_picture,score from l_volunteer_info lvi left join sys_user su on lvi.user_id = su.user_id
+        <where>
+            <if test="name != null  and name != ''"> and lvi.name like concat('%', #{name}, '%')</if>
+            <if test="score != null "> and lvi.score = #{score}</if>
+            <if test="serviceCategory != null "> and lvi.service_category = #{serviceCategory}</if>
+            <if test="serviceType != null "> and lvi.service_type = #{serviceType}</if>
+            <if test="serviceSubject != null "> and lvi.service_subject = #{serviceSubject}</if>
+            <if test="skillDescribe != null  and skillDescribe != ''"> and lvi.skill_describe = #{skillDescribe}</if>
+            <if test="level != null  and level != ''"> and lvi.level = #{level}</if>
+            <if test="city != null  and city != ''"> and lvi.city = #{city}</if>
+            <if test="address != null  and address != ''"> and lvi.address = #{address}</if>
+        </where>
+    </select>
+
+
+    <select id="selectLVolunteerInfoByVolunteerId" resultType="com.leromro.core.domain.VolunteerInfo"
+            parameterType="java.lang.Long">
+        select name , service_category ,service_subject, phonenumber,address ,skill_describe ,certification_picture  ,score from l_volunteer_info
+        where volunteer_id = #{volunteerId}
+    </select>
+
 
 </mapper>

leromro-system/src/main/resources/mapper/system/SysLogininforMapper.xml → leromro-system/src/main/resources/mapper/system/AddressService.xml