INSERT INTO bm_question_answer (id, windows_id, question, answer, user_id, knowledge)
VALUES (#{id}, #{windowId}, #{question}, #{answer}, #{userId}, #{knowledge});
SELECT id AS id,
windows_id AS windowId,
question AS question,
answer AS answer,
create_time AS createTime,
update_time AS updateTime,
response_time AS responseTime,
user_id AS userId,
knowledge as knowledge,
collect as collect,
like_type AS likeType
FROM bm_question_answer
WHERE windows_id = #{windowId}
AND user_id = #{userId}
SELECT id AS id,
question AS question,
answer AS answer,
response_time AS responseTime,
knowledge as knowledge,
collect_time as collectTime
FROM bm_question_answer
where user_id = #{userId}
and collect = '1'
SELECT any_value(question) AS question,
COUNT(*) AS num
FROM bm_question_answer
where 1=1
and create_time BETWEEN #{startTime} AND #{endTime}
GROUP BY question
ORDER BY num DESC
LIMIT 10
select 'questionNum' AS name, COUNT(*) AS num
from bm_question_answer WHERE 1=1
and create_time BETWEEN #{startTime} AND #{endTime}
UNION ALL
select 'questionPeople' AS name, COUNT(DISTINCT user_id) AS num
from bm_question_answer WHERE 1=1
and create_time BETWEEN #{startTime} AND #{endTime}
UNION ALL
select 'systemPeople' AS name, COUNT(DISTINCT user_name) AS num
from sys_logininfor where msg ='登录成功'
and login_time BETWEEN #{startTime} AND #{endTime}
select 'questionNum' AS name, COUNT(*) AS num,DATE(create_time) AS time
from bm_question_answer WHERE 1=1
and create_time BETWEEN #{startTime} AND #{endTime}
GROUP BY time
select 'questionPeople' AS name, COUNT(DISTINCT user_id) AS num,DATE(create_time) AS time
from bm_question_answer WHERE 1=1
and create_time BETWEEN #{startTime} AND #{endTime}
GROUP BY time
select 'systemPeople' AS name, COUNT(DISTINCT user_name) AS num,DATE(login_time) AS time
from sys_logininfor where msg ='登录成功'
and login_time BETWEEN #{startTime} AND #{endTime}
GROUP BY time
select 'questionNum' AS name, COUNT(*) AS num
from bm_question_answer WHERE 1=1
and create_time BETWEEN #{startTime} AND #{endTime}
UNION ALL
select 'questionPeople' AS name, COUNT(DISTINCT user_id) AS num
from bm_question_answer WHERE 1=1
and create_time BETWEEN #{startTime} AND #{endTime}
UNION ALL
select 'systemPeople' AS name, COUNT(DISTINCT user_name) AS num
from sys_logininfor where msg ='登录成功'
and login_time BETWEEN #{startTime} AND #{endTime}
update bm_question_answer
set like_type=#{likeType}
WHERE id = #{id}
update bm_document_like
set like_type=#{likeType}
WHERE id = #{id}
update bm_question_answer
set collect=#{collect},collect_time=#{collectTime}
WHERE id = #{id}