Commit 0e2c3755 by wuwenlong

门店管理优化

parent 57bd4ca4
package share.system.controller; package share.web.controller.system;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
......
package share.system.controller; package share.web.system.controller;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
......
package share.system.controller; package share.web.system.controller;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
......
package share.system.controller; package share.web.controller.system;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
......
package share.web.controller.system; package share.web.controller.system;
import java.util.List; import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -16,16 +19,16 @@ import share.common.annotation.Log; ...@@ -16,16 +19,16 @@ import share.common.annotation.Log;
import share.common.core.controller.BaseController; import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult; import share.common.core.domain.AjaxResult;
import share.common.enums.BusinessType; import share.common.enums.BusinessType;
import share.system.domain.SStore;
import share.system.service.ISStoreService; import share.system.service.ISStoreService;
import share.common.utils.poi.ExcelUtil; import share.common.utils.poi.ExcelUtil;
import share.common.core.page.TableDataInfo; import share.common.core.page.TableDataInfo;
import share.system.domain.SStore;
/** /**
* 门店Controller * 门店Controller
* *
* @author ruoyi * @author ruoyi
* @date 2023-09-27 * @date 2023-10-11
*/ */
@RestController @RestController
@RequestMapping("/system/store") @RequestMapping("/system/store")
...@@ -96,9 +99,20 @@ public class SStoreController extends BaseController ...@@ -96,9 +99,20 @@ public class SStoreController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('system:store:remove')") @PreAuthorize("@ss.hasPermi('system:store:remove')")
@Log(title = "门店", businessType = BusinessType.DELETE) @Log(title = "门店", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) public AjaxResult remove(@PathVariable Long[] ids)
{ {
return toAjax(sStoreService.deleteSStoreByIds(ids)); return toAjax(sStoreService.deleteSStoreByIds(ids));
} }
/**
* 查询门店下拉列表
*/
@ApiOperation(value = "查询门店下拉列表", notes="查询条件同门店管理,返回key=门店ID,Value=门店名称的数组对象(result.Data=[{门店ID,门店名称}...])", response=AjaxResult.class)
@GetMapping("/optionList")
public AjaxResult optionList(SStore sStore)
{
return success(sStoreService.optionList(sStore));
}
} }
package share.system.controller; package share.web.system.controller;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
......
...@@ -27,157 +27,157 @@ import io.swagger.annotations.ApiOperation; ...@@ -27,157 +27,157 @@ import io.swagger.annotations.ApiOperation;
* *
* @author ruoyi * @author ruoyi
*/ */
@Api("用户信息管理") //@Api("用户信息管理")
@RestController //@RestController
@RequestMapping("/test/user") //@RequestMapping("/test/user")
public class TestController extends BaseController public class TestController extends BaseController
{ {
private final static Map<Integer, UserEntity> users = new LinkedHashMap<Integer, UserEntity>(); // private final static Map<Integer, UserEntity> users = new LinkedHashMap<Integer, UserEntity>();
{ // {
users.put(1, new UserEntity(1, "admin", "admin123", "15888888888")); // users.put(1, new UserEntity(1, "admin", "admin123", "15888888888"));
users.put(2, new UserEntity(2, "ry", "admin123", "15666666666")); // users.put(2, new UserEntity(2, "ry", "admin123", "15666666666"));
} // }
//
@ApiOperation("获取用户列表") // @ApiOperation("获取用户列表")
@GetMapping("/list") // @GetMapping("/list")
public R<List<UserEntity>> userList() // public R<List<UserEntity>> userList()
{ // {
List<UserEntity> userList = new ArrayList<UserEntity>(users.values()); // List<UserEntity> userList = new ArrayList<UserEntity>(users.values());
return R.ok(userList); // return R.ok(userList);
} // }
//
@ApiOperation("获取用户详细") // @ApiOperation("获取用户详细")
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class) // @ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
@GetMapping("/{userId}") // @GetMapping("/{userId}")
public R<UserEntity> getUser(@PathVariable Integer userId) // public R<UserEntity> getUser(@PathVariable Integer userId)
{ // {
if (!users.isEmpty() && users.containsKey(userId)) // if (!users.isEmpty() && users.containsKey(userId))
{ // {
return R.ok(users.get(userId)); // return R.ok(users.get(userId));
} // }
else // else
{ // {
return R.fail("用户不存在"); // return R.fail("用户不存在");
} // }
} // }
//
@ApiOperation("新增用户") // @ApiOperation("新增用户")
@ApiImplicitParams({ // @ApiImplicitParams({
@ApiImplicitParam(name = "userId", value = "用户id", dataType = "Integer", dataTypeClass = Integer.class), // @ApiImplicitParam(name = "userId", value = "用户id", dataType = "Integer", dataTypeClass = Integer.class),
@ApiImplicitParam(name = "username", value = "用户名称", dataType = "String", dataTypeClass = String.class), // @ApiImplicitParam(name = "username", value = "用户名称", dataType = "String", dataTypeClass = String.class),
@ApiImplicitParam(name = "password", value = "用户密码", dataType = "String", dataTypeClass = String.class), // @ApiImplicitParam(name = "password", value = "用户密码", dataType = "String", dataTypeClass = String.class),
@ApiImplicitParam(name = "mobile", value = "用户手机", dataType = "String", dataTypeClass = String.class) // @ApiImplicitParam(name = "mobile", value = "用户手机", dataType = "String", dataTypeClass = String.class)
}) // })
@PostMapping("/save") // @PostMapping("/save")
public R<String> save(UserEntity user) // public R<String> save(UserEntity user)
{ // {
if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) // if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
{ // {
return R.fail("用户ID不能为空"); // return R.fail("用户ID不能为空");
} // }
users.put(user.getUserId(), user); // users.put(user.getUserId(), user);
return R.ok(); // return R.ok();
} // }
//
@ApiOperation("更新用户") // @ApiOperation("更新用户")
@PutMapping("/update") // @PutMapping("/update")
public R<String> update(@RequestBody UserEntity user) // public R<String> update(@RequestBody UserEntity user)
{ // {
if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) // if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
{ // {
return R.fail("用户ID不能为空"); // return R.fail("用户ID不能为空");
} // }
if (users.isEmpty() || !users.containsKey(user.getUserId())) // if (users.isEmpty() || !users.containsKey(user.getUserId()))
{ // {
return R.fail("用户不存在"); // return R.fail("用户不存在");
} // }
users.remove(user.getUserId()); // users.remove(user.getUserId());
users.put(user.getUserId(), user); // users.put(user.getUserId(), user);
return R.ok(); // return R.ok();
} // }
//
@ApiOperation("删除用户信息") // @ApiOperation("删除用户信息")
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class) // @ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
@DeleteMapping("/{userId}") // @DeleteMapping("/{userId}")
public R<String> delete(@PathVariable Integer userId) // public R<String> delete(@PathVariable Integer userId)
{ // {
if (!users.isEmpty() && users.containsKey(userId)) // if (!users.isEmpty() && users.containsKey(userId))
{ // {
users.remove(userId); // users.remove(userId);
return R.ok(); // return R.ok();
} // }
else // else
{ // {
return R.fail("用户不存在"); // return R.fail("用户不存在");
} // }
} // }
} //}
//
@ApiModel(value = "UserEntity", description = "用户实体") //@ApiModel(value = "UserEntity", description = "用户实体")
class UserEntity //class UserEntity
{ //{
@ApiModelProperty("用户ID") // @ApiModelProperty("用户ID")
private Integer userId; // private Integer userId;
//
@ApiModelProperty("用户名称") // @ApiModelProperty("用户名称")
private String username; // private String username;
//
@ApiModelProperty("用户密码") // @ApiModelProperty("用户密码")
private String password; // private String password;
//
@ApiModelProperty("用户手机") // @ApiModelProperty("用户手机")
private String mobile; // private String mobile;
//
public UserEntity() // public UserEntity()
{ // {
//
} // }
//
public UserEntity(Integer userId, String username, String password, String mobile) // public UserEntity(Integer userId, String username, String password, String mobile)
{ // {
this.userId = userId; // this.userId = userId;
this.username = username; // this.username = username;
this.password = password; // this.password = password;
this.mobile = mobile; // this.mobile = mobile;
} // }
//
public Integer getUserId() // public Integer getUserId()
{ // {
return userId; // return userId;
} // }
//
public void setUserId(Integer userId) // public void setUserId(Integer userId)
{ // {
this.userId = userId; // this.userId = userId;
} // }
//
public String getUsername() // public String getUsername()
{ // {
return username; // return username;
} // }
//
public void setUsername(String username) // public void setUsername(String username)
{ // {
this.username = username; // this.username = username;
} // }
//
public String getPassword() // public String getPassword()
{ // {
return password; // return password;
} // }
//
public void setPassword(String password) // public void setPassword(String password)
{ // {
this.password = password; // this.password = password;
} // }
//
public String getMobile() // public String getMobile()
{ // {
return mobile; // return mobile;
} // }
//
public void setMobile(String mobile) // public void setMobile(String mobile)
{ // {
this.mobile = mobile; // this.mobile = mobile;
} // }
} }
...@@ -7,9 +7,9 @@ import share.common.core.domain.BaseEntity; ...@@ -7,9 +7,9 @@ import share.common.core.domain.BaseEntity;
/** /**
* 门店对象 s_store * 门店对象 s_store
* *
* @author ruoyi * @author ruoyi
* @date 2023-09-27 * @date 2023-10-11
*/ */
public class SStore extends BaseEntity public class SStore extends BaseEntity
{ {
...@@ -31,9 +31,11 @@ public class SStore extends BaseEntity ...@@ -31,9 +31,11 @@ public class SStore extends BaseEntity
private String address; private String address;
/** 经度 */ /** 经度 */
@Excel(name = "经度")
private String longitude; private String longitude;
/** 纬度 */ /** 纬度 */
@Excel(name = "纬度")
private String latitude; private String latitude;
/** 联系人 */ /** 联系人 */
...@@ -48,105 +50,161 @@ public class SStore extends BaseEntity ...@@ -48,105 +50,161 @@ public class SStore extends BaseEntity
@Excel(name = "门店详情") @Excel(name = "门店详情")
private String info; private String info;
public void setId(Long id) /** 营业状态 0:停业 1:正常营业 */
@Excel(name = "营业状态 0:停业 1:正常营业")
private String status;
/** 开始营业时间 */
@Excel(name = "开始营业时间")
private String openStartTime;
/** 结束营业时间 */
@Excel(name = "结束营业时间")
private String openEndTime;
/** 门店类型 1:标准店 2: 形象店 3:旗舰店 */
@Excel(name = "门店类型 1:标准店 2: 形象店 3:旗舰店")
private String storeType;
public void setId(Long id)
{ {
this.id = id; this.id = id;
} }
public Long getId() public Long getId()
{ {
return id; return id;
} }
public void setName(String name) public void setName(String name)
{ {
this.name = name; this.name = name;
} }
public String getName() public String getName()
{ {
return name; return name;
} }
public void setImages(String images) public void setImages(String images)
{ {
this.images = images; this.images = images;
} }
public String getImages() public String getImages()
{ {
return images; return images;
} }
public void setAddress(String address) public void setAddress(String address)
{ {
this.address = address; this.address = address;
} }
public String getAddress() public String getAddress()
{ {
return address; return address;
} }
public void setLongitude(String longitude) public void setLongitude(String longitude)
{ {
this.longitude = longitude; this.longitude = longitude;
} }
public String getLongitude() public String getLongitude()
{ {
return longitude; return longitude;
} }
public void setLatitude(String latitude) public void setLatitude(String latitude)
{ {
this.latitude = latitude; this.latitude = latitude;
} }
public String getLatitude() public String getLatitude()
{ {
return latitude; return latitude;
} }
public void setManager(String manager) public void setManager(String manager)
{ {
this.manager = manager; this.manager = manager;
} }
public String getManager() public String getManager()
{ {
return manager; return manager;
} }
public void setPhone(String phone) public void setPhone(String phone)
{ {
this.phone = phone; this.phone = phone;
} }
public String getPhone() public String getPhone()
{ {
return phone; return phone;
} }
public void setInfo(String info) public void setInfo(String info)
{ {
this.info = info; this.info = info;
} }
public String getInfo() public String getInfo()
{ {
return info; return info;
} }
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setOpenStartTime(String openStartTime)
{
this.openStartTime = openStartTime;
}
public String getOpenStartTime()
{
return openStartTime;
}
public void setOpenEndTime(String openEndTime)
{
this.openEndTime = openEndTime;
}
public String getOpenEndTime()
{
return openEndTime;
}
public void setStoreType(String storeType)
{
this.storeType = storeType;
}
public String getStoreType()
{
return storeType;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId()) .append("id", getId())
.append("name", getName()) .append("name", getName())
.append("images", getImages()) .append("images", getImages())
.append("address", getAddress()) .append("address", getAddress())
.append("longitude", getLongitude()) .append("longitude", getLongitude())
.append("latitude", getLatitude()) .append("latitude", getLatitude())
.append("manager", getManager()) .append("manager", getManager())
.append("phone", getPhone()) .append("phone", getPhone())
.append("info", getInfo()) .append("info", getInfo())
.append("createBy", getCreateBy()) .append("createBy", getCreateBy())
.append("createTime", getCreateTime()) .append("createTime", getCreateTime())
.append("updateBy", getUpdateBy()) .append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime()) .append("updateTime", getUpdateTime())
.append("remark", getRemark()) .append("remark", getRemark())
.toString(); .append("status", getStatus())
.append("openStartTime", getOpenStartTime())
.append("openEndTime", getOpenEndTime())
.append("storeType", getStoreType())
.toString();
} }
} }
...@@ -5,15 +5,15 @@ import share.system.domain.SStore; ...@@ -5,15 +5,15 @@ import share.system.domain.SStore;
/** /**
* 门店Mapper接口 * 门店Mapper接口
* *
* @author ruoyi * @author ruoyi
* @date 2023-09-27 * @date 2023-10-11
*/ */
public interface SStoreMapper public interface SStoreMapper
{ {
/** /**
* 查询门店 * 查询门店
* *
* @param id 门店主键 * @param id 门店主键
* @return 门店 * @return 门店
*/ */
...@@ -21,7 +21,7 @@ public interface SStoreMapper ...@@ -21,7 +21,7 @@ public interface SStoreMapper
/** /**
* 查询门店列表 * 查询门店列表
* *
* @param sStore 门店 * @param sStore 门店
* @return 门店集合 * @return 门店集合
*/ */
...@@ -29,7 +29,7 @@ public interface SStoreMapper ...@@ -29,7 +29,7 @@ public interface SStoreMapper
/** /**
* 新增门店 * 新增门店
* *
* @param sStore 门店 * @param sStore 门店
* @return 结果 * @return 结果
*/ */
...@@ -37,7 +37,7 @@ public interface SStoreMapper ...@@ -37,7 +37,7 @@ public interface SStoreMapper
/** /**
* 修改门店 * 修改门店
* *
* @param sStore 门店 * @param sStore 门店
* @return 结果 * @return 结果
*/ */
...@@ -45,7 +45,7 @@ public interface SStoreMapper ...@@ -45,7 +45,7 @@ public interface SStoreMapper
/** /**
* 删除门店 * 删除门店
* *
* @param id 门店主键 * @param id 门店主键
* @return 结果 * @return 结果
*/ */
...@@ -53,7 +53,7 @@ public interface SStoreMapper ...@@ -53,7 +53,7 @@ public interface SStoreMapper
/** /**
* 批量删除门店 * 批量删除门店
* *
* @param ids 需要删除的数据主键集合 * @param ids 需要删除的数据主键集合
* @return 结果 * @return 结果
*/ */
......
package share.system.service; package share.system.service;
import java.util.List; import java.util.List;
import java.util.Map;
import share.system.domain.SStore; import share.system.domain.SStore;
/** /**
* 门店Service接口 * 门店Service接口
* *
* @author ruoyi * @author ruoyi
* @date 2023-09-27 * @date 2023-10-11
*/ */
public interface ISStoreService public interface ISStoreService
{ {
/** /**
* 查询门店 * 查询门店
* *
* @param id 门店主键 * @param id 门店主键
* @return 门店 * @return 门店
*/ */
...@@ -21,7 +23,7 @@ public interface ISStoreService ...@@ -21,7 +23,7 @@ public interface ISStoreService
/** /**
* 查询门店列表 * 查询门店列表
* *
* @param sStore 门店 * @param sStore 门店
* @return 门店集合 * @return 门店集合
*/ */
...@@ -29,7 +31,7 @@ public interface ISStoreService ...@@ -29,7 +31,7 @@ public interface ISStoreService
/** /**
* 新增门店 * 新增门店
* *
* @param sStore 门店 * @param sStore 门店
* @return 结果 * @return 结果
*/ */
...@@ -37,7 +39,7 @@ public interface ISStoreService ...@@ -37,7 +39,7 @@ public interface ISStoreService
/** /**
* 修改门店 * 修改门店
* *
* @param sStore 门店 * @param sStore 门店
* @return 结果 * @return 结果
*/ */
...@@ -45,7 +47,7 @@ public interface ISStoreService ...@@ -45,7 +47,7 @@ public interface ISStoreService
/** /**
* 批量删除门店 * 批量删除门店
* *
* @param ids 需要删除的门店主键集合 * @param ids 需要删除的门店主键集合
* @return 结果 * @return 结果
*/ */
...@@ -53,9 +55,17 @@ public interface ISStoreService ...@@ -53,9 +55,17 @@ public interface ISStoreService
/** /**
* 删除门店信息 * 删除门店信息
* *
* @param id 门店主键 * @param id 门店主键
* @return 结果 * @return 结果
*/ */
public int deleteSStoreById(Long id); public int deleteSStoreById(Long id);
/**
* 查询门店下拉列表
*
* @param sStore 门店
* @return 门店集合
*/
public List<Map> optionList(SStore sStore);
} }
package share.system.service.impl; package share.system.service.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import org.apache.commons.collections4.CollectionUtils;
import share.common.utils.DateUtils; import share.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -10,19 +16,19 @@ import share.system.service.ISStoreService; ...@@ -10,19 +16,19 @@ import share.system.service.ISStoreService;
/** /**
* 门店Service业务层处理 * 门店Service业务层处理
* *
* @author ruoyi * @author ruoyi
* @date 2023-09-27 * @date 2023-10-11
*/ */
@Service @Service
public class SStoreServiceImpl implements ISStoreService public class SStoreServiceImpl implements ISStoreService
{ {
@Autowired @Autowired
private SStoreMapper sStoreMapper; private SStoreMapper sStoreMapper;
/** /**
* 查询门店 * 查询门店
* *
* @param id 门店主键 * @param id 门店主键
* @return 门店 * @return 门店
*/ */
...@@ -34,7 +40,7 @@ public class SStoreServiceImpl implements ISStoreService ...@@ -34,7 +40,7 @@ public class SStoreServiceImpl implements ISStoreService
/** /**
* 查询门店列表 * 查询门店列表
* *
* @param sStore 门店 * @param sStore 门店
* @return 门店 * @return 门店
*/ */
...@@ -46,7 +52,7 @@ public class SStoreServiceImpl implements ISStoreService ...@@ -46,7 +52,7 @@ public class SStoreServiceImpl implements ISStoreService
/** /**
* 新增门店 * 新增门店
* *
* @param sStore 门店 * @param sStore 门店
* @return 结果 * @return 结果
*/ */
...@@ -59,7 +65,7 @@ public class SStoreServiceImpl implements ISStoreService ...@@ -59,7 +65,7 @@ public class SStoreServiceImpl implements ISStoreService
/** /**
* 修改门店 * 修改门店
* *
* @param sStore 门店 * @param sStore 门店
* @return 结果 * @return 结果
*/ */
...@@ -72,7 +78,7 @@ public class SStoreServiceImpl implements ISStoreService ...@@ -72,7 +78,7 @@ public class SStoreServiceImpl implements ISStoreService
/** /**
* 批量删除门店 * 批量删除门店
* *
* @param ids 需要删除的门店主键 * @param ids 需要删除的门店主键
* @return 结果 * @return 结果
*/ */
...@@ -84,7 +90,7 @@ public class SStoreServiceImpl implements ISStoreService ...@@ -84,7 +90,7 @@ public class SStoreServiceImpl implements ISStoreService
/** /**
* 删除门店信息 * 删除门店信息
* *
* @param id 门店主键 * @param id 门店主键
* @return 结果 * @return 结果
*/ */
...@@ -93,4 +99,19 @@ public class SStoreServiceImpl implements ISStoreService ...@@ -93,4 +99,19 @@ public class SStoreServiceImpl implements ISStoreService
{ {
return sStoreMapper.deleteSStoreById(id); return sStoreMapper.deleteSStoreById(id);
} }
@Override
public List<Map> optionList(SStore sStore) {
List<SStore> storeList = sStoreMapper.selectSStoreList(sStore);
List<Map> result = new ArrayList<>();
if(CollectionUtils.isNotEmpty(storeList)) {
result = storeList.stream().map(store -> {
Map<Long, String> map = new HashMap<Long, String>() {{
put(store.getId(), store.getName());
}};
return map;
}).collect(Collectors.toList());
}
return result;
}
} }
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="share.system.mapper.SStoreMapper"> <mapper namespace="share.system.mapper.SStoreMapper">
<resultMap type="SStore" id="SStoreResult"> <resultMap type="SStore" id="SStoreResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="name" column="name" /> <result property="name" column="name" />
...@@ -19,28 +19,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -19,28 +19,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="status" column="status" />
<result property="openStartTime" column="open_start_time" />
<result property="openEndTime" column="open_end_time" />
<result property="storeType" column="store_type" />
</resultMap> </resultMap>
<sql id="selectSStoreVo"> <sql id="selectSStoreVo">
select id, name, images, address, longitude, latitude, manager, phone, info, create_by, create_time, update_by, update_time, remark from s_store select id, name, images, address, longitude, latitude, manager, phone, info, create_by, create_time, update_by, update_time, remark, status, open_start_time, open_end_time, store_type from s_store
</sql> </sql>
<select id="selectSStoreList" parameterType="SStore" resultMap="SStoreResult"> <select id="selectSStoreList" parameterType="SStore" resultMap="SStoreResult">
<include refid="selectSStoreVo"/> <include refid="selectSStoreVo"/>
<where> <where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="images != null and images != ''"> and images = #{images}</if>
<if test="address != null and address != ''"> and address = #{address}</if> <if test="address != null and address != ''"> and address = #{address}</if>
<if test="longitude != null and longitude != ''"> and longitude = #{longitude}</if>
<if test="latitude != null and latitude != ''"> and latitude = #{latitude}</if>
<if test="manager != null and manager != ''"> and manager = #{manager}</if> <if test="manager != null and manager != ''"> and manager = #{manager}</if>
<if test="phone != null and phone != ''"> and phone = #{phone}</if> <if test="phone != null and phone != ''"> and phone = #{phone}</if>
<if test="info != null and info != ''"> and info = #{info}</if> <if test="info != null and info != ''"> and info = #{info}</if>
<if test="status != null "> and status = #{status}</if>
<if test="openStartTime != null "> and open_start_time = #{openStartTime}</if>
<if test="openEndTime != null "> and open_end_time = #{openEndTime}</if>
<if test="storeType != null "> and store_type = #{storeType}</if>
</where> </where>
</select> </select>
<select id="selectSStoreById" parameterType="Long" resultMap="SStoreResult"> <select id="selectSStoreById" parameterType="Long" resultMap="SStoreResult">
<include refid="selectSStoreVo"/> <include refid="selectSStoreVo"/>
where id = #{id} where id = #{id}
</select> </select>
<insert id="insertSStore" parameterType="SStore" useGeneratedKeys="true" keyProperty="id"> <insert id="insertSStore" parameterType="SStore" useGeneratedKeys="true" keyProperty="id">
insert into s_store insert into s_store
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
...@@ -57,7 +68,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -57,7 +68,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by,</if> <if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
</trim> <if test="status != null">status,</if>
<if test="openStartTime != null">open_start_time,</if>
<if test="openEndTime != null">open_end_time,</if>
<if test="storeType != null">store_type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">#{name},</if> <if test="name != null">#{name},</if>
<if test="images != null">#{images},</if> <if test="images != null">#{images},</if>
...@@ -72,7 +87,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -72,7 +87,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if> <if test="remark != null">#{remark},</if>
</trim> <if test="status != null">#{status},</if>
<if test="openStartTime != null">#{openStartTime},</if>
<if test="openEndTime != null">#{openEndTime},</if>
<if test="storeType != null">#{storeType},</if>
</trim>
</insert> </insert>
<update id="updateSStore" parameterType="SStore"> <update id="updateSStore" parameterType="SStore">
...@@ -91,6 +110,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -91,6 +110,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="status != null">status = #{status},</if>
<if test="openStartTime != null">open_start_time = #{openStartTime},</if>
<if test="openEndTime != null">open_end_time = #{openEndTime},</if>
<if test="storeType != null">store_type = #{storeType},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
...@@ -100,7 +123,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -100,7 +123,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete> </delete>
<delete id="deleteSStoreByIds" parameterType="String"> <delete id="deleteSStoreByIds" parameterType="String">
delete from s_store where id in delete from s_store where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment