投票、投票选项增加字段

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

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

@ -1,5 +1,6 @@
package com.ruoyi.kaohe.domain;
import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
@ -7,9 +8,9 @@ import com.ruoyi.common.core.domain.BaseEntity;
/**
* kh_vote_emp
*
*
* @author hs
* @date 2025-06-17
* @date 2025-06-19
*/
public class KhVoteEmp extends BaseEntity
{
@ -46,102 +47,132 @@ public class KhVoteEmp extends BaseEntity
@Excel(name = "当前投票分数")
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;
}
public Long getId()
public Long getId()
{
return id;
}
public void setVoteId(Long voteId)
public void setVoteId(Long voteId)
{
this.voteId = voteId;
}
public Long getVoteId()
public Long getVoteId()
{
return voteId;
}
public void setVoteTitle(String voteTitle)
public void setVoteTitle(String voteTitle)
{
this.voteTitle = voteTitle;
}
public String getVoteTitle()
public String getVoteTitle()
{
return voteTitle;
}
public void setEmpId(Long empId)
public void setEmpId(Long empId)
{
this.empId = empId;
}
public Long getEmpId()
public Long getEmpId()
{
return empId;
}
public void setEmpName(String empName)
public void setEmpName(String empName)
{
this.empName = empName;
}
public String getEmpName()
public String getEmpName()
{
return empName;
}
public void setContent(String content)
public void setContent(String content)
{
this.content = content;
}
public String getContent()
public String getContent()
{
return content;
}
public void setVoteNum(Long voteNum)
public void setVoteNum(Long voteNum)
{
this.voteNum = voteNum;
}
public Long getVoteNum()
public Long getVoteNum()
{
return voteNum;
}
public void setVoteScore(Long voteScore)
public void setVoteScore(Long voteScore)
{
this.voteScore = voteScore;
}
public Long getVoteScore()
public Long getVoteScore()
{
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
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("voteId", getVoteId())
.append("voteTitle", getVoteTitle())
.append("empId", getEmpId())
.append("empName", getEmpName())
.append("content", getContent())
.append("voteNum", getVoteNum())
.append("voteScore", getVoteScore())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
.append("id", getId())
.append("voteId", getVoteId())
.append("voteTitle", getVoteTitle())
.append("empId", getEmpId())
.append("empName", getEmpName())
.append("content", getContent())
.append("voteNum", getVoteNum())
.append("voteScore", getVoteScore())
.append("percentage", getPercentage())
.append("endScore", getEndScore())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

@ -1,9 +1,9 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.kaohe.mapper.KhVoteEmpMapper">
<resultMap type="KhVoteEmp" id="KhVoteEmpResult">
<result property="id" column="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="voteNum" column="vote_num" />
<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="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
@ -21,12 +23,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<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>
<select id="selectKhVoteEmpList" parameterType="KhVoteEmp" resultMap="KhVoteEmpResult">
<include refid="selectKhVoteEmpVo"/>
<where>
<where>
<if test="voteId != null "> and vote_id = #{voteId}</if>
<if test="voteTitle != null and voteTitle != ''"> and vote_title = #{voteTitle}</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="voteNum != null "> and vote_num = #{voteNum}</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>
</select>
<select id="selectKhVoteEmpById" parameterType="Long" resultMap="KhVoteEmpResult">
<include refid="selectKhVoteEmpVo"/>
where id = #{id}
@ -52,12 +56,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="content != null">content,</if>
<if test="voteNum != null">vote_num,</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="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="voteId != null">#{voteId},</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="voteNum != null">#{voteNum},</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="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</trim>
</insert>
<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="voteNum != null">vote_num = #{voteNum},</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="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
@ -98,7 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<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=")">
#{id}
</foreach>

@ -15,6 +15,7 @@
<result property="sTime" column="s_time" />
<result property="eTime" column="e_time" />
<result property="maxNum" column="max_num" />
<result property="percentage" column="percentage" />
<result property="state" column="state" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
@ -24,7 +25,7 @@
</resultMap>
<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>
<select id="selectKhVoteList" parameterType="KhVote" resultMap="KhVoteResult">
@ -39,6 +40,7 @@
<if test="sTime != null "> and s_time = #{sTime}</if>
<if test="eTime != null "> and e_time = #{eTime}</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>
</where>
</select>
@ -60,6 +62,7 @@
<if test="sTime != null">s_time,</if>
<if test="eTime != null">e_time,</if>
<if test="maxNum != null">max_num,</if>
<if test="percentage != null">percentage,</if>
<if test="state != null">state,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
@ -77,6 +80,7 @@
<if test="sTime != null">#{sTime},</if>
<if test="eTime != null">#{eTime},</if>
<if test="maxNum != null">#{maxNum},</if>
<if test="percentage != null">#{percentage},</if>
<if test="state != null">#{state},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
@ -98,6 +102,7 @@
<if test="sTime != null">s_time = #{sTime},</if>
<if test="eTime != null">e_time = #{eTime},</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="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>

Loading…
Cancel
Save