12.20晚上
This commit is contained in:
parent
d7aa4115ef
commit
006561127b
|
@ -22,7 +22,7 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
|
|||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 买家地址Controller
|
||||
* 用户地址Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-12-20
|
||||
|
@ -35,7 +35,7 @@ public class AddressController extends BaseController
|
|||
private IAddressService addressService;
|
||||
|
||||
/**
|
||||
* 查询买家地址列表
|
||||
* 查询用户地址列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:address:list')")
|
||||
@GetMapping("/list")
|
||||
|
@ -47,20 +47,20 @@ public class AddressController extends BaseController
|
|||
}
|
||||
|
||||
/**
|
||||
* 导出买家地址列表
|
||||
* 导出用户地址列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:address:export')")
|
||||
@Log(title = "买家地址", businessType = BusinessType.EXPORT)
|
||||
@Log(title = "用户地址", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, Address address)
|
||||
{
|
||||
List<Address> list = addressService.selectAddressList(address);
|
||||
ExcelUtil<Address> util = new ExcelUtil<Address>(Address.class);
|
||||
util.exportExcel(response, list, "买家地址数据");
|
||||
util.exportExcel(response, list, "用户地址数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取买家地址详细信息
|
||||
* 获取用户地址详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:address:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
|
@ -70,10 +70,10 @@ public class AddressController extends BaseController
|
|||
}
|
||||
|
||||
/**
|
||||
* 新增买家地址
|
||||
* 新增用户地址
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:address:add')")
|
||||
@Log(title = "买家地址", businessType = BusinessType.INSERT)
|
||||
@Log(title = "用户地址", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Address address)
|
||||
{
|
||||
|
@ -81,10 +81,10 @@ public class AddressController extends BaseController
|
|||
}
|
||||
|
||||
/**
|
||||
* 修改买家地址
|
||||
* 修改用户地址
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:address:edit')")
|
||||
@Log(title = "买家地址", businessType = BusinessType.UPDATE)
|
||||
@Log(title = "用户地址", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody Address address)
|
||||
{
|
||||
|
@ -92,10 +92,10 @@ public class AddressController extends BaseController
|
|||
}
|
||||
|
||||
/**
|
||||
* 删除买家地址
|
||||
* 删除用户地址
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:address:remove')")
|
||||
@Log(title = "买家地址", businessType = BusinessType.DELETE)
|
||||
@Log(title = "用户地址", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
|
|
|
@ -101,4 +101,12 @@ public class OrderController extends BaseController
|
|||
{
|
||||
return toAjax(orderService.deleteOrderByIds(ids));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:order:edit')")
|
||||
@Log(title = "订单", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/updateStatus")
|
||||
public AjaxResult updateStatus(@RequestBody Order order)
|
||||
{
|
||||
return toAjax(orderService.updateOrder(order));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
|
|||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 买家信息Controller
|
||||
* 用户信息Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-12-20
|
||||
|
@ -35,7 +35,7 @@ public class PersonController extends BaseController
|
|||
private IPersonService personService;
|
||||
|
||||
/**
|
||||
* 查询买家信息列表
|
||||
* 查询用户信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:person:list')")
|
||||
@GetMapping("/list")
|
||||
|
@ -47,20 +47,20 @@ public class PersonController extends BaseController
|
|||
}
|
||||
|
||||
/**
|
||||
* 导出买家信息列表
|
||||
* 导出用户信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:person:export')")
|
||||
@Log(title = "买家信息", businessType = BusinessType.EXPORT)
|
||||
@Log(title = "用户信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, Person person)
|
||||
{
|
||||
List<Person> list = personService.selectPersonList(person);
|
||||
ExcelUtil<Person> util = new ExcelUtil<Person>(Person.class);
|
||||
util.exportExcel(response, list, "买家信息数据");
|
||||
util.exportExcel(response, list, "用户信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取买家信息详细信息
|
||||
* 获取用户信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:person:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
|
@ -70,10 +70,10 @@ public class PersonController extends BaseController
|
|||
}
|
||||
|
||||
/**
|
||||
* 新增买家信息
|
||||
* 新增用户信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:person:add')")
|
||||
@Log(title = "买家信息", businessType = BusinessType.INSERT)
|
||||
@Log(title = "用户信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Person person)
|
||||
{
|
||||
|
@ -81,10 +81,10 @@ public class PersonController extends BaseController
|
|||
}
|
||||
|
||||
/**
|
||||
* 修改买家信息
|
||||
* 修改用户信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:person:edit')")
|
||||
@Log(title = "买家信息", businessType = BusinessType.UPDATE)
|
||||
@Log(title = "用户信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody Person person)
|
||||
{
|
||||
|
@ -92,10 +92,10 @@ public class PersonController extends BaseController
|
|||
}
|
||||
|
||||
/**
|
||||
* 删除买家信息
|
||||
* 删除用户信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:person:remove')")
|
||||
@Log(title = "买家信息", businessType = BusinessType.DELETE)
|
||||
@Log(title = "用户信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
|
|
|
@ -16,7 +16,8 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
|||
public class Order extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Person person;
|
||||
private Shangpin shangpin;
|
||||
/** id */
|
||||
private Long id;
|
||||
|
||||
|
@ -24,6 +25,7 @@ public class Order extends BaseEntity
|
|||
@Excel(name = "商品id")
|
||||
private Long shangpinid;
|
||||
|
||||
|
||||
/** 买家id */
|
||||
@Excel(name = "买家id")
|
||||
private Long personid;
|
||||
|
@ -33,6 +35,23 @@ public class Order extends BaseEntity
|
|||
@Excel(name = "购买日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date purchasedate;
|
||||
|
||||
public Person getPerson() {
|
||||
return person;
|
||||
}
|
||||
|
||||
public Shangpin getShangpin() {
|
||||
return shangpin;
|
||||
}
|
||||
|
||||
public void setPerson(Person person) {
|
||||
this.person = person;
|
||||
}
|
||||
|
||||
public void setShangpin(Shangpin shangpin) {
|
||||
this.shangpin = shangpin;
|
||||
}
|
||||
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.ruoyi.common.annotation.Excel;
|
|||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 买家信息对象 person
|
||||
* 用户信息对象 person
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-12-20
|
||||
|
@ -19,8 +19,8 @@ public class Person extends BaseEntity
|
|||
/** id */
|
||||
private Long id;
|
||||
|
||||
/** 头像 */
|
||||
@Excel(name = "头像")
|
||||
/** 图片 */
|
||||
@Excel(name = "图片")
|
||||
private String image;
|
||||
|
||||
/** 昵称 */
|
||||
|
@ -47,7 +47,7 @@ public class Person extends BaseEntity
|
|||
@Excel(name = "专业")
|
||||
private String zhuanye;
|
||||
|
||||
/** 买家地址信息 */
|
||||
/** 用户地址信息 */
|
||||
private List<Address> addressList;
|
||||
|
||||
public void setId(Long id)
|
||||
|
|
|
@ -4,7 +4,7 @@ import java.util.List;
|
|||
import com.ruoyi.system.domain.Address;
|
||||
|
||||
/**
|
||||
* 买家地址Mapper接口
|
||||
* 用户地址Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-12-20
|
||||
|
@ -12,47 +12,47 @@ import com.ruoyi.system.domain.Address;
|
|||
public interface AddressMapper
|
||||
{
|
||||
/**
|
||||
* 查询买家地址
|
||||
* 查询用户地址
|
||||
*
|
||||
* @param id 买家地址主键
|
||||
* @return 买家地址
|
||||
* @param id 用户地址主键
|
||||
* @return 用户地址
|
||||
*/
|
||||
public Address selectAddressById(Long id);
|
||||
|
||||
/**
|
||||
* 查询买家地址列表
|
||||
* 查询用户地址列表
|
||||
*
|
||||
* @param address 买家地址
|
||||
* @return 买家地址集合
|
||||
* @param address 用户地址
|
||||
* @return 用户地址集合
|
||||
*/
|
||||
public List<Address> selectAddressList(Address address);
|
||||
|
||||
/**
|
||||
* 新增买家地址
|
||||
* 新增用户地址
|
||||
*
|
||||
* @param address 买家地址
|
||||
* @param address 用户地址
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAddress(Address address);
|
||||
|
||||
/**
|
||||
* 修改买家地址
|
||||
* 修改用户地址
|
||||
*
|
||||
* @param address 买家地址
|
||||
* @param address 用户地址
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAddress(Address address);
|
||||
|
||||
/**
|
||||
* 删除买家地址
|
||||
* 删除用户地址
|
||||
*
|
||||
* @param id 买家地址主键
|
||||
* @param id 用户地址主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAddressById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除买家地址
|
||||
* 批量删除用户地址
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
|
|
|
@ -58,4 +58,5 @@ public interface OrderMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteOrderByIds(Long[] ids);
|
||||
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ import com.ruoyi.system.domain.Person;
|
|||
import com.ruoyi.system.domain.Address;
|
||||
|
||||
/**
|
||||
* 买家信息Mapper接口
|
||||
* 用户信息Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-12-20
|
||||
|
@ -13,47 +13,47 @@ import com.ruoyi.system.domain.Address;
|
|||
public interface PersonMapper
|
||||
{
|
||||
/**
|
||||
* 查询买家信息
|
||||
* 查询用户信息
|
||||
*
|
||||
* @param id 买家信息主键
|
||||
* @return 买家信息
|
||||
* @param id 用户信息主键
|
||||
* @return 用户信息
|
||||
*/
|
||||
public Person selectPersonById(Long id);
|
||||
|
||||
/**
|
||||
* 查询买家信息列表
|
||||
* 查询用户信息列表
|
||||
*
|
||||
* @param person 买家信息
|
||||
* @return 买家信息集合
|
||||
* @param person 用户信息
|
||||
* @return 用户信息集合
|
||||
*/
|
||||
public List<Person> selectPersonList(Person person);
|
||||
|
||||
/**
|
||||
* 新增买家信息
|
||||
* 新增用户信息
|
||||
*
|
||||
* @param person 买家信息
|
||||
* @param person 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertPerson(Person person);
|
||||
|
||||
/**
|
||||
* 修改买家信息
|
||||
* 修改用户信息
|
||||
*
|
||||
* @param person 买家信息
|
||||
* @param person 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updatePerson(Person person);
|
||||
|
||||
/**
|
||||
* 删除买家信息
|
||||
* 删除用户信息
|
||||
*
|
||||
* @param id 买家信息主键
|
||||
* @param id 用户信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePersonById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除买家信息
|
||||
* 批量删除用户信息
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
|
@ -61,7 +61,7 @@ public interface PersonMapper
|
|||
public int deletePersonByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 批量删除买家地址
|
||||
* 批量删除用户地址
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
|
@ -69,18 +69,18 @@ public interface PersonMapper
|
|||
public int deleteAddressByPersonids(Long[] ids);
|
||||
|
||||
/**
|
||||
* 批量新增买家地址
|
||||
* 批量新增用户地址
|
||||
*
|
||||
* @param addressList 买家地址列表
|
||||
* @param addressList 用户地址列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchAddress(List<Address> addressList);
|
||||
|
||||
|
||||
/**
|
||||
* 通过买家信息主键删除买家地址信息
|
||||
* 通过用户信息主键删除用户地址信息
|
||||
*
|
||||
* @param id 买家信息ID
|
||||
* @param id 用户信息ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAddressByPersonid(Long id);
|
||||
|
|
|
@ -4,7 +4,7 @@ import java.util.List;
|
|||
import com.ruoyi.system.domain.Address;
|
||||
|
||||
/**
|
||||
* 买家地址Service接口
|
||||
* 用户地址Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-12-20
|
||||
|
@ -12,49 +12,49 @@ import com.ruoyi.system.domain.Address;
|
|||
public interface IAddressService
|
||||
{
|
||||
/**
|
||||
* 查询买家地址
|
||||
* 查询用户地址
|
||||
*
|
||||
* @param id 买家地址主键
|
||||
* @return 买家地址
|
||||
* @param id 用户地址主键
|
||||
* @return 用户地址
|
||||
*/
|
||||
public Address selectAddressById(Long id);
|
||||
|
||||
/**
|
||||
* 查询买家地址列表
|
||||
* 查询用户地址列表
|
||||
*
|
||||
* @param address 买家地址
|
||||
* @return 买家地址集合
|
||||
* @param address 用户地址
|
||||
* @return 用户地址集合
|
||||
*/
|
||||
public List<Address> selectAddressList(Address address);
|
||||
|
||||
/**
|
||||
* 新增买家地址
|
||||
* 新增用户地址
|
||||
*
|
||||
* @param address 买家地址
|
||||
* @param address 用户地址
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAddress(Address address);
|
||||
|
||||
/**
|
||||
* 修改买家地址
|
||||
* 修改用户地址
|
||||
*
|
||||
* @param address 买家地址
|
||||
* @param address 用户地址
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAddress(Address address);
|
||||
|
||||
/**
|
||||
* 批量删除买家地址
|
||||
* 批量删除用户地址
|
||||
*
|
||||
* @param ids 需要删除的买家地址主键集合
|
||||
* @param ids 需要删除的用户地址主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAddressByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除买家地址信息
|
||||
* 删除用户地址信息
|
||||
*
|
||||
* @param id 买家地址主键
|
||||
* @param id 用户地址主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAddressById(Long id);
|
||||
|
|
|
@ -4,7 +4,7 @@ import java.util.List;
|
|||
import com.ruoyi.system.domain.Person;
|
||||
|
||||
/**
|
||||
* 买家信息Service接口
|
||||
* 用户信息Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-12-20
|
||||
|
@ -12,49 +12,49 @@ import com.ruoyi.system.domain.Person;
|
|||
public interface IPersonService
|
||||
{
|
||||
/**
|
||||
* 查询买家信息
|
||||
* 查询用户信息
|
||||
*
|
||||
* @param id 买家信息主键
|
||||
* @return 买家信息
|
||||
* @param id 用户信息主键
|
||||
* @return 用户信息
|
||||
*/
|
||||
public Person selectPersonById(Long id);
|
||||
|
||||
/**
|
||||
* 查询买家信息列表
|
||||
* 查询用户信息列表
|
||||
*
|
||||
* @param person 买家信息
|
||||
* @return 买家信息集合
|
||||
* @param person 用户信息
|
||||
* @return 用户信息集合
|
||||
*/
|
||||
public List<Person> selectPersonList(Person person);
|
||||
|
||||
/**
|
||||
* 新增买家信息
|
||||
* 新增用户信息
|
||||
*
|
||||
* @param person 买家信息
|
||||
* @param person 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertPerson(Person person);
|
||||
|
||||
/**
|
||||
* 修改买家信息
|
||||
* 修改用户信息
|
||||
*
|
||||
* @param person 买家信息
|
||||
* @param person 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updatePerson(Person person);
|
||||
|
||||
/**
|
||||
* 批量删除买家信息
|
||||
* 批量删除用户信息
|
||||
*
|
||||
* @param ids 需要删除的买家信息主键集合
|
||||
* @param ids 需要删除的用户信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePersonByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除买家信息信息
|
||||
* 删除用户信息信息
|
||||
*
|
||||
* @param id 买家信息主键
|
||||
* @param id 用户信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePersonById(Long id);
|
||||
|
|
|
@ -8,7 +8,7 @@ import com.ruoyi.system.domain.Address;
|
|||
import com.ruoyi.system.service.IAddressService;
|
||||
|
||||
/**
|
||||
* 买家地址Service业务层处理
|
||||
* 用户地址Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-12-20
|
||||
|
@ -20,10 +20,10 @@ public class AddressServiceImpl implements IAddressService
|
|||
private AddressMapper addressMapper;
|
||||
|
||||
/**
|
||||
* 查询买家地址
|
||||
* 查询用户地址
|
||||
*
|
||||
* @param id 买家地址主键
|
||||
* @return 买家地址
|
||||
* @param id 用户地址主键
|
||||
* @return 用户地址
|
||||
*/
|
||||
@Override
|
||||
public Address selectAddressById(Long id)
|
||||
|
@ -32,10 +32,10 @@ public class AddressServiceImpl implements IAddressService
|
|||
}
|
||||
|
||||
/**
|
||||
* 查询买家地址列表
|
||||
* 查询用户地址列表
|
||||
*
|
||||
* @param address 买家地址
|
||||
* @return 买家地址
|
||||
* @param address 用户地址
|
||||
* @return 用户地址
|
||||
*/
|
||||
@Override
|
||||
public List<Address> selectAddressList(Address address)
|
||||
|
@ -44,9 +44,9 @@ public class AddressServiceImpl implements IAddressService
|
|||
}
|
||||
|
||||
/**
|
||||
* 新增买家地址
|
||||
* 新增用户地址
|
||||
*
|
||||
* @param address 买家地址
|
||||
* @param address 用户地址
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
|
@ -56,9 +56,9 @@ public class AddressServiceImpl implements IAddressService
|
|||
}
|
||||
|
||||
/**
|
||||
* 修改买家地址
|
||||
* 修改用户地址
|
||||
*
|
||||
* @param address 买家地址
|
||||
* @param address 用户地址
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
|
@ -68,9 +68,9 @@ public class AddressServiceImpl implements IAddressService
|
|||
}
|
||||
|
||||
/**
|
||||
* 批量删除买家地址
|
||||
* 批量删除用户地址
|
||||
*
|
||||
* @param ids 需要删除的买家地址主键
|
||||
* @param ids 需要删除的用户地址主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
|
@ -80,9 +80,9 @@ public class AddressServiceImpl implements IAddressService
|
|||
}
|
||||
|
||||
/**
|
||||
* 删除买家地址信息
|
||||
* 删除用户地址信息
|
||||
*
|
||||
* @param id 买家地址主键
|
||||
* @param id 用户地址主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -12,7 +12,7 @@ import com.ruoyi.system.domain.Person;
|
|||
import com.ruoyi.system.service.IPersonService;
|
||||
|
||||
/**
|
||||
* 买家信息Service业务层处理
|
||||
* 用户信息Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-12-20
|
||||
|
@ -24,10 +24,10 @@ public class PersonServiceImpl implements IPersonService
|
|||
private PersonMapper personMapper;
|
||||
|
||||
/**
|
||||
* 查询买家信息
|
||||
* 查询用户信息
|
||||
*
|
||||
* @param id 买家信息主键
|
||||
* @return 买家信息
|
||||
* @param id 用户信息主键
|
||||
* @return 用户信息
|
||||
*/
|
||||
@Override
|
||||
public Person selectPersonById(Long id)
|
||||
|
@ -36,10 +36,10 @@ public class PersonServiceImpl implements IPersonService
|
|||
}
|
||||
|
||||
/**
|
||||
* 查询买家信息列表
|
||||
* 查询用户信息列表
|
||||
*
|
||||
* @param person 买家信息
|
||||
* @return 买家信息
|
||||
* @param person 用户信息
|
||||
* @return 用户信息
|
||||
*/
|
||||
@Override
|
||||
public List<Person> selectPersonList(Person person)
|
||||
|
@ -48,9 +48,9 @@ public class PersonServiceImpl implements IPersonService
|
|||
}
|
||||
|
||||
/**
|
||||
* 新增买家信息
|
||||
* 新增用户信息
|
||||
*
|
||||
* @param person 买家信息
|
||||
* @param person 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
|
@ -63,9 +63,9 @@ public class PersonServiceImpl implements IPersonService
|
|||
}
|
||||
|
||||
/**
|
||||
* 修改买家信息
|
||||
* 修改用户信息
|
||||
*
|
||||
* @param person 买家信息
|
||||
* @param person 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
|
@ -78,9 +78,9 @@ public class PersonServiceImpl implements IPersonService
|
|||
}
|
||||
|
||||
/**
|
||||
* 批量删除买家信息
|
||||
* 批量删除用户信息
|
||||
*
|
||||
* @param ids 需要删除的买家信息主键
|
||||
* @param ids 需要删除的用户信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
|
@ -92,9 +92,9 @@ public class PersonServiceImpl implements IPersonService
|
|||
}
|
||||
|
||||
/**
|
||||
* 删除买家信息信息
|
||||
* 删除用户信息信息
|
||||
*
|
||||
* @param id 买家信息主键
|
||||
* @param id 用户信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
|
@ -106,9 +106,9 @@ public class PersonServiceImpl implements IPersonService
|
|||
}
|
||||
|
||||
/**
|
||||
* 新增买家地址信息
|
||||
* 新增用户地址信息
|
||||
*
|
||||
* @param person 买家信息对象
|
||||
* @param person 用户信息对象
|
||||
*/
|
||||
public void insertAddress(Person person)
|
||||
{
|
||||
|
|
|
@ -9,21 +9,48 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="shangpinid" column="shangpinid" />
|
||||
<result property="personid" column="personid" />
|
||||
<result property="purchasedate" column="purchasedate" />
|
||||
<association property="person" javaType="Person" column="personid">
|
||||
<result property="image" column="image" />
|
||||
<result property="name" column="name" />
|
||||
</association>
|
||||
<association property="shangpin" javaType="Shangpin" column="shangpinid">
|
||||
<result property="productimage" column="productimage" />
|
||||
<result property="price" column="price" />
|
||||
<result property="producttype" column="producttype" />
|
||||
</association>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectOrderVo">
|
||||
select id, shangpinid, personid, purchasedate from `order`
|
||||
|
||||
SELECT
|
||||
o.id,
|
||||
p.image,
|
||||
p.name username,
|
||||
s.productimage,
|
||||
s.name,
|
||||
s.price,
|
||||
o.purchasedate,
|
||||
o.orderzhuangtai
|
||||
FROM
|
||||
`person` p
|
||||
-- 使用 INNER JOIN 关联 order 表
|
||||
INNER JOIN
|
||||
`order` o ON p.id = o.personid
|
||||
-- 再使用 INNER JOIN 关联 shangpin 表
|
||||
INNER JOIN
|
||||
`shangpin` s ON o.shangpinid = s.id;
|
||||
|
||||
</sql>
|
||||
|
||||
<select id="selectOrderList" parameterType="Order" resultMap="OrderResult">
|
||||
<include refid="selectOrderVo"/>
|
||||
<where>
|
||||
<if test="shangpinid != null "> and shangpinid = #{shangpinid}</if>
|
||||
<if test="personid != null "> and personid = #{personid}</if>
|
||||
<if test="purchasedate != null "> and purchasedate = #{purchasedate}</if>
|
||||
<where>
|
||||
<if test="shangpinid!= null "> and shangpinid = #{shangpinid}</if>
|
||||
<if test="personid!= null "> and personid = #{personid}</if>
|
||||
<if test="purchasedate!= null "> and purchasedate = #{purchasedate}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectOrderById" parameterType="Long" resultMap="OrderResult">
|
||||
<include refid="selectOrderVo"/>
|
||||
where id = #{id}
|
||||
|
@ -63,4 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue