问题 10 登录部分

问题 11 操作记录页
This commit is contained in:
wangshuai 2024-07-16 15:06:00 +08:00
parent fd1d8ef925
commit 7e54b41593
16 changed files with 683 additions and 4 deletions

View File

@ -0,0 +1,104 @@
package com.ruoyi.business.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.business.domain.BusMarketOperationInfo;
import com.ruoyi.business.service.IBusMarketOperationInfoService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 营销操作记录Controller
*
* @author ruoyi
* @date 2024-07-16
*/
@RestController
@RequestMapping("/business/operation")
public class BusMarketOperationInfoController extends BaseController
{
@Autowired
private IBusMarketOperationInfoService busMarketOperationInfoService;
/**
* 查询营销操作记录列表
*/
// @PreAuthorize("@ss.hasPermi('business:operation:list')")
@GetMapping("/list")
public TableDataInfo list(BusMarketOperationInfo busMarketOperationInfo)
{
startPage();
List<BusMarketOperationInfo> list = busMarketOperationInfoService.selectBusMarketOperationInfoList(busMarketOperationInfo);
return getDataTable(list);
}
/**
* 导出营销操作记录列表
*/
@PreAuthorize("@ss.hasPermi('business:operation:export')")
@Log(title = "营销操作记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BusMarketOperationInfo busMarketOperationInfo)
{
List<BusMarketOperationInfo> list = busMarketOperationInfoService.selectBusMarketOperationInfoList(busMarketOperationInfo);
ExcelUtil<BusMarketOperationInfo> util = new ExcelUtil<BusMarketOperationInfo>(BusMarketOperationInfo.class);
util.exportExcel(response, list, "营销操作记录数据");
}
/**
* 获取营销操作记录详细信息
*/
@PreAuthorize("@ss.hasPermi('business:operation:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(busMarketOperationInfoService.selectBusMarketOperationInfoById(id));
}
/**
* 新增营销操作记录
*/
@PreAuthorize("@ss.hasPermi('business:operation:add')")
@Log(title = "营销操作记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BusMarketOperationInfo busMarketOperationInfo)
{
return toAjax(busMarketOperationInfoService.insertBusMarketOperationInfo(busMarketOperationInfo));
}
/**
* 修改营销操作记录
*/
@PreAuthorize("@ss.hasPermi('business:operation:edit')")
@Log(title = "营销操作记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BusMarketOperationInfo busMarketOperationInfo)
{
return toAjax(busMarketOperationInfoService.updateBusMarketOperationInfo(busMarketOperationInfo));
}
/**
* 删除营销操作记录
*/
@PreAuthorize("@ss.hasPermi('business:operation:remove')")
@Log(title = "营销操作记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(busMarketOperationInfoService.deleteBusMarketOperationInfoByIds(ids));
}
}

View File

@ -1,10 +1,13 @@
package com.ruoyi.framework.config;
import com.ruoyi.framework.security.context.SmsCodeAuthenticationProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.authentication.ProviderManager;
import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
@ -21,6 +24,9 @@ import com.ruoyi.framework.security.filter.JwtAuthenticationTokenFilter;
import com.ruoyi.framework.security.handle.AuthenticationEntryPointImpl;
import com.ruoyi.framework.security.handle.LogoutSuccessHandlerImpl;
import java.util.ArrayList;
import java.util.List;
/**
* spring security配置
*
@ -34,8 +40,16 @@ public class SecurityConfig
* 自定义用户认证逻辑
*/
@Autowired
@Qualifier("userDetailsServiceImpl")
private UserDetailsService userDetailsService;
/**
* 自定义用户认证逻辑
*/
@Autowired
@Qualifier("userDetailsByTelephoneServiceImpl")
private UserDetailsService userDetailsByTelephoneService;
/**
* 认证失败处理类
*/
@ -75,7 +89,12 @@ public class SecurityConfig
DaoAuthenticationProvider daoAuthenticationProvider = new DaoAuthenticationProvider();
daoAuthenticationProvider.setUserDetailsService(userDetailsService);
daoAuthenticationProvider.setPasswordEncoder(bCryptPasswordEncoder());
return new ProviderManager(daoAuthenticationProvider);
SmsCodeAuthenticationProvider smsCodeAuthenticationProvider = new SmsCodeAuthenticationProvider();
smsCodeAuthenticationProvider.setUserDetailsService(userDetailsByTelephoneService);
List<AuthenticationProvider> list = new ArrayList();
list.add(daoAuthenticationProvider);
list.add(smsCodeAuthenticationProvider);
return new ProviderManager(list);
}
/**

View File

@ -0,0 +1,48 @@
package com.ruoyi.framework.security.context;
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
/**
* 短信登陆鉴权 Provider要求实现 AuthenticationProvider 接口
*
* @author gmk
*/
public class SmsCodeAuthenticationProvider implements AuthenticationProvider {
private UserDetailsService userDetailsService;
@Override
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
SmsCodeAuthenticationToken authenticationToken = (SmsCodeAuthenticationToken) authentication;
String telephone = (String) authenticationToken.getPrincipal();
UserDetails userDetails = userDetailsService.loadUserByUsername(telephone);
// 此时鉴权成功后应当重新 new 一个拥有鉴权的 authenticationResult 返回
SmsCodeAuthenticationToken authenticationResult = new SmsCodeAuthenticationToken(userDetails, userDetails.getAuthorities());
authenticationResult.setDetails(authenticationToken.getDetails());
return authenticationResult;
}
@Override
public boolean supports(Class<?> authentication) {
// 判断 authentication 是不是 SmsCodeAuthenticationToken 的子类或子接口
return SmsCodeAuthenticationToken.class.isAssignableFrom(authentication);
}
public UserDetailsService getUserDetailsService() {
return userDetailsService;
}
public void setUserDetailsService(UserDetailsService userDetailsService) {
this.userDetailsService = userDetailsService;
}
}

View File

@ -0,0 +1,48 @@
package com.ruoyi.framework.web.service;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.enums.UserStatus;
import com.ruoyi.common.exception.base.BaseException;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.service.ISysUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
@Service("userDetailsByTelephoneServiceImpl")
public class UserDetailsByTelephoneServiceImpl implements UserDetailsService {
private static final Logger log = LoggerFactory.getLogger(UserDetailsByTelephoneServiceImpl.class);
@Autowired
private ISysUserService userService;
@Autowired
private SysPermissionService permissionService;
@Override
public UserDetails loadUserByUsername(String phone) throws UsernameNotFoundException {
// 用户名 同样是手机号 todo
SysUser user = userService.selectUserByPhone(phone);
if (StringUtils.isNull(user)) {
log.info("登录用户:{} 不存在.", phone);
throw new UsernameNotFoundException("登录用户:" + phone + " 不存在");
} else if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) {
log.info("登录用户:{} 已被删除.", phone);
throw new BaseException("对不起,您的账号:" + phone + " 已被删除");
} else if (UserStatus.DISABLE.getCode().equals(user.getStatus())) {
log.info("登录用户:{} 已被停用.", phone);
throw new BaseException("对不起,您的账号:" + phone + " 已停用");
}
return createLoginUser(user);
}
public UserDetails createLoginUser(SysUser user) {
return new LoginUser(user.getUserId(), user.getDeptId(), user, permissionService.getMenuPermission(user));
}
}

