Commit 3648e7a6 by YG8999

小程序使用协议

parent f0fdd9d6
package share.web.controller.system;
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 share.common.annotation.Log;
import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult;
import share.common.enums.BusinessType;
import share.system.domain.Protocol;
import share.system.service.ProtocolService;
import share.common.utils.poi.ExcelUtil;
import share.common.core.page.TableDataInfo;
/**
* 小程序协议管理Controller
*
* @author wuwenlong
* @date 2023-11-22
*/
@RestController
@RequestMapping("/system/protocol")
public class ProtocolController extends BaseController
{
@Autowired
private ProtocolService protocolService;
/**
* 查询小程序协议管理列表
*/
@PreAuthorize("@ss.hasPermi('system:protocol:list')")
@GetMapping("/list")
public TableDataInfo list(Protocol protocol)
{
startPage();
List<Protocol> list = protocolService.selectProtocolList(protocol);
return getDataTable(list);
}
/**
* 导出小程序协议管理列表
*/
@PreAuthorize("@ss.hasPermi('system:protocol:export')")
@Log(title = "小程序协议管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, Protocol protocol)
{
List<Protocol> list = protocolService.selectProtocolList(protocol);
ExcelUtil<Protocol> util = new ExcelUtil<Protocol>(Protocol.class);
util.exportExcel(response, list, "小程序协议管理数据");
}
/**
* 获取小程序协议管理详细信息
*/
@PreAuthorize("@ss.hasPermi('system:protocol:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(protocolService.selectProtocolById(id));
}
/**
* 新增小程序协议管理
*/
@PreAuthorize("@ss.hasPermi('system:protocol:add')")
@Log(title = "小程序协议管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody Protocol protocol)
{
protocol.setCreateBy(getUsername());
return toAjax(protocolService.insertProtocol(protocol));
}
/**
* 修改小程序协议管理
*/
@PreAuthorize("@ss.hasPermi('system:protocol:edit')")
@Log(title = "小程序协议管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody Protocol protocol)
{
protocol.setUpdateBy(getUsername());
return toAjax(protocolService.updateProtocol(protocol));
}
/**
* 删除小程序协议管理
*/
@PreAuthorize("@ss.hasPermi('system:protocol:remove')")
@Log(title = "小程序协议管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(protocolService.deleteProtocolByIds(ids));
}
}
package share.web.controller.system;
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 share.common.annotation.Log;
import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult;
import share.common.enums.BusinessType;
import share.system.domain.SmsLog;
import share.system.service.SmsLogService;
import share.common.utils.poi.ExcelUtil;
import share.common.core.page.TableDataInfo;
/**
* 短信日志Controller
*
* @author wuwenlong
* @date 2023-11-22
*/
@RestController
@RequestMapping("/system/sms/log")
public class SmsLogController extends BaseController
{
@Autowired
private SmsLogService smsLogService;
/**
* 查询短信日志列表
*/
@PreAuthorize("@ss.hasPermi('system:smsLog:list')")
@GetMapping("/list")
public TableDataInfo list(SmsLog smsLog)
{
startPage();
List<SmsLog> list = smsLogService.selectSmsLogList(smsLog);
return getDataTable(list);
}
/**
* 导出短信日志列表
*/
@PreAuthorize("@ss.hasPermi('system:smsLog:export')")
@Log(title = "短信日志", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SmsLog smsLog)
{
List<SmsLog> list = smsLogService.selectSmsLogList(smsLog);
ExcelUtil<SmsLog> util = new ExcelUtil<SmsLog>(SmsLog.class);
util.exportExcel(response, list, "短信日志数据");
}
/**
* 获取短信日志详细信息
*/
@PreAuthorize("@ss.hasPermi('system:smsLog:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(smsLogService.selectSmsLogById(id));
}
/**
* 新增短信日志
*/
@PreAuthorize("@ss.hasPermi('system:smsLog:add')")
@Log(title = "短信日志", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SmsLog smsLog)
{
return toAjax(smsLogService.insertSmsLog(smsLog));
}
/**
* 修改短信日志
*/
@PreAuthorize("@ss.hasPermi('system:smsLog:edit')")
@Log(title = "短信日志", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SmsLog smsLog)
{
return toAjax(smsLogService.updateSmsLog(smsLog));
}
/**
* 删除短信日志
*/
@PreAuthorize("@ss.hasPermi('system:smsLog:remove')")
@Log(title = "短信日志", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(smsLogService.deleteSmsLogByIds(ids));
}
}
......@@ -22,6 +22,7 @@ wechat:
signKey: ZEKu56XCezuESfNEdM4zVZEN3cz2PuHz
certPath: /var/gxpt/wechat_ssl/apiclient_cert.p12
token: coujio
# 开发环境配置
server:
# 服务器的HTTP端口,默认为8080
......@@ -188,7 +189,7 @@ xss:
# 过滤开关
enabled: true
# 排除链接(多个用逗号分隔)
excludes: /system/notice
excludes: /system/notice,/system/protocol
# 匹配链接
urlPatterns: /system/*,/monitor/*,/tool/*
meituan:
......
......@@ -733,7 +733,7 @@ public class BaseUtil {
* @return 生成的随机码
*/
public static String getOrderNo(String payType){
return payType + randomCount(11111, 99999) + System.currentTimeMillis() + randomCount(11111, 99999);
return payType + randomCount(11, 99) + System.currentTimeMillis() + randomCount(111, 999);
}
/**
......
package share.web.controller.system;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import share.common.annotation.Log;
import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult;
import share.common.core.page.TableDataInfo;
import share.common.enums.BusinessType;
import share.common.utils.poi.ExcelUtil;
import share.system.domain.Protocol;
import share.system.service.ProtocolService;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 小程序协议管理Controller
*
* @author wuwenlong
* @date 2023-11-22
*/
@RestController
@RequestMapping("/protocol")
public class ProtocolController extends BaseController
{
@Autowired
private ProtocolService protocolService;
/**
* key 标识key
* 获取小程序协议管理详细信息
*/
@GetMapping(value = "/{key}")
public AjaxResult getInfo(@PathVariable("id") String key)
{
return success(protocolService.selectProtocolByKey(key));
}
}
package share.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import share.common.annotation.Excel;
import share.common.core.domain.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
/**
* 小程序协议管理对象 s_protocol
*
* @author wuwenlong
* @date 2023-11-22
*/
@Data
public class Protocol extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 协议ID */
private Long id;
/** 协议标题 */
@Excel(name = "协议标题")
private String protocolTitle;
/** 协议key名 */
@Excel(name = "协议key名")
private String protocolKey;
/** 协议内容 */
@Excel(name = "协议内容")
private String content;
/** 状态(0正常 1关闭) */
@Excel(name = "状态", readConverterExp = "0=正常,1=关闭")
private String status;
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("protocolTitle", getProtocolTitle())
.append("protocolKey", getProtocolKey())
.append("content", getContent())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}
package share.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import share.common.annotation.Excel;
import share.common.core.domain.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
/**
* 短信日志对象 s_sms_log
*
* @author wuwenlong
* @date 2023-11-22
*/
@Data
public class SmsLog extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 发送手机号码 */
@Excel(name = "发送手机号码")
private String phone;
/** 短信模版 */
@Excel(name = "短信模版")
private String templateId;
/** 签名 */
@Excel(name = "签名")
private String signature;
/** 短信内容 */
@Excel(name = "短信内容")
private String content;
/** 短信类型:1-验证码 */
@Excel(name = "短信类型:1-验证码")
private String smsType;
/** 结果:1-成功,2-失败 */
@Excel(name = "结果:1-成功,2-失败")
private Long result;
/** 返回内容 */
@Excel(name = "返回内容")
private String resultParam;
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("phone", getPhone())
.append("templateId", getTemplateId())
.append("signature", getSignature())
.append("content", getContent())
.append("smsType", getSmsType())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("result", getResult())
.append("resultParam", getResultParam())
.toString();
}
}
package share.system.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import share.system.domain.Protocol;
/**
* 小程序协议管理Mapper接口
*
* @author wuwenlong
* @date 2023-11-22
*/
public interface ProtocolMapper extends BaseMapper<Protocol>
{
/**
* 查询小程序协议管理
*
* @param id 小程序协议管理主键
* @return 小程序协议管理
*/
public Protocol selectProtocolById(Long id);
/**
* 查询小程序协议管理列表
*
* @param protocol 小程序协议管理
* @return 小程序协议管理集合
*/
public List<Protocol> selectProtocolList(Protocol protocol);
/**
* 新增小程序协议管理
*
* @param protocol 小程序协议管理
* @return 结果
*/
public int insertProtocol(Protocol protocol);
/**
* 修改小程序协议管理
*
* @param protocol 小程序协议管理
* @return 结果
*/
public int updateProtocol(Protocol protocol);
/**
* 删除小程序协议管理
*
* @param id 小程序协议管理主键
* @return 结果
*/
public int deleteProtocolById(Long id);
/**
* 批量删除小程序协议管理
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteProtocolByIds(Long[] ids);
}
package share.system.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import share.system.domain.SmsLog;
/**
* 短信日志Mapper接口
*
* @author wuwenlong
* @date 2023-11-22
*/
public interface SmsLogMapper extends BaseMapper<SmsLog>
{
/**
* 查询短信日志
*
* @param id 短信日志主键
* @return 短信日志
*/
public SmsLog selectSmsLogById(Long id);
/**
* 查询短信日志列表
*
* @param smsLog 短信日志
* @return 短信日志集合
*/
public List<SmsLog> selectSmsLogList(SmsLog smsLog);
/**
* 新增短信日志
*
* @param smsLog 短信日志
* @return 结果
*/
public int insertSmsLog(SmsLog smsLog);
/**
* 修改短信日志
*
* @param smsLog 短信日志
* @return 结果
*/
public int updateSmsLog(SmsLog smsLog);
/**
* 删除短信日志
*
* @param id 短信日志主键
* @return 结果
*/
public int deleteSmsLogById(Long id);
/**
* 批量删除短信日志
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteSmsLogByIds(Long[] ids);
}
package share.system.service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import share.system.domain.Protocol;
/**
* 小程序协议管理Service接口
*
* @author wuwenlong
* @date 2023-11-22
*/
public interface ProtocolService extends IService<Protocol>
{
/**
* 查询小程序协议管理
*
* @param id 小程序协议管理主键
* @return 小程序协议管理
*/
public Protocol selectProtocolById(Long id);
/**
* 查询小程序协议管理列表
*
* @param protocol 小程序协议管理
* @return 小程序协议管理集合
*/
public List<Protocol> selectProtocolList(Protocol protocol);
/**
* 新增小程序协议管理
*
* @param protocol 小程序协议管理
* @return 结果
*/
public int insertProtocol(Protocol protocol);
/**
* 修改小程序协议管理
*
* @param protocol 小程序协议管理
* @return 结果
*/
public int updateProtocol(Protocol protocol);
/**
* 批量删除小程序协议管理
*
* @param ids 需要删除的小程序协议管理主键集合
* @return 结果
*/
public int deleteProtocolByIds(Long[] ids);
/**
* 删除小程序协议管理信息
*
* @param id 小程序协议管理主键
* @return 结果
*/
public int deleteProtocolById(Long id);
/**
* 查询小程序协议管理
*
* @param key 小程序协议管理主键
* @return 小程序协议管理
*/
public Protocol selectProtocolByKey(String key);
}
package share.system.service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import share.system.domain.SmsLog;
/**
* 短信日志Service接口
*
* @author wuwenlong
* @date 2023-11-22
*/
public interface SmsLogService extends IService<SmsLog>
{
/**
* 查询短信日志
*
* @param id 短信日志主键
* @return 短信日志
*/
public SmsLog selectSmsLogById(Long id);
/**
* 查询短信日志列表
*
* @param smsLog 短信日志
* @return 短信日志集合
*/
public List<SmsLog> selectSmsLogList(SmsLog smsLog);
/**
* 新增短信日志
*
* @param smsLog 短信日志
* @return 结果
*/
public int insertSmsLog(SmsLog smsLog);
/**
* 修改短信日志
*
* @param smsLog 短信日志
* @return 结果
*/
public int updateSmsLog(SmsLog smsLog);
/**
* 批量删除短信日志
*
* @param ids 需要删除的短信日志主键集合
* @return 结果
*/
public int deleteSmsLogByIds(Long[] ids);
/**
* 删除短信日志信息
*
* @param id 短信日志主键
* @return 结果
*/
public int deleteSmsLogById(Long id);
}
package share.system.service.impl;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import share.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import share.system.domain.SPack;
import share.system.mapper.ProtocolMapper;
import share.system.domain.Protocol;
import share.system.service.ProtocolService;
/**
* 小程序协议管理Service业务层处理
*
* @author wuwenlong
* @date 2023-11-22
*/
@Service
public class ProtocolServiceImpl extends ServiceImpl<ProtocolMapper, Protocol> implements ProtocolService
{
@Autowired
private ProtocolMapper protocolMapper;
/**
* 查询小程序协议管理
*
* @param id 小程序协议管理主键
* @return 小程序协议管理
*/
@Override
public Protocol selectProtocolById(Long id)
{
return protocolMapper.selectProtocolById(id);
}
/**
* 查询小程序协议管理列表
*
* @param protocol 小程序协议管理
* @return 小程序协议管理
*/
@Override
public List<Protocol> selectProtocolList(Protocol protocol)
{
return protocolMapper.selectProtocolList(protocol);
}
/**
* 新增小程序协议管理
*
* @param protocol 小程序协议管理
* @return 结果
*/
@Override
public int insertProtocol(Protocol protocol)
{
protocol.setCreateTime(DateUtils.getNowDate());
return protocolMapper.insertProtocol(protocol);
}
/**
* 修改小程序协议管理
*
* @param protocol 小程序协议管理
* @return 结果
*/
@Override
public int updateProtocol(Protocol protocol)
{
protocol.setUpdateTime(DateUtils.getNowDate());
return protocolMapper.updateProtocol(protocol);
}
/**
* 批量删除小程序协议管理
*
* @param ids 需要删除的小程序协议管理主键
* @return 结果
*/
@Override
public int deleteProtocolByIds(Long[] ids)
{
return protocolMapper.deleteProtocolByIds(ids);
}
/**
* 删除小程序协议管理信息
*
* @param id 小程序协议管理主键
* @return 结果
*/
@Override
public int deleteProtocolById(Long id)
{
return protocolMapper.deleteProtocolById(id);
}
@Override
public Protocol selectProtocolByKey(String key) {
LambdaQueryWrapper<Protocol> queryWrapper = new LambdaQueryWrapper();
queryWrapper.eq(Protocol::getProtocolKey, key);
return protocolMapper.selectOne(queryWrapper);
}
}
......@@ -345,7 +345,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
sOrder.setPayPrice(request.getPayFee());
sOrder.setBuyType(request.getBuyType());
//设置订单号
sOrder.setOrderNo(BaseUtil.getOrderNo(PayTypeEnum.getEnumByCode(request.getPayType()).getValue()));
// sOrder.setOrderNo(BaseUtil.getOrderNo(PayTypeEnum.getEnumByCode(request.getPayType()).getValue()));
sOrder.setOrderNo(BaseUtil.getOrderNo("CJ"));
sOrder.setConsumerId(user.getId());
sOrder.setConsumerPhone(user.getPhone());
sOrder.setConsumerName(user.getNickName());
......
package share.system.service.impl;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import share.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import share.system.mapper.SmsLogMapper;
import share.system.domain.SmsLog;
import share.system.service.SmsLogService;
/**
* 短信日志Service业务层处理
*
* @author wuwenlong
* @date 2023-11-22
*/
@Service
public class SmsLogServiceImpl extends ServiceImpl<SmsLogMapper, SmsLog> implements SmsLogService
{
@Autowired
private SmsLogMapper smsLogMapper;
/**
* 查询短信日志
*
* @param id 短信日志主键
* @return 短信日志
*/
@Override
public SmsLog selectSmsLogById(Long id)
{
return smsLogMapper.selectSmsLogById(id);
}
/**
* 查询短信日志列表
*
* @param smsLog 短信日志
* @return 短信日志
*/
@Override
public List<SmsLog> selectSmsLogList(SmsLog smsLog)
{
return smsLogMapper.selectSmsLogList(smsLog);
}
/**
* 新增短信日志
*
* @param smsLog 短信日志
* @return 结果
*/
@Override
public int insertSmsLog(SmsLog smsLog)
{
smsLog.setCreateTime(DateUtils.getNowDate());
return smsLogMapper.insertSmsLog(smsLog);
}
/**
* 修改短信日志
*
* @param smsLog 短信日志
* @return 结果
*/
@Override
public int updateSmsLog(SmsLog smsLog)
{
smsLog.setUpdateTime(DateUtils.getNowDate());
return smsLogMapper.updateSmsLog(smsLog);
}
/**
* 批量删除短信日志
*
* @param ids 需要删除的短信日志主键
* @return 结果
*/
@Override
public int deleteSmsLogByIds(Long[] ids)
{
return smsLogMapper.deleteSmsLogByIds(ids);
}
/**
* 删除短信日志信息
*
* @param id 短信日志主键
* @return 结果
*/
@Override
public int deleteSmsLogById(Long id)
{
return smsLogMapper.deleteSmsLogById(id);
}
}
<?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="share.system.mapper.ProtocolMapper">
<resultMap type="Protocol" id="ProtocolResult">
<result property="id" column="id" />
<result property="protocolTitle" column="protocol_title" />
<result property="protocolKey" column="protocol_key" />
<result property="content" column="content" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectProtocolVo">
select id, protocol_title, protocol_key, content, status, create_by, create_time, update_by, update_time, remark from s_protocol
</sql>
<select id="selectProtocolList" parameterType="Protocol" resultMap="ProtocolResult">
<include refid="selectProtocolVo"/>
<where>
<if test="protocolTitle != null and protocolTitle != ''"> and protocol_title = #{protocolTitle}</if>
<if test="protocolKey != null and protocolKey != ''"> and protocol_key = #{protocolKey}</if>
<if test="content != null and content != ''"> and content = #{content}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
</where>
</select>
<select id="selectProtocolById" parameterType="Long" resultMap="ProtocolResult">
<include refid="selectProtocolVo"/>
where id = #{id}
</select>
<insert id="insertProtocol" parameterType="Protocol" useGeneratedKeys="true" keyProperty="id">
insert into s_protocol
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="protocolTitle != null and protocolTitle != ''">protocol_title,</if>
<if test="protocolKey != null and protocolKey != ''">protocol_key,</if>
<if test="content != null">content,</if>
<if test="status != null">status,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="protocolTitle != null and protocolTitle != ''">#{protocolTitle},</if>
<if test="protocolKey != null and protocolKey != ''">#{protocolKey},</if>
<if test="content != null">#{content},</if>
<if test="status != null">#{status},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateProtocol" parameterType="Protocol">
update s_protocol
<trim prefix="SET" suffixOverrides=",">
<if test="protocolTitle != null and protocolTitle != ''">protocol_title = #{protocolTitle},</if>
<if test="protocolKey != null and protocolKey != ''">protocol_key = #{protocolKey},</if>
<if test="content != null">content = #{content},</if>
<if test="status != null">status = #{status},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteProtocolById" parameterType="Long">
delete from s_protocol where id = #{id}
</delete>
<delete id="deleteProtocolByIds" parameterType="String">
delete from s_protocol where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
<?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="share.system.mapper.SmsLogMapper">
<resultMap type="SmsLog" id="SmsLogResult">
<result property="id" column="id" />
<result property="phone" column="phone" />
<result property="templateId" column="template_id" />
<result property="signature" column="signature" />
<result property="content" column="content" />
<result property="smsType" column="sms_type" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="result" column="result" />
<result property="resultParam" column="result_param" />
</resultMap>
<sql id="selectSmsLogVo">
select id, phone, template_id, signature, content, sms_type, create_by, create_time, update_by, update_time, remark, result, result_param from s_sms_log
</sql>
<select id="selectSmsLogList" parameterType="SmsLog" resultMap="SmsLogResult">
<include refid="selectSmsLogVo"/>
<where>
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
<if test="templateId != null and templateId != ''"> and template_id = #{templateId}</if>
<if test="signature != null and signature != ''"> and signature = #{signature}</if>
<if test="content != null and content != ''"> and content = #{content}</if>
<if test="smsType != null and smsType != ''"> and sms_type = #{smsType}</if>
<if test="result != null "> and result = #{result}</if>
<if test="resultParam != null and resultParam != ''"> and result_param = #{resultParam}</if>
</where>
</select>
<select id="selectSmsLogById" parameterType="Long" resultMap="SmsLogResult">
<include refid="selectSmsLogVo"/>
where id = #{id}
</select>
<insert id="insertSmsLog" parameterType="SmsLog" useGeneratedKeys="true" keyProperty="id">
insert into s_sms_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="phone != null">phone,</if>
<if test="templateId != null">template_id,</if>
<if test="signature != null">signature,</if>
<if test="content != null">content,</if>
<if test="smsType != null">sms_type,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="result != null">result,</if>
<if test="resultParam != null">result_param,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="phone != null">#{phone},</if>
<if test="templateId != null">#{templateId},</if>
<if test="signature != null">#{signature},</if>
<if test="content != null">#{content},</if>
<if test="smsType != null">#{smsType},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="result != null">#{result},</if>
<if test="resultParam != null">#{resultParam},</if>
</trim>
</insert>
<update id="updateSmsLog" parameterType="SmsLog">
update s_sms_log
<trim prefix="SET" suffixOverrides=",">
<if test="phone != null">phone = #{phone},</if>
<if test="templateId != null">template_id = #{templateId},</if>
<if test="signature != null">signature = #{signature},</if>
<if test="content != null">content = #{content},</if>
<if test="smsType != null">sms_type = #{smsType},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="result != null">result = #{result},</if>
<if test="resultParam != null">result_param = #{resultParam},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSmsLogById" parameterType="Long">
delete from s_sms_log where id = #{id}
</delete>
<delete id="deleteSmsLogByIds" parameterType="String">
delete from s_sms_log where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
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