commit
869a5743b4
@ -1,27 +1,13 @@
|
|||||||
package com.stdiet.web.controller;
|
package com.stdiet.web.controller;
|
||||||
|
|
||||||
import com.stdiet.common.config.AliyunOSSConfig;
|
|
||||||
import com.stdiet.common.core.domain.AjaxResult;
|
|
||||||
import com.stdiet.common.core.domain.entity.SysUser;
|
|
||||||
import com.stdiet.common.utils.StringUtils;
|
import com.stdiet.common.utils.StringUtils;
|
||||||
import com.stdiet.common.utils.oss.AliyunOSSUtils;
|
|
||||||
import com.stdiet.common.utils.poi.ExcelUtil;
|
import com.stdiet.common.utils.poi.ExcelUtil;
|
||||||
import com.stdiet.custom.domain.SysNutritionQuestion;
|
import com.stdiet.custom.domain.SysNutritionQuestion;
|
||||||
import com.stdiet.custom.domain.SysNutritionalVideo;
|
import com.stdiet.custom.domain.SysNutritionalVideo;
|
||||||
import com.stdiet.custom.domain.SysWxUserInfo;
|
|
||||||
import com.stdiet.custom.domain.SysWxUserLog;
|
|
||||||
import com.stdiet.custom.mapper.SysCustomerPhysicalSignsMapper;
|
|
||||||
import com.stdiet.custom.mapper.SysNutritionQuestionMapper;
|
|
||||||
import com.stdiet.custom.mapper.SysWxUserInfoMapper;
|
import com.stdiet.custom.mapper.SysWxUserInfoMapper;
|
||||||
import com.stdiet.custom.mapper.SysWxUserLogMapper;
|
import com.stdiet.custom.mapper.SysWxUserLogMapper;
|
||||||
import com.stdiet.custom.service.ISysNutritionQuestionService;
|
import com.stdiet.custom.service.ISysNutritionQuestionService;
|
||||||
import com.stdiet.custom.service.ISysNutritionalVideoService;
|
import com.stdiet.custom.service.ISysNutritionalVideoService;
|
||||||
import com.stdiet.custom.service.ISysWxUserLogService;
|
|
||||||
import com.stdiet.custom.utils.LuceneIndexUtils;
|
|
||||||
import com.stdiet.framework.web.domain.server.Sys;
|
|
||||||
import org.apache.lucene.document.Document;
|
|
||||||
import org.apache.lucene.document.Field;
|
|
||||||
import org.apache.lucene.document.TextField;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.ApplicationArguments;
|
import org.springframework.boot.ApplicationArguments;
|
||||||
import org.springframework.boot.ApplicationRunner;
|
import org.springframework.boot.ApplicationRunner;
|
||||||
@ -37,11 +23,11 @@ import java.util.Map;
|
|||||||
@Order(value = 1)
|
@Order(value = 1)
|
||||||
public class MyApplicationRunner implements ApplicationRunner {
|
public class MyApplicationRunner implements ApplicationRunner {
|
||||||
|
|
||||||
@Autowired
|
// @Autowired
|
||||||
private SysWxUserLogMapper sysWxUserLogMapper;
|
// private SysWxUserLogMapper sysWxUserLogMapper;
|
||||||
|
|
||||||
@Autowired
|
// @Autowired
|
||||||
private SysWxUserInfoMapper sysWxUserInfoMapper;
|
// private SysWxUserInfoMapper sysWxUserInfoMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysNutritionQuestionService sysNutritionQuestionService;
|
private ISysNutritionQuestionService sysNutritionQuestionService;
|
||||||
@ -50,7 +36,6 @@ public class MyApplicationRunner implements ApplicationRunner {
|
|||||||
private ISysNutritionalVideoService sysNutritionalVideoService;
|
private ISysNutritionalVideoService sysNutritionalVideoService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(ApplicationArguments args) throws Exception {
|
public void run(ApplicationArguments args) throws Exception {
|
||||||
System.out.println("--------------项目启动调用方法开始----------");
|
System.out.println("--------------项目启动调用方法开始----------");
|
||||||
@ -59,7 +44,6 @@ public class MyApplicationRunner implements ApplicationRunner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 从微信用户表中查询openid更新到用户打卡日志表中
|
* 从微信用户表中查询openid更新到用户打卡日志表中
|
||||||
*/
|
*/
|
||||||
@ -83,6 +67,7 @@ public class MyApplicationRunner implements ApplicationRunner {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 导入营养小知识方法
|
* 导入营养小知识方法
|
||||||
|
*
|
||||||
* @param path
|
* @param path
|
||||||
*/
|
*/
|
||||||
public void importNutritionQuestion(String path) {
|
public void importNutritionQuestion(String path) {
|
||||||
@ -126,5 +111,4 @@ public class MyApplicationRunner implements ApplicationRunner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package com.stdiet.custom.controller;
|
package com.stdiet.web.controller.custom;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package com.stdiet.custom.controller;
|
package com.stdiet.web.controller.custom;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package com.stdiet.custom.controller;
|
package com.stdiet.web.controller.custom;
|
||||||
|
|
||||||
import java.time.temporal.ChronoUnit;
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -0,0 +1,26 @@
|
|||||||
|
package com.stdiet.web.controller.custom;
|
||||||
|
|
||||||
|
import com.stdiet.common.core.controller.BaseController;
|
||||||
|
import com.stdiet.common.core.domain.AjaxResult;
|
||||||
|
import com.stdiet.custom.domain.SysServicesQuestion;
|
||||||
|
import com.stdiet.custom.service.ISysServicesQuestionService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/services/question")
|
||||||
|
public class SysServiceQuestionController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysServicesQuestionService sysServicesQuestionService;
|
||||||
|
|
||||||
|
@PostMapping(value = "/list")
|
||||||
|
public AjaxResult list(@RequestBody SysServicesQuestion sysServicesQuestion) {
|
||||||
|
return AjaxResult.success(sysServicesQuestionService.selectSysServicesQuestionByUserIdAndRole(sysServicesQuestion));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping(value = "/updateStatus")
|
||||||
|
public AjaxResult reply(@RequestBody SysServicesQuestion sysServicesQuestion) {
|
||||||
|
return toAjax(sysServicesQuestionService.updateSysServicesQuestionStatus(sysServicesQuestion));
|
||||||
|
}
|
||||||
|
}
|
@ -68,6 +68,8 @@ public class WechatAppletController extends BaseController {
|
|||||||
private ISysDictTypeService iSysDictTypeService;
|
private ISysDictTypeService iSysDictTypeService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IWechatAppletService iWechatAppletService;
|
private IWechatAppletService iWechatAppletService;
|
||||||
|
@Autowired
|
||||||
|
private ISysServicesQuestionService iSysServicesQuestionService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询微信小程序中展示的客户案例
|
* 查询微信小程序中展示的客户案例
|
||||||
@ -571,9 +573,12 @@ public class WechatAppletController extends BaseController {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
@GetMapping("/trans")
|
@GetMapping("/trans")
|
||||||
public AjaxResult transId(@RequestParam String customerId) {
|
public AjaxResult transId(@RequestParam String customerId, @RequestParam Long cusId) {
|
||||||
Long cusId = StringUtils.isNotEmpty(customerId) ? Long.parseLong(AesUtils.decrypt(customerId)) : 0L;
|
if (StringUtils.isNotEmpty(customerId)) {
|
||||||
return AjaxResult.success(String.valueOf(cusId));
|
return AjaxResult.success(AesUtils.decrypt(customerId));
|
||||||
|
}
|
||||||
|
|
||||||
|
return AjaxResult.success(AesUtils.encrypt(String.valueOf(cusId)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/subscribe")
|
@GetMapping("/subscribe")
|
||||||
@ -587,6 +592,19 @@ public class WechatAppletController extends BaseController {
|
|||||||
return AjaxResult.success(sysRecipesPlanService.updateSysRecipesPlan(info));
|
return AjaxResult.success(sysRecipesPlanService.updateSysRecipesPlan(info));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/fetchServiceQuestion")
|
||||||
|
public AjaxResult fetchServiceQuestion(@RequestParam String customerId, @RequestParam Integer pageNum, @RequestParam Integer pageSize) {
|
||||||
|
startPage();
|
||||||
|
|
||||||
|
Long cusId = StringUtils.isNotEmpty(customerId) ? Long.parseLong(AesUtils.decrypt(customerId)) : 0L;
|
||||||
|
|
||||||
|
SysServicesQuestion servicesQuestion = new SysServicesQuestion();
|
||||||
|
servicesQuestion.setRole("customer");
|
||||||
|
servicesQuestion.setUserId(cusId);
|
||||||
|
|
||||||
|
return AjaxResult.success(iSysServicesQuestionService.selectSysServicesQuestionByUserIdAndRole(servicesQuestion));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,75 @@
|
|||||||
|
package com.stdiet.custom.domain;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SysServicesQuestion {
|
||||||
|
/**
|
||||||
|
* 问题状态id
|
||||||
|
*/
|
||||||
|
String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 问题id(搜索用)
|
||||||
|
*/
|
||||||
|
String queId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户id
|
||||||
|
*/
|
||||||
|
Long cusId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 问题内容
|
||||||
|
*/
|
||||||
|
String content;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图片地址
|
||||||
|
*/
|
||||||
|
JSONArray img;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 问题类型
|
||||||
|
*/
|
||||||
|
Integer type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0-未读 1-已读
|
||||||
|
*/
|
||||||
|
Integer read;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色
|
||||||
|
*/
|
||||||
|
String role;
|
||||||
|
|
||||||
|
// 非持久化字段
|
||||||
|
/**
|
||||||
|
* 角色名字
|
||||||
|
*/
|
||||||
|
String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色id
|
||||||
|
*/
|
||||||
|
Long userId;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package com.stdiet.custom.mapper;
|
||||||
|
|
||||||
|
import com.stdiet.custom.domain.SysServicesQuestion;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface SysServicesQuestionMapper {
|
||||||
|
List<SysServicesQuestion> selectSysServicesQuestionByUserIdAndRole(SysServicesQuestion servicesQuestion);
|
||||||
|
|
||||||
|
int insertSysServicesQuestion(SysServicesQuestion servicesQuestion);
|
||||||
|
|
||||||
|
int insertSysServicesQuestionStatus(List<SysServicesQuestion> sysServicesQuestion);
|
||||||
|
|
||||||
|
int updateSysServicesQuestionStatus(SysServicesQuestion sysServicesQuestion);
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package com.stdiet.custom.service;
|
||||||
|
|
||||||
|
import com.stdiet.custom.domain.SysServicesQuestion;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface ISysServicesQuestionService {
|
||||||
|
|
||||||
|
List<SysServicesQuestion> selectSysServicesQuestionByUserIdAndRole(SysServicesQuestion servicesQuestion);
|
||||||
|
|
||||||
|
int insertSysServicesQuestion(SysServicesQuestion servicesQuestion);
|
||||||
|
|
||||||
|
int updateSysServicesQuestionStatus(SysServicesQuestion sysServicesQuestion);
|
||||||
|
}
|
@ -0,0 +1,66 @@
|
|||||||
|
package com.stdiet.custom.service.impl;
|
||||||
|
|
||||||
|
import com.stdiet.custom.domain.SysCustomer;
|
||||||
|
import com.stdiet.custom.domain.SysServicesQuestion;
|
||||||
|
import com.stdiet.custom.mapper.SysCustomerMapper;
|
||||||
|
import com.stdiet.custom.mapper.SysServicesQuestionMapper;
|
||||||
|
import com.stdiet.custom.service.ISysServicesQuestionService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class SysServicesQuestionServiceImp implements ISysServicesQuestionService {
|
||||||
|
@Autowired
|
||||||
|
SysServicesQuestionMapper servicesQuestionMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
SysCustomerMapper sysCustomerMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SysServicesQuestion> selectSysServicesQuestionByUserIdAndRole(SysServicesQuestion servicesQuestion) {
|
||||||
|
return servicesQuestionMapper.selectSysServicesQuestionByUserIdAndRole(servicesQuestion);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int insertSysServicesQuestion(SysServicesQuestion servicesQuestion) {
|
||||||
|
servicesQuestionMapper.insertSysServicesQuestion(servicesQuestion);
|
||||||
|
|
||||||
|
SysCustomer customer = sysCustomerMapper.selectSysCustomerById(servicesQuestion.getCusId());
|
||||||
|
|
||||||
|
List<SysServicesQuestion> statusList = new ArrayList<>();
|
||||||
|
SysServicesQuestion customerStatus = new SysServicesQuestion();
|
||||||
|
customerStatus.setUserId(customer.getId());
|
||||||
|
customerStatus.setRole("customer");
|
||||||
|
customerStatus.setQueId(servicesQuestion.getId());
|
||||||
|
statusList.add(customerStatus);
|
||||||
|
|
||||||
|
SysServicesQuestion dieticianStatus = new SysServicesQuestion();
|
||||||
|
dieticianStatus.setUserId(customer.getMainDietitian());
|
||||||
|
dieticianStatus.setRole("dietician");
|
||||||
|
dieticianStatus.setQueId(servicesQuestion.getId());
|
||||||
|
statusList.add(dieticianStatus);
|
||||||
|
|
||||||
|
SysServicesQuestion afterSaleStatus = new SysServicesQuestion();
|
||||||
|
afterSaleStatus.setUserId(customer.getAfterDietitian());
|
||||||
|
afterSaleStatus.setRole("after_sale");
|
||||||
|
afterSaleStatus.setQueId(servicesQuestion.getId());
|
||||||
|
statusList.add(afterSaleStatus);
|
||||||
|
|
||||||
|
SysServicesQuestion dieticianAssistantStatus = new SysServicesQuestion();
|
||||||
|
dieticianAssistantStatus.setUserId(customer.getAssistantDietitian());
|
||||||
|
dieticianAssistantStatus.setRole("dietician_assistant");
|
||||||
|
dieticianAssistantStatus.setQueId(servicesQuestion.getId());
|
||||||
|
statusList.add(dieticianAssistantStatus);
|
||||||
|
|
||||||
|
return servicesQuestionMapper.insertSysServicesQuestionStatus(statusList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updateSysServicesQuestionStatus(SysServicesQuestion sysServicesQuestion) {
|
||||||
|
return servicesQuestionMapper.updateSysServicesQuestionStatus(sysServicesQuestion);
|
||||||
|
}
|
||||||
|
}
|
@ -97,7 +97,7 @@ public class WeChartAppletServiceImp implements IWechatAppletService {
|
|||||||
dataParam.put("thing1", JSONObject.parse("{\"value\":\"" + name + "\"}"));
|
dataParam.put("thing1", JSONObject.parse("{\"value\":\"" + name + "\"}"));
|
||||||
dataParam.put("time2", JSONObject.parse("{\"value\":\"" + startDate + "\"}"));
|
dataParam.put("time2", JSONObject.parse("{\"value\":\"" + startDate + "\"}"));
|
||||||
dataParam.put("time3", JSONObject.parse("{\"value\":\"" + endDate + "\"}"));
|
dataParam.put("time3", JSONObject.parse("{\"value\":\"" + endDate + "\"}"));
|
||||||
String mRemark = StringUtils.isNull(remark) ? "" : remark;
|
String mRemark = StringUtils.isNull(remark) ? "无" : remark;
|
||||||
dataParam.put("thing4", JSONObject.parse("{\"value\":\"" + mRemark + "\"}"));
|
dataParam.put("thing4", JSONObject.parse("{\"value\":\"" + mRemark + "\"}"));
|
||||||
|
|
||||||
param.put("data", dataParam);
|
param.put("data", dataParam);
|
||||||
|
@ -0,0 +1,83 @@
|
|||||||
|
<?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.stdiet.custom.mapper.SysServicesQuestionMapper">
|
||||||
|
|
||||||
|
<resultMap type="SysServicesQuestion" id="SysServicesQuestionResult">
|
||||||
|
<result column="id" property="id"/>
|
||||||
|
<result column="que_id" property="queId"/>
|
||||||
|
<result column="content" property="content"/>
|
||||||
|
<result column="role" property="role"/>
|
||||||
|
<result column="name" property="name"/>
|
||||||
|
<result column="type" property="type"/>
|
||||||
|
<result column="read" property="read"/>
|
||||||
|
<result column="img" property="img" typeHandler="com.stdiet.custom.typehandler.ArrayJsonHandler"/>
|
||||||
|
<result column="create_time" property="createTime"/>
|
||||||
|
<result column="update_time" property="updateTime"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<!-- 根据userId和角色查询问题列表-->
|
||||||
|
<select id="selectSysServicesQuestionByUserIdAndRole" parameterType="SysServicesQuestion"
|
||||||
|
resultMap="SysServicesQuestionResult">
|
||||||
|
SELECT * FROM (
|
||||||
|
SELECT * FROM sys_services_question_status WHERE role = #{role} AND user_id = #{userId}
|
||||||
|
) AS status
|
||||||
|
LEFT JOIN sys_services_question USING(que_id)
|
||||||
|
<choose>
|
||||||
|
<when test="role == 'customer'">
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT name, id AS user_id FROM sys_customer WHERE id = #{userId}
|
||||||
|
) AS customer USING(user_id)
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT role_key, sys_role.role_id, sys_user_role.user_id, sys_user.nick_name AS name FROM sys_role
|
||||||
|
INNER JOIN sys_user_role USING(role_id)
|
||||||
|
INNER JOIN sys_user USING(user_id)
|
||||||
|
WHERE role_key = #{role} AND user_id = #{userId}
|
||||||
|
) AS user USING(user_id)
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
ORDER BY type ASC, update_time DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 插入问题-->
|
||||||
|
<insert id="insertSysServicesQuestion" parameterType="SysServicesQuestion" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into sys_services_question
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
id,
|
||||||
|
<if test="cusId != null">cus_id,</if>
|
||||||
|
<if test="content != null">content,</if>
|
||||||
|
<if test="type != null">type,</if>
|
||||||
|
<if test="cusId != null">create_time,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
replace(uuid(), '-', ''),
|
||||||
|
<if test="cusId != null">#{cusId},</if>
|
||||||
|
<if test="content != null">#{content},</if>
|
||||||
|
<if test="type != null">#{type},</if>
|
||||||
|
<if test="cusId != null">now(),</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<!-- 插入问题的四个角色:1,用户; 2,营养师; 3,售后; 4,助理-->
|
||||||
|
<insert id="insertSysServicesQuestionStatus" parameterType="java.util.List">
|
||||||
|
insert into sys_services_question (que_id, user_id, role, create_time, update_time) values
|
||||||
|
<foreach collection="list" item="status" index="index" separator=",">
|
||||||
|
(#{status.queId}, #{status.userId}, #{status.role}, now(), now())
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<!-- 根据状态id更新-->
|
||||||
|
<update id="updateSysServicesQuestionStatus" parameterType="SysServicesQuestion">
|
||||||
|
update sys_services_question_status
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="read !== null">read = #{read}</if>
|
||||||
|
<if test="read !== null">update_time = now()</if>
|
||||||
|
</trim>
|
||||||
|
where id = ${id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
@ -89,7 +89,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
|
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
|
||||||
-- select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader, p.post_id, p.post_name from sys_user u
|
-- select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.password, u.sex,
|
||||||
|
-- u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader,
|
||||||
|
-- p.post_id, p.post_name from sys_user u
|
||||||
-- left join sys_dept d on u.dept_id = d.dept_id
|
-- left join sys_dept d on u.dept_id = d.dept_id
|
||||||
-- left join sys_user_post up on up.user_id = u.user_id
|
-- left join sys_user_post up on up.user_id = u.user_id
|
||||||
-- left join sys_post p on p.post_id = up.post_id
|
-- left join sys_post p on p.post_id = up.post_id
|
||||||
@ -119,7 +121,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
AND date_format(create_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d')
|
AND date_format(create_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d')
|
||||||
</if>
|
</if>
|
||||||
<if test="deptId != null and deptId != 0">
|
<if test="deptId != null and deptId != 0">
|
||||||
AND (dept_id = #{deptId} OR dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))
|
AND (dept_id = #{deptId} OR dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId},
|
||||||
|
ancestors) ))
|
||||||
</if>
|
</if>
|
||||||
<!-- 数据范围过滤 -->
|
<!-- 数据范围过滤 -->
|
||||||
${params.dataScope}
|
${params.dataScope}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user