You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.1 KiB
34 lines
1.1 KiB
<?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.ccsens.mt.persist.dao.VoteDao">
|
|
|
|
|
|
<select id="queryVote" resultType="com.ccsens.mt.bean.vo.VoteVo$GroupInfo">
|
|
SELECT
|
|
g.id as groupId,
|
|
g.name as groupName,
|
|
count(v.id) as voteNums
|
|
FROM
|
|
t_mt_group g
|
|
LEFT JOIN (select * from t_mt_vote where rec_status = 0) v ON g.id = v.group_id
|
|
WHERE
|
|
g.project_id = #{projectId}
|
|
AND g.type = 1
|
|
AND g.rec_status = 0
|
|
GROUP BY g.id, g.name
|
|
order by count(v.id) desc
|
|
</select>
|
|
<select id="countUserVoteNums" resultType="java.lang.Long">
|
|
SELECT
|
|
count( * )
|
|
FROM
|
|
t_mt_vote v,
|
|
t_mt_group g
|
|
WHERE
|
|
v.group_id = g.id
|
|
AND v.user_id = #{userId}
|
|
AND g.project_id = #{projectId}
|
|
AND v.rec_status = 0
|
|
AND g.rec_status = 0
|
|
</select>
|
|
</mapper>
|