update
This commit is contained in:
@@ -1,46 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>3.8.8</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>ruoyi-abuwx</artifactId>
|
||||
|
||||
<description>微信小程序</description>
|
||||
|
||||
<dependencies>
|
||||
<!-- 通用工具 -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common</artifactId>
|
||||
</dependency>
|
||||
<!-- 通用工具 -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-system</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-framework</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.8.31</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
@@ -1,104 +0,0 @@
|
||||
package com.ruoyi.abuwx.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.abuwx.domain.AbucoderWxuser;
|
||||
import com.ruoyi.abuwx.service.IAbucoderWxuserService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 微信用户Controller
|
||||
*
|
||||
* @author 阿卜Coder QQ932696181
|
||||
* @date 2022-06-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/abuwx/wxuser")
|
||||
public class AbucoderWxuserController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IAbucoderWxuserService abucoderWxuserService;
|
||||
|
||||
/**
|
||||
* 查询微信用户列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('abuwx:wxuser:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(AbucoderWxuser abucoderWxuser)
|
||||
{
|
||||
startPage();
|
||||
List<AbucoderWxuser> list = abucoderWxuserService.selectAbucoderWxuserList(abucoderWxuser);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出微信用户列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('abuwx:wxuser:export')")
|
||||
@Log(title = "微信用户", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, AbucoderWxuser abucoderWxuser)
|
||||
{
|
||||
List<AbucoderWxuser> list = abucoderWxuserService.selectAbucoderWxuserList(abucoderWxuser);
|
||||
ExcelUtil<AbucoderWxuser> util = new ExcelUtil<AbucoderWxuser>(AbucoderWxuser.class);
|
||||
util.exportExcel(response, list, "微信用户数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取微信用户详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('abuwx:wxuser:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(abucoderWxuserService.selectAbucoderWxuserById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增微信用户
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('abuwx:wxuser:add')")
|
||||
@Log(title = "微信用户", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody AbucoderWxuser abucoderWxuser)
|
||||
{
|
||||
return toAjax(abucoderWxuserService.insertAbucoderWxuser(abucoderWxuser));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改微信用户
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('abuwx:wxuser:edit')")
|
||||
@Log(title = "微信用户", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody AbucoderWxuser abucoderWxuser)
|
||||
{
|
||||
return toAjax(abucoderWxuserService.updateAbucoderWxuser(abucoderWxuser));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除微信用户
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('abuwx:wxuser:remove')")
|
||||
@Log(title = "微信用户", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(abucoderWxuserService.deleteAbucoderWxuserByIds(ids));
|
||||
}
|
||||
}
|
@@ -1,30 +0,0 @@
|
||||
package com.ruoyi.abuwx.domain;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AbucoderWxuser extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** ID */
|
||||
private Long id;
|
||||
|
||||
/** 微信名称 */
|
||||
@Excel(name = "微信名称")
|
||||
private String nickname;
|
||||
|
||||
/** 头像 */
|
||||
@Excel(name = "头像")
|
||||
private String avatar;
|
||||
|
||||
/** OpenID */
|
||||
@Excel(name = "OpenID")
|
||||
private String openid;
|
||||
|
||||
/** 性别 */
|
||||
@Excel(name = "性别")
|
||||
private Integer gender;
|
||||
}
|
@@ -1,68 +0,0 @@
|
||||
package com.ruoyi.abuwx.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.abuwx.domain.AbucoderWxuser;
|
||||
|
||||
/**
|
||||
* 微信用户Mapper接口
|
||||
*
|
||||
* @author 阿卜Coder QQ932696181
|
||||
* @date 2022-06-26
|
||||
*/
|
||||
public interface AbucoderWxuserMapper
|
||||
{
|
||||
/**
|
||||
* 查询微信用户
|
||||
*
|
||||
* @param id 微信用户主键
|
||||
* @return 微信用户
|
||||
*/
|
||||
public AbucoderWxuser selectAbucoderWxuserById(Long id);
|
||||
|
||||
/**
|
||||
* 查询微信用户列表
|
||||
*
|
||||
* @param abucoderWxuser 微信用户
|
||||
* @return 微信用户集合
|
||||
*/
|
||||
public List<AbucoderWxuser> selectAbucoderWxuserList(AbucoderWxuser abucoderWxuser);
|
||||
|
||||
/**
|
||||
* 新增微信用户
|
||||
*
|
||||
* @param abucoderWxuser 微信用户
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAbucoderWxuser(AbucoderWxuser abucoderWxuser);
|
||||
|
||||
/**
|
||||
* 修改微信用户
|
||||
*
|
||||
* @param abucoderWxuser 微信用户
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAbucoderWxuser(AbucoderWxuser abucoderWxuser);
|
||||
|
||||
/**
|
||||
* 删除微信用户
|
||||
*
|
||||
* @param id 微信用户主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAbucoderWxuserById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除微信用户
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAbucoderWxuserByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 通过OpenID查询微信用户信息
|
||||
* @param openid
|
||||
* @return
|
||||
*/
|
||||
public AbucoderWxuser selectAbucoderWxuserOpenID(String openid);
|
||||
}
|
@@ -1,68 +0,0 @@
|
||||
package com.ruoyi.abuwx.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.abuwx.domain.AbucoderWxuser;
|
||||
|
||||
/**
|
||||
* 微信用户Service接口
|
||||
*
|
||||
* @author 阿卜Coder QQ932696181
|
||||
* @date 2022-06-26
|
||||
*/
|
||||
public interface IAbucoderWxuserService
|
||||
{
|
||||
/**
|
||||
* 查询微信用户
|
||||
*
|
||||
* @param id 微信用户主键
|
||||
* @return 微信用户
|
||||
*/
|
||||
public AbucoderWxuser selectAbucoderWxuserById(Long id);
|
||||
|
||||
/**
|
||||
* 查询微信用户列表
|
||||
*
|
||||
* @param abucoderWxuser 微信用户
|
||||
* @return 微信用户集合
|
||||
*/
|
||||
public List<AbucoderWxuser> selectAbucoderWxuserList(AbucoderWxuser abucoderWxuser);
|
||||
|
||||
/**
|
||||
* 新增微信用户
|
||||
*
|
||||
* @param abucoderWxuser 微信用户
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAbucoderWxuser(AbucoderWxuser abucoderWxuser);
|
||||
|
||||
/**
|
||||
* 修改微信用户
|
||||
*
|
||||
* @param abucoderWxuser 微信用户
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAbucoderWxuser(AbucoderWxuser abucoderWxuser);
|
||||
|
||||
/**
|
||||
* 批量删除微信用户
|
||||
*
|
||||
* @param ids 需要删除的微信用户主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAbucoderWxuserByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除微信用户信息
|
||||
*
|
||||
* @param id 微信用户主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAbucoderWxuserById(Long id);
|
||||
|
||||
/**
|
||||
* 通过OpenID查询微信用户信息
|
||||
* @param openid
|
||||
* @return
|
||||
*/
|
||||
public AbucoderWxuser selectAbucoderWxuserOpenID(String openid);
|
||||
}
|
@@ -1,106 +0,0 @@
|
||||
package com.ruoyi.abuwx.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.abuwx.mapper.AbucoderWxuserMapper;
|
||||
import com.ruoyi.abuwx.domain.AbucoderWxuser;
|
||||
import com.ruoyi.abuwx.service.IAbucoderWxuserService;
|
||||
|
||||
/**
|
||||
* 微信用户Service业务层处理
|
||||
*
|
||||
* @author 阿卜Coder QQ932696181
|
||||
* @date 2022-06-26
|
||||
*/
|
||||
@Service
|
||||
public class AbucoderWxuserServiceImpl implements IAbucoderWxuserService
|
||||
{
|
||||
@Autowired
|
||||
private AbucoderWxuserMapper abucoderWxuserMapper;
|
||||
|
||||
/**
|
||||
* 查询微信用户
|
||||
*
|
||||
* @param id 微信用户主键
|
||||
* @return 微信用户
|
||||
*/
|
||||
@Override
|
||||
public AbucoderWxuser selectAbucoderWxuserById(Long id)
|
||||
{
|
||||
return abucoderWxuserMapper.selectAbucoderWxuserById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询微信用户列表
|
||||
*
|
||||
* @param abucoderWxuser 微信用户
|
||||
* @return 微信用户
|
||||
*/
|
||||
@Override
|
||||
public List<AbucoderWxuser> selectAbucoderWxuserList(AbucoderWxuser abucoderWxuser)
|
||||
{
|
||||
return abucoderWxuserMapper.selectAbucoderWxuserList(abucoderWxuser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增微信用户
|
||||
*
|
||||
* @param abucoderWxuser 微信用户
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertAbucoderWxuser(AbucoderWxuser abucoderWxuser)
|
||||
{
|
||||
abucoderWxuser.setCreateTime(DateUtils.getNowDate());
|
||||
return abucoderWxuserMapper.insertAbucoderWxuser(abucoderWxuser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改微信用户
|
||||
*
|
||||
* @param abucoderWxuser 微信用户
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateAbucoderWxuser(AbucoderWxuser abucoderWxuser)
|
||||
{
|
||||
abucoderWxuser.setUpdateTime(DateUtils.getNowDate());
|
||||
return abucoderWxuserMapper.updateAbucoderWxuser(abucoderWxuser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除微信用户
|
||||
*
|
||||
* @param ids 需要删除的微信用户主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAbucoderWxuserByIds(Long[] ids)
|
||||
{
|
||||
return abucoderWxuserMapper.deleteAbucoderWxuserByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除微信用户信息
|
||||
*
|
||||
* @param id 微信用户主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAbucoderWxuserById(Long id)
|
||||
{
|
||||
return abucoderWxuserMapper.deleteAbucoderWxuserById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过OpenID查询微信用户信息
|
||||
* @param openid
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AbucoderWxuser selectAbucoderWxuserOpenID(String openid) {
|
||||
return abucoderWxuserMapper.selectAbucoderWxuserOpenID(openid);
|
||||
}
|
||||
}
|
@@ -1,129 +0,0 @@
|
||||
package com.ruoyi.abuwxapi;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.ruoyi.abuwx.domain.AbucoderWxuser;
|
||||
import com.ruoyi.abuwx.service.IAbucoderWxuserService;
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||
import com.ruoyi.common.utils.file.FileUtils;
|
||||
import com.ruoyi.common.utils.http.HttpUtils;
|
||||
import com.ruoyi.framework.config.ServerConfig;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/wxapi/")
|
||||
public class WxLoginController {
|
||||
private static final Logger log = LoggerFactory.getLogger(WxLoginController.class);
|
||||
@Autowired
|
||||
private IAbucoderWxuserService iAbucoderWxuserService;
|
||||
|
||||
@Autowired
|
||||
private ServerConfig serverConfig;
|
||||
|
||||
/**
|
||||
* 你自己的微信小程序APPID
|
||||
*/
|
||||
|
||||
private final static String AppID = "你自己的微信小程序APPID";
|
||||
/**
|
||||
* 你自己的微信APP密钥
|
||||
*/
|
||||
private final static String AppSecret = "你自己的微信APP密钥";
|
||||
|
||||
/**
|
||||
* 登录时获取的 code(微信官方提供的临时凭证)
|
||||
* @param object
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/wxlogin")
|
||||
public AjaxResult wxLogin(@RequestBody JSONObject object){
|
||||
//微信官方提供的微信小程序登录授权时使用的URL地址
|
||||
String url = "https://api.weixin.qq.com/sns/jscode2session";
|
||||
log.info("微信登录,传入参数:"+object);
|
||||
/**
|
||||
* 拼接需要的参数
|
||||
* appid = AppID 你自己的微信小程序APPID
|
||||
* js_code = AppSecret 你自己的微信APP密钥
|
||||
* grant_type=authorization_code = code 微信官方提供的临时凭证
|
||||
*/
|
||||
String params = StrUtil.format("appid={}&secret={}&js_code={}&grant_type=authorization_code", AppID, AppSecret, object.get("code"));
|
||||
//开始发起网络请求,若依管理系统自带网络请求工具,直接使用即可
|
||||
String res = HttpUtils.sendGet(url,params);
|
||||
JSONObject jsonObject = JSON.parseObject(res);
|
||||
String openid = (String) jsonObject.get("openid");
|
||||
if (StrUtil.isEmpty(openid)) {
|
||||
return AjaxResult.error("未获取到openid");
|
||||
}
|
||||
/**先通过openid来查询是否存在*/
|
||||
AbucoderWxuser abucoderWxuser = iAbucoderWxuserService.selectAbucoderWxuserOpenID(openid);
|
||||
if (abucoderWxuser == null){
|
||||
/**如果不存在就插入到我们的数据库里*/
|
||||
AbucoderWxuser wxuser = new AbucoderWxuser();
|
||||
wxuser.setOpenid(openid);
|
||||
wxuser.setCreateTime(DateUtils.getNowDate());
|
||||
iAbucoderWxuserService.insertAbucoderWxuser(wxuser);
|
||||
/**返回结果集到前段*/
|
||||
return AjaxResult.success(wxuser);
|
||||
}else {
|
||||
/**返回结果集到前段*/
|
||||
return AjaxResult.success(abucoderWxuser);
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/upload")
|
||||
@ResponseBody
|
||||
public AjaxResult uploadFile(MultipartFile file) throws Exception
|
||||
{
|
||||
System.out.println(file);
|
||||
try
|
||||
{
|
||||
// 上传文件路径
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
// 上传并返回新文件名称
|
||||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
String url = serverConfig.getUrl() + fileName;
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("url", url);
|
||||
ajax.put("fileName", fileName);
|
||||
ajax.put("newFileName", FileUtils.getName(fileName));
|
||||
ajax.put("originalFilename", file.getOriginalFilename());
|
||||
return ajax;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存昵称与头像信息到用户信息里
|
||||
* @param object
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/saveUserInfo")
|
||||
@ResponseBody
|
||||
public AjaxResult saveUserInfo(@RequestBody JSONObject object){
|
||||
System.out.println(object);
|
||||
AbucoderWxuser abucoderWxuser = iAbucoderWxuserService.selectAbucoderWxuserOpenID(String.valueOf(object.get("openid")));
|
||||
if (StringUtils.hasLength(String.valueOf(object.get("nickName")))){
|
||||
abucoderWxuser.setNickname(String.valueOf(object.get("nickName")));
|
||||
abucoderWxuser.setCreateBy(String.valueOf(object.get("nickName")));
|
||||
}
|
||||
if (StringUtils.hasLength(String.valueOf(object.get("avatarUrl")))){
|
||||
abucoderWxuser.setAvatar(String.valueOf(object.get("avatarUrl")));
|
||||
}
|
||||
abucoderWxuser.setUpdateTime(DateUtils.getNowDate());
|
||||
iAbucoderWxuserService.updateAbucoderWxuser(abucoderWxuser);
|
||||
//返回前段需要的数据
|
||||
return AjaxResult.success(abucoderWxuser);
|
||||
}
|
||||
|
||||
}
|
@@ -1,83 +0,0 @@
|
||||
<?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.abuwx.mapper.AbucoderBannersMapper">
|
||||
|
||||
<resultMap type="AbucoderBanners" id="AbucoderBannersResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="bannerTitle" column="banner_title" />
|
||||
<result property="bannerUrl" column="banner_url" />
|
||||
<result property="bannerImg" column="banner_img" />
|
||||
<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="selectAbucoderBannersVo">
|
||||
select id, banner_title, banner_url, banner_img, create_by, create_time, update_by, update_time, remark from abucoder_banners
|
||||
</sql>
|
||||
|
||||
<select id="selectAbucoderBannersList" parameterType="AbucoderBanners" resultMap="AbucoderBannersResult">
|
||||
<include refid="selectAbucoderBannersVo"/>
|
||||
<where>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAbucoderBannersById" parameterType="Long" resultMap="AbucoderBannersResult">
|
||||
<include refid="selectAbucoderBannersVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAbucoderBanners" parameterType="AbucoderBanners" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into abucoder_banners
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="bannerTitle != null">banner_title,</if>
|
||||
<if test="bannerUrl != null">banner_url,</if>
|
||||
<if test="bannerImg != null">banner_img,</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="bannerTitle != null">#{bannerTitle},</if>
|
||||
<if test="bannerUrl != null">#{bannerUrl},</if>
|
||||
<if test="bannerImg != null">#{bannerImg},</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="updateAbucoderBanners" parameterType="AbucoderBanners">
|
||||
update abucoder_banners
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="bannerTitle != null">banner_title = #{bannerTitle},</if>
|
||||
<if test="bannerUrl != null">banner_url = #{bannerUrl},</if>
|
||||
<if test="bannerImg != null">banner_img = #{bannerImg},</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="deleteAbucoderBannersById" parameterType="Long">
|
||||
delete from abucoder_banners where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAbucoderBannersByIds" parameterType="String">
|
||||
delete from abucoder_banners where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@@ -1,84 +0,0 @@
|
||||
<?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.abuwx.mapper.AbucoderItemsMapper">
|
||||
|
||||
<resultMap type="AbucoderItems" id="AbucoderItemsResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="itemName" column="item_name" />
|
||||
<result property="itemDesc" column="item_desc" />
|
||||
<result property="itemContent" column="item_content" />
|
||||
<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="selectAbucoderItemsVo">
|
||||
select id, item_name, item_desc, item_content, create_by, create_time, update_by, update_time, remark from abucoder_items
|
||||
</sql>
|
||||
|
||||
<select id="selectAbucoderItemsList" parameterType="AbucoderItems" resultMap="AbucoderItemsResult">
|
||||
<include refid="selectAbucoderItemsVo"/>
|
||||
<where>
|
||||
<if test="itemName != null and itemName != ''"> and item_name like concat('%', #{itemName}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAbucoderItemsById" parameterType="Long" resultMap="AbucoderItemsResult">
|
||||
<include refid="selectAbucoderItemsVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAbucoderItems" parameterType="AbucoderItems" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into abucoder_items
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="itemName != null">item_name,</if>
|
||||
<if test="itemDesc != null">item_desc,</if>
|
||||
<if test="itemContent != null">item_content,</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="itemName != null">#{itemName},</if>
|
||||
<if test="itemDesc != null">#{itemDesc},</if>
|
||||
<if test="itemContent != null">#{itemContent},</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="updateAbucoderItems" parameterType="AbucoderItems">
|
||||
update abucoder_items
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="itemName != null">item_name = #{itemName},</if>
|
||||
<if test="itemDesc != null">item_desc = #{itemDesc},</if>
|
||||
<if test="itemContent != null">item_content = #{itemContent},</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="deleteAbucoderItemsById" parameterType="Long">
|
||||
delete from abucoder_items where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAbucoderItemsByIds" parameterType="String">
|
||||
delete from abucoder_items where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@@ -1,88 +0,0 @@
|
||||
<?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.abuwx.mapper.AbucoderProgramsMapper">
|
||||
|
||||
<resultMap type="AbucoderPrograms" id="AbucoderProgramsResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="programName" column="program_name" />
|
||||
<result property="programTag" column="program_tag" />
|
||||
<result property="programImg" column="program_img" />
|
||||
<result property="programContent" column="program_content" />
|
||||
<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="selectAbucoderProgramsVo">
|
||||
select id, program_name, program_tag, program_img, program_content, create_by, create_time, update_by, update_time, remark from abucoder_programs
|
||||
</sql>
|
||||
|
||||
<select id="selectAbucoderProgramsList" parameterType="AbucoderPrograms" resultMap="AbucoderProgramsResult">
|
||||
<include refid="selectAbucoderProgramsVo"/>
|
||||
<where>
|
||||
<if test="programName != null and programName != ''"> and program_name like concat('%', #{programName}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAbucoderProgramsById" parameterType="Long" resultMap="AbucoderProgramsResult">
|
||||
<include refid="selectAbucoderProgramsVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAbucoderPrograms" parameterType="AbucoderPrograms" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into abucoder_programs
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="programName != null">program_name,</if>
|
||||
<if test="programTag != null">program_tag,</if>
|
||||
<if test="programImg != null">program_img,</if>
|
||||
<if test="programContent != null">program_content,</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="programName != null">#{programName},</if>
|
||||
<if test="programTag != null">#{programTag},</if>
|
||||
<if test="programImg != null">#{programImg},</if>
|
||||
<if test="programContent != null">#{programContent},</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="updateAbucoderPrograms" parameterType="AbucoderPrograms">
|
||||
update abucoder_programs
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="programName != null">program_name = #{programName},</if>
|
||||
<if test="programTag != null">program_tag = #{programTag},</if>
|
||||
<if test="programImg != null">program_img = #{programImg},</if>
|
||||
<if test="programContent != null">program_content = #{programContent},</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="deleteAbucoderProgramsById" parameterType="Long">
|
||||
delete from abucoder_programs where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAbucoderProgramsByIds" parameterType="String">
|
||||
delete from abucoder_programs where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@@ -1,90 +0,0 @@
|
||||
<?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.abuwx.mapper.AbucoderWxappConfigMapper">
|
||||
|
||||
<resultMap type="AbucoderWxappConfig" id="AbucoderWxappConfigResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="appid" column="appid" />
|
||||
<result property="appSecret" column="app_secret" />
|
||||
<result property="state" column="state" />
|
||||
<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="selectAbucoderWxappConfigVo">
|
||||
select id, appid, app_secret, state, create_by, create_time, update_by, update_time, remark from abucoder_wxapp_config
|
||||
</sql>
|
||||
|
||||
<select id="selectAbucoderWxappConfigList" parameterType="AbucoderWxappConfig" resultMap="AbucoderWxappConfigResult">
|
||||
<include refid="selectAbucoderWxappConfigVo"/>
|
||||
<where>
|
||||
<if test="appid != null and appid != ''"> and appid = #{appid}</if>
|
||||
<if test="appSecret != null and appSecret != ''"> and app_secret = #{appSecret}</if>
|
||||
<if test="state != null "> and state = #{state}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAbucoderWxappConfigById" parameterType="Long" resultMap="AbucoderWxappConfigResult">
|
||||
<include refid="selectAbucoderWxappConfigVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="selectAbucoderWxappConfig" resultMap="AbucoderWxappConfigResult">
|
||||
<include refid="selectAbucoderWxappConfigVo"/>
|
||||
where state = 0
|
||||
</select>
|
||||
|
||||
<insert id="insertAbucoderWxappConfig" parameterType="AbucoderWxappConfig" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into abucoder_wxapp_config
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="appid != null">appid,</if>
|
||||
<if test="appSecret != null">app_secret,</if>
|
||||
<if test="state != null">state,</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="appid != null">#{appid},</if>
|
||||
<if test="appSecret != null">#{appSecret},</if>
|
||||
<if test="state != null">#{state},</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="updateAbucoderWxappConfig" parameterType="AbucoderWxappConfig">
|
||||
update abucoder_wxapp_config
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="appid != null">appid = #{appid},</if>
|
||||
<if test="appSecret != null">app_secret = #{appSecret},</if>
|
||||
<if test="state != null">state = #{state},</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="deleteAbucoderWxappConfigById" parameterType="Long">
|
||||
delete from abucoder_wxapp_config where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAbucoderWxappConfigByIds" parameterType="String">
|
||||
delete from abucoder_wxapp_config where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@@ -1,93 +0,0 @@
|
||||
<?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.abuwx.mapper.AbucoderWxuserMapper">
|
||||
|
||||
<resultMap type="AbucoderWxuser" id="AbucoderWxuserResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="nickname" column="nickname" />
|
||||
<result property="avatar" column="avatar" />
|
||||
<result property="openid" column="openid" />
|
||||
<result property="gender" column="gender" />
|
||||
<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="selectAbucoderWxuserVo">
|
||||
select id, nickname, avatar, openid, gender, create_by, create_time, update_by, update_time, remark from abucoder_wxuser
|
||||
</sql>
|
||||
|
||||
<select id="selectAbucoderWxuserList" parameterType="AbucoderWxuser" resultMap="AbucoderWxuserResult">
|
||||
<include refid="selectAbucoderWxuserVo"/>
|
||||
<where>
|
||||
<if test="openid != null and openid != ''"> and openid = #{openid}</if>
|
||||
<if test="gender != null "> and gender = #{gender}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAbucoderWxuserById" parameterType="Long" resultMap="AbucoderWxuserResult">
|
||||
<include refid="selectAbucoderWxuserVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="selectAbucoderWxuserOpenID" resultMap="AbucoderWxuserResult">
|
||||
<include refid="selectAbucoderWxuserVo"/>
|
||||
where openid = #{openid}
|
||||
</select>
|
||||
|
||||
<insert id="insertAbucoderWxuser" parameterType="AbucoderWxuser" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into abucoder_wxuser
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="nickname != null">nickname,</if>
|
||||
<if test="avatar != null">avatar,</if>
|
||||
<if test="openid != null">openid,</if>
|
||||
<if test="gender != null">gender,</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="nickname != null">#{nickname},</if>
|
||||
<if test="avatar != null">#{avatar},</if>
|
||||
<if test="openid != null">#{openid},</if>
|
||||
<if test="gender != null">#{gender},</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="updateAbucoderWxuser" parameterType="AbucoderWxuser">
|
||||
update abucoder_wxuser
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="nickname != null">nickname = #{nickname},</if>
|
||||
<if test="avatar != null">avatar = #{avatar},</if>
|
||||
<if test="openid != null">openid = #{openid},</if>
|
||||
<if test="gender != null">gender = #{gender},</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="deleteAbucoderWxuserById" parameterType="Long">
|
||||
delete from abucoder_wxuser where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAbucoderWxuserByIds" parameterType="String">
|
||||
delete from abucoder_wxuser where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Reference in New Issue
Block a user