View File

@ -20,7 +20,7 @@ import com.ruoyi.system.service.ISysUserService;
*
* @author ruoyi
*/
@Service
@Service("userDetailsServiceImpl")
public class UserDetailsServiceImpl implements UserDetailsService
{
private static final Logger log = LoggerFactory.getLogger(UserDetailsServiceImpl.class);

View File

@ -116,6 +116,7 @@ public class BusAgentInfo extends BaseEntity
private String delStatus;
private String password;
private String confirmPassword;
@Excel(name = "手机号码")
private String phoneNumber;
private int aiRealTimeNum;
private Long deptId;

View File

@ -0,0 +1,122 @@
package com.ruoyi.business.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 营销操作记录对象 bus_market_operation_info
*
* @author ruoyi
* @date 2024-07-16
*/
public class BusMarketOperationInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 店铺id */
@Excel(name = "店铺id")
private Long storeId;
/** 店铺标识 */
@Excel(name = "店铺标识")
private String storeCode;
/** 操作店铺名称 */
@Excel(name = "操作店铺名称")
private String storeName;
/** 操作人id */
@Excel(name = "操作人id")
private Long updateId;
/** 操作人 */
@Excel(name = "操作人")
private String updateUser;
/** 1开启 2关闭 */
@Excel(name = "1开启 2关闭")
private String operationStatus;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setStoreId(Long storeId)
{
this.storeId = storeId;
}
public Long getStoreId()
{
return storeId;
}
public void setStoreCode(String storeCode)
{
this.storeCode = storeCode;
}
public String getStoreCode()
{
return storeCode;
}
public void setStoreName(String storeName)
{
this.storeName = storeName;
}
public String getStoreName()
{
return storeName;
}
public void setUpdateId(Long updateId)
{
this.updateId = updateId;
}
public Long getUpdateId()
{
return updateId;
}
public void setUpdateUser(String updateUser)
{
this.updateUser = updateUser;
}
public String getUpdateUser()
{
return updateUser;
}
public void setOperationStatus(String operationStatus)
{
this.operationStatus = operationStatus;
}
public String getOperationStatus()
{
return operationStatus;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("storeId", getStoreId())
.append("storeCode", getStoreCode())
.append("storeName", getStoreName())
.append("updateTime", getUpdateTime())
.append("updateId", getUpdateId())
.append("updateUser", getUpdateUser())
.append("operationStatus", getOperationStatus())
.toString();
}
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.business.mapper;
import java.util.List;
import com.ruoyi.business.domain.BusMarketOperationInfo;
/**
* 营销操作记录Mapper接口
*
* @author ruoyi
* @date 2024-07-16
*/
public interface BusMarketOperationInfoMapper
{
/**
* 查询营销操作记录
*
* @param id 营销操作记录主键
* @return 营销操作记录
*/
public BusMarketOperationInfo selectBusMarketOperationInfoById(Long id);
/**
* 查询营销操作记录列表
*
* @param busMarketOperationInfo 营销操作记录
* @return 营销操作记录集合
*/
public List<BusMarketOperationInfo> selectBusMarketOperationInfoList(BusMarketOperationInfo busMarketOperationInfo);
/**
* 新增营销操作记录
*
* @param busMarketOperationInfo 营销操作记录
* @return 结果
*/
public int insertBusMarketOperationInfo(BusMarketOperationInfo busMarketOperationInfo);
/**
* 修改营销操作记录
*
* @param busMarketOperationInfo 营销操作记录
* @return 结果
*/
public int updateBusMarketOperationInfo(BusMarketOperationInfo busMarketOperationInfo);
/**
* 删除营销操作记录
*
* @param id 营销操作记录主键
* @return 结果
*/
public int deleteBusMarketOperationInfoById(Long id);
/**
* 批量删除营销操作记录
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteBusMarketOperationInfoByIds(Long[] ids);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.business.service;
import java.util.List;
import com.ruoyi.business.domain.BusMarketOperationInfo;
/**
* 营销操作记录Service接口
*
* @author ruoyi
* @date 2024-07-16
*/
public interface IBusMarketOperationInfoService
{
/**
* 查询营销操作记录
*
* @param id 营销操作记录主键
* @return 营销操作记录
*/
public BusMarketOperationInfo selectBusMarketOperationInfoById(Long id);
/**
* 查询营销操作记录列表
*
* @param busMarketOperationInfo 营销操作记录
* @return 营销操作记录集合
*/
public List<BusMarketOperationInfo> selectBusMarketOperationInfoList(BusMarketOperationInfo busMarketOperationInfo);
/**
* 新增营销操作记录
*
* @param busMarketOperationInfo 营销操作记录
* @return 结果
*/
public int insertBusMarketOperationInfo(BusMarketOperationInfo busMarketOperationInfo);
/**
* 修改营销操作记录
*
* @param busMarketOperationInfo 营销操作记录
* @return 结果
*/
public int updateBusMarketOperationInfo(BusMarketOperationInfo busMarketOperationInfo);
/**
* 批量删除营销操作记录
*
* @param ids 需要删除的营销操作记录主键集合
* @return 结果
*/
public int deleteBusMarketOperationInfoByIds(Long[] ids);
/**
* 删除营销操作记录信息
*
* @param id 营销操作记录主键
* @return 结果
*/
public int deleteBusMarketOperationInfoById(Long id);
}

View File

@ -0,0 +1,95 @@
package com.ruoyi.business.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.BusMarketOperationInfoMapper;
import com.ruoyi.business.domain.BusMarketOperationInfo;
import com.ruoyi.business.service.IBusMarketOperationInfoService;
/**
* 营销操作记录Service业务层处理
*
* @author ruoyi
* @date 2024-07-16
*/
@Service
public class BusMarketOperationInfoServiceImpl implements IBusMarketOperationInfoService
{
@Autowired
private BusMarketOperationInfoMapper busMarketOperationInfoMapper;
/**
* 查询营销操作记录
*
* @param id 营销操作记录主键
* @return 营销操作记录
*/
@Override
public BusMarketOperationInfo selectBusMarketOperationInfoById(Long id)
{
return busMarketOperationInfoMapper.selectBusMarketOperationInfoById(id);
}
/**
* 查询营销操作记录列表
*
* @param busMarketOperationInfo 营销操作记录
* @return 营销操作记录
*/
@Override
public List<BusMarketOperationInfo> selectBusMarketOperationInfoList(BusMarketOperationInfo busMarketOperationInfo)
{
return busMarketOperationInfoMapper.selectBusMarketOperationInfoList(busMarketOperationInfo);
}
/**
* 新增营销操作记录
*
* @param busMarketOperationInfo 营销操作记录
* @return 结果
*/
@Override
public int insertBusMarketOperationInfo(BusMarketOperationInfo busMarketOperationInfo)
{
return busMarketOperationInfoMapper.insertBusMarketOperationInfo(busMarketOperationInfo);
}
/**
* 修改营销操作记录
*
* @param busMarketOperationInfo 营销操作记录
* @return 结果
*/
@Override
public int updateBusMarketOperationInfo(BusMarketOperationInfo busMarketOperationInfo)
{
busMarketOperationInfo.setUpdateTime(DateUtils.getNowDate());
return busMarketOperationInfoMapper.updateBusMarketOperationInfo(busMarketOperationInfo);
}
/**
* 批量删除营销操作记录
*
* @param ids 需要删除的营销操作记录主键
* @return 结果
*/
@Override
public int deleteBusMarketOperationInfoByIds(Long[] ids)
{
return busMarketOperationInfoMapper.deleteBusMarketOperationInfoByIds(ids);
}
/**
* 删除营销操作记录信息
*
* @param id 营销操作记录主键
* @return 结果
*/
@Override
public int deleteBusMarketOperationInfoById(Long id)
{
return busMarketOperationInfoMapper.deleteBusMarketOperationInfoById(id);
}
}

View File

@ -3,12 +3,16 @@ package com.ruoyi.business.service.impl;
import java.util.Date;
import java.util.List;
import com.ruoyi.business.domain.BusMarketOperationInfo;
import com.ruoyi.business.domain.BusSaleInfo;
import com.ruoyi.business.domain.BusStoreConfigInfo;
import com.ruoyi.business.mapper.BusMarketOperationInfoMapper;
import com.ruoyi.business.mapper.BusSaleInfoMapper;
import com.ruoyi.business.mapper.BusStoreConfigInfoMapper;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.BusStoreInfoMapper;
@ -34,6 +38,9 @@ public class BusStoreInfoServiceImpl implements IBusStoreInfoService
@Autowired
private BusSaleInfoMapper busSaleInfoMapper;
@Autowired
private BusMarketOperationInfoMapper busMarketOperationInfoMapper;
/**
* 查询店铺信息
*
@ -95,8 +102,20 @@ public class BusStoreInfoServiceImpl implements IBusStoreInfoService
* @return 结果
*/
@Override
@Transactional
public int updateBusStoreInfo(BusStoreInfo busStoreInfo)
{
LoginUser loginUser = SecurityUtils.getLoginUser();
BusStoreInfo busStoreInfo1 = busStoreInfoMapper.selectBusStoreInfoById(busStoreInfo.getId());
BusMarketOperationInfo busMarketOperationInfo = new BusMarketOperationInfo();
busMarketOperationInfo.setStoreId(busStoreInfo.getId());
busMarketOperationInfo.setStoreCode(busStoreInfo1.getStoreCode());
busMarketOperationInfo.setStoreName(busStoreInfo1.getStoreName());
busMarketOperationInfo.setUpdateId(loginUser.getUserId());
busMarketOperationInfo.setUpdateUser(loginUser.getUsername());
busMarketOperationInfo.setUpdateTime(DateUtils.getNowDate());
busMarketOperationInfo.setOperationStatus(busStoreInfo.getReturnVisitStatus());
busMarketOperationInfoMapper.insertBusMarketOperationInfo(busMarketOperationInfo);
busStoreInfo.setUpdateTime(DateUtils.getNowDate());
return busStoreInfoMapper.updateBusStoreInfo(busStoreInfo);
}

View File

@ -124,4 +124,6 @@ public interface SysUserMapper
* @return 结果
*/
public SysUser checkEmailUnique(String email);
SysUser selectUserByPhone(String phone);
}

View File

@ -203,4 +203,6 @@ public interface ISysUserService
* @return 结果
*/
public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName);
SysUser selectUserByPhone(String phone);
}

