投票、投票选项增加字段

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;
@ -7,9 +8,9 @@ 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,102 +47,132 @@ public class KhVoteEmp extends BaseEntity
@Excel(name = "当前投票分数") @Excel(name = "当前投票分数")
private Long voteScore; private Long voteScore;
public void setId(Long id) /** 评分占比(0-1之间) */
@Excel(name = "评分占比(0-1之间)")
private BigDecimal percentage;
/** 最终分数 */
@Excel(name = "最终分数")
private Long endScore;
public void setId(Long id)
{ {
this.id = id; this.id = id;
} }
public Long getId() public Long getId()
{ {
return id; return id;
} }
public void setVoteId(Long voteId) public void setVoteId(Long voteId)
{ {
this.voteId = voteId; this.voteId = voteId;
} }
public Long getVoteId() public Long getVoteId()
{ {
return voteId; return voteId;
} }
public void setVoteTitle(String voteTitle) public void setVoteTitle(String voteTitle)
{ {
this.voteTitle = voteTitle; this.voteTitle = voteTitle;
} }
public String getVoteTitle() public String getVoteTitle()
{ {
return voteTitle; return voteTitle;
} }
public void setEmpId(Long empId) public void setEmpId(Long empId)
{ {
this.empId = empId; this.empId = empId;
} }
public Long getEmpId() public Long getEmpId()
{ {
return empId; return empId;
} }
public void setEmpName(String empName) public void setEmpName(String empName)
{ {
this.empName = empName; this.empName = empName;
} }
public String getEmpName() public String getEmpName()
{ {
return empName; return empName;
} }
public void setContent(String content) public void setContent(String content)
{ {
this.content = content; this.content = content;
} }
public String getContent() public String getContent()
{ {
return content; return content;
} }
public void setVoteNum(Long voteNum) public void setVoteNum(Long voteNum)
{ {
this.voteNum = voteNum; this.voteNum = voteNum;
} }
public Long getVoteNum() public Long getVoteNum()
{ {
return voteNum; return voteNum;
} }
public void setVoteScore(Long voteScore) public void setVoteScore(Long voteScore)
{ {
this.voteScore = voteScore; this.voteScore = voteScore;
} }
public Long getVoteScore() public Long getVoteScore()
{ {
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)
.append("id", getId()) .append("id", getId())
.append("voteId", getVoteId()) .append("voteId", getVoteId())
.append("voteTitle", getVoteTitle()) .append("voteTitle", getVoteTitle())
.append("empId", getEmpId()) .append("empId", getEmpId())
.append("empName", getEmpName()) .append("empName", getEmpName())
.append("content", getContent()) .append("content", getContent())
.append("voteNum", getVoteNum()) .append("voteNum", getVoteNum())
.append("voteScore", getVoteScore()) .append("voteScore", getVoteScore())
.append("createBy", getCreateBy()) .append("percentage", getPercentage())
.append("createTime", getCreateTime()) .append("endScore", getEndScore())
.append("updateBy", getUpdateBy()) .append("createBy", getCreateBy())
.append("updateTime", getUpdateTime()) .append("createTime", getCreateTime())
.append("remark", getRemark()) .append("updateBy", getUpdateBy())
.toString(); .append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
} }
} }

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.kaohe.mapper.KhVoteEmpMapper"> <mapper namespace="com.ruoyi.kaohe.mapper.KhVoteEmpMapper">
<resultMap type="KhVoteEmp" id="KhVoteEmpResult"> <resultMap type="KhVoteEmp" id="KhVoteEmpResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="voteId" column="vote_id" /> <result property="voteId" column="vote_id" />
@ -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,12 +23,12 @@ 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">
<include refid="selectKhVoteEmpVo"/> <include refid="selectKhVoteEmpVo"/>
<where> <where>
<if test="voteId != null "> and vote_id = #{voteId}</if> <if test="voteId != null "> and vote_id = #{voteId}</if>
<if test="voteTitle != null and voteTitle != ''"> and vote_title = #{voteTitle}</if> <if test="voteTitle != null and voteTitle != ''"> and vote_title = #{voteTitle}</if>
<if test="empId != null "> and emp_id = #{empId}</if> <if test="empId != null "> and emp_id = #{empId}</if>
@ -34,9 +36,11 @@ 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>
<select id="selectKhVoteEmpById" parameterType="Long" resultMap="KhVoteEmpResult"> <select id="selectKhVoteEmpById" parameterType="Long" resultMap="KhVoteEmpResult">
<include refid="selectKhVoteEmpVo"/> <include refid="selectKhVoteEmpVo"/>
where id = #{id} where id = #{id}
@ -52,12 +56,14 @@ 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>
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="voteId != null">#{voteId},</if> <if test="voteId != null">#{voteId},</if>
<if test="voteTitle != null">#{voteTitle},</if> <if test="voteTitle != null">#{voteTitle},</if>
@ -66,12 +72,14 @@ 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>
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if> <if test="remark != null">#{remark},</if>
</trim> </trim>
</insert> </insert>
<update id="updateKhVoteEmp" parameterType="KhVoteEmp"> <update id="updateKhVoteEmp" parameterType="KhVoteEmp">
@ -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>
@ -98,7 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete> </delete>
<delete id="deleteKhVoteEmpByIds" parameterType="String"> <delete id="deleteKhVoteEmpByIds" parameterType="String">
delete from kh_vote_emp where id in delete from kh_vote_emp where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>

@ -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