投票、投票选项增加字段

main 006
hshansha 6 months ago
parent 9025e4fee4
commit 4978f7a55a

@ -1,5 +1,6 @@
package com.ruoyi.kaohe.domain; package com.ruoyi.kaohe.domain;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
@ -58,6 +59,10 @@ public class KhVote extends BaseEntity
@Excel(name = "最大投票数") @Excel(name = "最大投票数")
private Long maxNum; private Long maxNum;
/** 评分占比(0-1之间) */
@Excel(name = "评分占比(0-1之间)")
private BigDecimal percentage;
/** 状态(0 未开始 1 进行中 2 完成) */ /** 状态(0 未开始 1 进行中 2 完成) */
@Excel(name = "状态(0 未开始 1 进行中 2 完成)") @Excel(name = "状态(0 未开始 1 进行中 2 完成)")
private String state; private String state;
@ -127,6 +132,14 @@ public class KhVote extends BaseEntity
this.vDescription = vDescription; this.vDescription = vDescription;
} }
public BigDecimal getPercentage() {
return percentage;
}
public void setPercentage(BigDecimal percentage) {
this.percentage = percentage;
}
public String getvDescription() public String getvDescription()
{ {
return vDescription; return vDescription;
@ -185,6 +198,7 @@ public class KhVote extends BaseEntity
.append("sTime", getsTime()) .append("sTime", getsTime())
.append("eTime", geteTime()) .append("eTime", geteTime())
.append("maxNum", getMaxNum()) .append("maxNum", getMaxNum())
.append("percentage", getPercentage())
.append("state", getState()) .append("state", getState())
.append("createBy", getCreateBy()) .append("createBy", getCreateBy())
.append("createTime", getCreateTime()) .append("createTime", getCreateTime())

@ -1,5 +1,6 @@
package com.ruoyi.kaohe.domain; package com.ruoyi.kaohe.domain;
import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel;
@ -9,7 +10,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
* kh_vote_emp * kh_vote_emp
* *
* @author hs * @author hs
* @date 2025-06-17 * @date 2025-06-19
*/ */
public class KhVoteEmp extends BaseEntity public class KhVoteEmp extends BaseEntity
{ {
@ -46,6 +47,14 @@ public class KhVoteEmp extends BaseEntity
@Excel(name = "当前投票分数") @Excel(name = "当前投票分数")
private Long voteScore; private Long voteScore;
/** 评分占比(0-1之间) */
@Excel(name = "评分占比(0-1之间)")
private BigDecimal percentage;
/** 最终分数 */
@Excel(name = "最终分数")
private Long endScore;
public void setId(Long id) public void setId(Long id)
{ {
this.id = id; this.id = id;
@ -126,6 +135,26 @@ public class KhVoteEmp extends BaseEntity
return voteScore; return voteScore;
} }
public void setPercentage(BigDecimal percentage)
{
this.percentage = percentage;
}
public BigDecimal getPercentage()
{
return percentage;
}
public void setEndScore(Long endScore)
{
this.endScore = endScore;
}
public Long getEndScore()
{
return endScore;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -137,6 +166,8 @@ public class KhVoteEmp extends BaseEntity
.append("content", getContent()) .append("content", getContent())
.append("voteNum", getVoteNum()) .append("voteNum", getVoteNum())
.append("voteScore", getVoteScore()) .append("voteScore", getVoteScore())
.append("percentage", getPercentage())
.append("endScore", getEndScore())
.append("createBy", getCreateBy()) .append("createBy", getCreateBy())
.append("createTime", getCreateTime()) .append("createTime", getCreateTime())
.append("updateBy", getUpdateBy()) .append("updateBy", getUpdateBy())

@ -13,6 +13,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="content" column="content" /> <result property="content" column="content" />
<result property="voteNum" column="vote_num" /> <result property="voteNum" column="vote_num" />
<result property="voteScore" column="vote_score" /> <result property="voteScore" column="vote_score" />
<result property="percentage" column="percentage" />
<result property="endScore" column="end_score" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
@ -21,7 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectKhVoteEmpVo"> <sql id="selectKhVoteEmpVo">
select id, vote_id, vote_title, emp_id, emp_name, content, vote_num, vote_score, create_by, create_time, update_by, update_time, remark from kh_vote_emp select id, vote_id, vote_title, emp_id, emp_name, content, vote_num, vote_score, percentage, end_score, create_by, create_time, update_by, update_time, remark from kh_vote_emp
</sql> </sql>
<select id="selectKhVoteEmpList" parameterType="KhVoteEmp" resultMap="KhVoteEmpResult"> <select id="selectKhVoteEmpList" parameterType="KhVoteEmp" resultMap="KhVoteEmpResult">
@ -34,6 +36,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="content != null and content != ''"> and content = #{content}</if> <if test="content != null and content != ''"> and content = #{content}</if>
<if test="voteNum != null "> and vote_num = #{voteNum}</if> <if test="voteNum != null "> and vote_num = #{voteNum}</if>
<if test="voteScore != null "> and vote_score = #{voteScore}</if> <if test="voteScore != null "> and vote_score = #{voteScore}</if>
<if test="percentage != null "> and percentage = #{percentage}</if>
<if test="endScore != null "> and end_score = #{endScore}</if>
</where> </where>
</select> </select>
@ -52,6 +56,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="content != null">content,</if> <if test="content != null">content,</if>
<if test="voteNum != null">vote_num,</if> <if test="voteNum != null">vote_num,</if>
<if test="voteScore != null">vote_score,</if> <if test="voteScore != null">vote_score,</if>
<if test="percentage != null">percentage,</if>
<if test="endScore != null">end_score,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if> <if test="updateBy != null">update_by,</if>
@ -66,6 +72,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="content != null">#{content},</if> <if test="content != null">#{content},</if>
<if test="voteNum != null">#{voteNum},</if> <if test="voteNum != null">#{voteNum},</if>
<if test="voteScore != null">#{voteScore},</if> <if test="voteScore != null">#{voteScore},</if>
<if test="percentage != null">#{percentage},</if>
<if test="endScore != null">#{endScore},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
@ -84,6 +92,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="content != null">content = #{content},</if> <if test="content != null">content = #{content},</if>
<if test="voteNum != null">vote_num = #{voteNum},</if> <if test="voteNum != null">vote_num = #{voteNum},</if>
<if test="voteScore != null">vote_score = #{voteScore},</if> <if test="voteScore != null">vote_score = #{voteScore},</if>
<if test="percentage != null">percentage = #{percentage},</if>
<if test="endScore != null">end_score = #{endScore},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>

@ -15,6 +15,7 @@
<result property="sTime" column="s_time" /> <result property="sTime" column="s_time" />
<result property="eTime" column="e_time" /> <result property="eTime" column="e_time" />
<result property="maxNum" column="max_num" /> <result property="maxNum" column="max_num" />
<result property="percentage" column="percentage" />
<result property="state" column="state" /> <result property="state" column="state" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
@ -24,7 +25,7 @@
</resultMap> </resultMap>
<sql id="selectKhVoteVo"> <sql id="selectKhVoteVo">
select id, pingce_id, pingce_name, khitem_id, khitem_name, vote_title, v_description, s_time, e_time, max_num, state, create_by, create_time, update_by, update_time, remark from kh_vote select id, pingce_id, pingce_name, khitem_id, khitem_name, vote_title, v_description, s_time, e_time, max_num, percentage, state, create_by, create_time, update_by, update_time, remark from kh_vote
</sql> </sql>
<select id="selectKhVoteList" parameterType="KhVote" resultMap="KhVoteResult"> <select id="selectKhVoteList" parameterType="KhVote" resultMap="KhVoteResult">
@ -39,6 +40,7 @@
<if test="sTime != null "> and s_time = #{sTime}</if> <if test="sTime != null "> and s_time = #{sTime}</if>
<if test="eTime != null "> and e_time = #{eTime}</if> <if test="eTime != null "> and e_time = #{eTime}</if>
<if test="maxNum != null "> and max_num = #{maxNum}</if> <if test="maxNum != null "> and max_num = #{maxNum}</if>
<if test="percentage != null "> and percentage = #{percentage}</if>
<if test="state != null and state != ''"> and state = #{state}</if> <if test="state != null and state != ''"> and state = #{state}</if>
</where> </where>
</select> </select>
@ -60,6 +62,7 @@
<if test="sTime != null">s_time,</if> <if test="sTime != null">s_time,</if>
<if test="eTime != null">e_time,</if> <if test="eTime != null">e_time,</if>
<if test="maxNum != null">max_num,</if> <if test="maxNum != null">max_num,</if>
<if test="percentage != null">percentage,</if>
<if test="state != null">state,</if> <if test="state != null">state,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
@ -77,6 +80,7 @@
<if test="sTime != null">#{sTime},</if> <if test="sTime != null">#{sTime},</if>
<if test="eTime != null">#{eTime},</if> <if test="eTime != null">#{eTime},</if>
<if test="maxNum != null">#{maxNum},</if> <if test="maxNum != null">#{maxNum},</if>
<if test="percentage != null">#{percentage},</if>
<if test="state != null">#{state},</if> <if test="state != null">#{state},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
@ -98,6 +102,7 @@
<if test="sTime != null">s_time = #{sTime},</if> <if test="sTime != null">s_time = #{sTime},</if>
<if test="eTime != null">e_time = #{eTime},</if> <if test="eTime != null">e_time = #{eTime},</if>
<if test="maxNum != null">max_num = #{maxNum},</if> <if test="maxNum != null">max_num = #{maxNum},</if>
<if test="percentage != null">percentage = #{percentage},</if>
<if test="state != null">state = #{state},</if> <if test="state != null">state = #{state},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>

Loading…
Cancel
Save