View File

@ -563,4 +563,9 @@ public class SysUserServiceImpl implements ISysUserService
}
return successMsg.toString();
}
@Override
public SysUser selectUserByPhone(String phone) {
return userMapper.selectUserByPhone(phone);
}
}

View File

@ -0,0 +1,87 @@
<?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.ruoyi.business.mapper.BusMarketOperationInfoMapper">
<resultMap type="BusMarketOperationInfo" id="BusMarketOperationInfoResult">
<result property="id" column="id" />
<result property="storeId" column="store_id" />
<result property="storeCode" column="store_code" />
<result property="storeName" column="store_name" />
<result property="updateTime" column="update_time" />
<result property="updateId" column="update_id" />
<result property="updateUser" column="update_user" />
<result property="operationStatus" column="operation_status" />
</resultMap>
<sql id="selectBusMarketOperationInfoVo">
select id, store_id, store_code, store_name, update_time, update_id, update_user, operation_status from bus_market_operation_info
</sql>
<select id="selectBusMarketOperationInfoList" parameterType="BusMarketOperationInfo" resultMap="BusMarketOperationInfoResult">
<include refid="selectBusMarketOperationInfoVo"/>
<where>
<if test="storeId != null "> and store_id = #{storeId}</if>
<if test="storeCode != null and storeCode != ''"> and store_code = #{storeCode}</if>
<if test="storeName != null and storeName != ''"> and store_name like concat('%', #{storeName}, '%')</if>
<if test="updateId != null "> and update_id = #{updateId}</if>
<if test="updateUser != null and updateUser != ''"> and update_user = #{updateUser}</if>
<if test="operationStatus != null and operationStatus != ''"> and operation_status = #{operationStatus}</if>
</where>
</select>
<select id="selectBusMarketOperationInfoById" parameterType="Long" resultMap="BusMarketOperationInfoResult">
<include refid="selectBusMarketOperationInfoVo"/>
where id = #{id}
</select>
<insert id="insertBusMarketOperationInfo" parameterType="BusMarketOperationInfo">
insert into bus_market_operation_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="storeId != null">store_id,</if>
<if test="storeCode != null">store_code,</if>
<if test="storeName != null">store_name,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateId != null">update_id,</if>
<if test="updateUser != null">update_user,</if>
<if test="operationStatus != null">operation_status,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="storeId != null">#{storeId},</if>
<if test="storeCode != null">#{storeCode},</if>
<if test="storeName != null">#{storeName},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateId != null">#{updateId},</if>
<if test="updateUser != null">#{updateUser},</if>
<if test="operationStatus != null">#{operationStatus},</if>
</trim>
</insert>
<update id="updateBusMarketOperationInfo" parameterType="BusMarketOperationInfo">
update bus_market_operation_info
<trim prefix="SET" suffixOverrides=",">
<if test="storeId != null">store_id = #{storeId},</if>
<if test="storeCode != null">store_code = #{storeCode},</if>
<if test="storeName != null">store_name = #{storeName},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateId != null">update_id = #{updateId},</if>
<if test="updateUser != null">update_user = #{updateUser},</if>
<if test="operationStatus != null">operation_status = #{operationStatus},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBusMarketOperationInfoById" parameterType="Long">
delete from bus_market_operation_info where id = #{id}
</delete>
<delete id="deleteBusMarketOperationInfoByIds" parameterType="String">
delete from bus_market_operation_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -141,8 +141,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1
</select>
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
<select id="selectUserByPhone" parameterType="String" resultMap="SysUserResult">
<include refid="selectUserVo"/>
where u.phonenumber = #{phone} and u.del_flag = '0'
</select>
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
insert into sys_user(
<if test="userId != null and userId != 0">user_id,</if>
<if test="deptId != null and deptId != 0">dept_id,</if>