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
|
5 years ago
|
<?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(*) as voteNums
|
||
|
|
FROM
|
||
|
|
t_mt_group g
|
||
|
|
LEFT JOIN t_mt_vote v ON g.id = v.group_id
|
||
|
|
WHERE
|
||
|
|
g.project_id = #{projectId}
|
||
|
|
AND g.type = 1
|
||
|
|
AND g.rec_status = 0
|
||
|
|
AND ( v.rec_status = 0 OR v.id IS NULL )
|
||
|
|
GROUP BY g.id, g.name
|
||
|
|
</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>
|