添加联系方式及议事投票数量接口

main 7
hansha 2 years ago
parent ac164b3bab
commit 9c17766aa2

@ -1,25 +1,21 @@
package com.ruoyi.szxc.controller; package com.ruoyi.szxc.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.szxc.domain.SzxcVoteResult; import com.ruoyi.szxc.domain.SzxcVoteResult;
import com.ruoyi.szxc.service.ISzxcVoteResultService; import com.ruoyi.szxc.service.ISzxcVoteResultService;
import com.ruoyi.common.utils.poi.ExcelUtil; import org.springframework.beans.factory.annotation.Autowired;
import com.ruoyi.common.core.page.TableDataInfo; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* Controller * Controller
@ -46,6 +42,21 @@ public class SzxcVoteResultController extends BaseController
return getDataTable(list); return getDataTable(list);
} }
/**
*
*/
@PreAuthorize("@ss.hasPermi('szxc:voteresut:count')")
@GetMapping("/count")
public Map<String,Object> ResultCount(SzxcVoteResult szxcVoteResult)
{
startPage();
List<SzxcVoteResult> list = szxcVoteResultService.selectSzxcVoteResultList(szxcVoteResult);
Map<String,Object> result = new HashMap<String,Object>();
result.put("data",getDataTable(list));
result.put("result",szxcVoteResultService.selectSzxcVoteResultByDiscussId(szxcVoteResult.getYsId()));
return result;
}
/** /**
* *
*/ */

@ -7,9 +7,9 @@ import com.ruoyi.common.core.domain.BaseEntity;
/** /**
* szxc_gy_apply * szxc_gy_apply
* *
* @author hs * @author hs
* @date 2024-03-20 * @date 2024-04-07
*/ */
public class SzxcGyApply extends BaseEntity public class SzxcGyApply extends BaseEntity
{ {
@ -18,14 +18,14 @@ public class SzxcGyApply extends BaseEntity
/** id */ /** id */
private Long id; private Long id;
/** 居民id */
@Excel(name = "居民id")
private Long jmId;
/** 公益id */ /** 公益id */
@Excel(name = "公益id") @Excel(name = "公益id")
private Long gyId; private Long gyId;
/** 居民id */
@Excel(name = "居民id")
private Long jmId;
/** 身份证号 */ /** 身份证号 */
@Excel(name = "身份证号") @Excel(name = "身份证号")
private String cardId; private String cardId;
@ -34,61 +34,74 @@ public class SzxcGyApply extends BaseEntity
@Excel(name = "报名人") @Excel(name = "报名人")
private String name; private String name;
/** 手机号 */
@Excel(name = "手机号")
private String phone;
/** 创建者ID */ /** 创建者ID */
@Excel(name = "创建者ID") @Excel(name = "创建者ID")
private Long userId; private Long userId;
public void setId(Long id) public void setId(Long id)
{ {
this.id = id; this.id = id;
} }
public Long getId() public Long getId()
{ {
return id; return id;
} }
public void setJmId(Long jmId) public void setGyId(Long gyId)
{ {
this.jmId = jmId; this.gyId = gyId;
} }
public Long getJmId() public Long getGyId()
{ {
return jmId; return gyId;
} }
public void setGyId(Long gyId) public void setJmId(Long jmId)
{ {
this.gyId = gyId; this.jmId = jmId;
} }
public Long getGyId() public Long getJmId()
{ {
return gyId; return jmId;
} }
public void setCardId(String cardId) public void setCardId(String cardId)
{ {
this.cardId = cardId; this.cardId = cardId;
} }
public String getCardId() public String getCardId()
{ {
return cardId; return cardId;
} }
public void setName(String name) public void setName(String name)
{ {
this.name = name; this.name = name;
} }
public String getName() public String getName()
{ {
return name; return name;
} }
public void setUserId(Long userId) public void setPhone(String phone)
{
this.phone = phone;
}
public String getPhone()
{
return phone;
}
public void setUserId(Long userId)
{ {
this.userId = userId; this.userId = userId;
} }
public Long getUserId() public Long getUserId()
{ {
return userId; return userId;
} }
@ -96,16 +109,17 @@ public class SzxcGyApply extends BaseEntity
@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("jmId", getJmId()) .append("gyId", getGyId())
.append("gyId", getGyId()) .append("jmId", getJmId())
.append("cardId", getCardId()) .append("cardId", getCardId())
.append("name", getName()) .append("name", getName())
.append("createBy", getCreateBy()) .append("phone", getPhone())
.append("createTime", getCreateTime()) .append("createBy", getCreateBy())
.append("updateBy", getUpdateBy()) .append("createTime", getCreateTime())
.append("updateTime", getUpdateTime()) .append("updateBy", getUpdateBy())
.append("userId", getUserId()) .append("updateTime", getUpdateTime())
.toString(); .append("userId", getUserId())
.toString();
} }
} }

@ -7,9 +7,9 @@ import com.ruoyi.common.core.domain.BaseEntity;
/** /**
* szxc_vote_result * szxc_vote_result
* *
* @author hs * @author hs
* @date 2024-03-20 * @date 2024-04-07
*/ */
public class SzxcVoteResult extends BaseEntity public class SzxcVoteResult extends BaseEntity
{ {
@ -18,6 +18,10 @@ public class SzxcVoteResult extends BaseEntity
/** id */ /** id */
private Long id; private Long id;
/** 议事id */
@Excel(name = "议事id")
private Long ysId;
/** 居民id */ /** 居民id */
@Excel(name = "居民id") @Excel(name = "居民id")
private Long jmId; private Long jmId;
@ -30,9 +34,9 @@ public class SzxcVoteResult extends BaseEntity
@Excel(name = "投票人") @Excel(name = "投票人")
private String voteName; private String voteName;
/** 议事id */ /** 手机号 */
@Excel(name = "议事id") @Excel(name = "手机号")
private Long ysId; private String phone;
/** 同意、反对、弃权 */ /** 同意、反对、弃权 */
@Excel(name = "同意、反对、弃权") @Excel(name = "同意、反对、弃权")
@ -46,75 +50,84 @@ public class SzxcVoteResult extends BaseEntity
@Excel(name = "创建者ID") @Excel(name = "创建者ID")
private Long userId; private Long userId;
public void setId(Long id) public void setId(Long id)
{ {
this.id = id; this.id = id;
} }
public Long getId() public Long getId()
{ {
return id; return id;
} }
public void setJmId(Long jmId) public void setYsId(Long ysId)
{
this.ysId = ysId;
}
public Long getYsId()
{
return ysId;
}
public void setJmId(Long jmId)
{ {
this.jmId = jmId; this.jmId = jmId;
} }
public Long getJmId() public Long getJmId()
{ {
return jmId; return jmId;
} }
public void setCardId(String cardId) public void setCardId(String cardId)
{ {
this.cardId = cardId; this.cardId = cardId;
} }
public String getCardId() public String getCardId()
{ {
return cardId; return cardId;
} }
public void setVoteName(String voteName) public void setVoteName(String voteName)
{ {
this.voteName = voteName; this.voteName = voteName;
} }
public String getVoteName() public String getVoteName()
{ {
return voteName; return voteName;
} }
public void setYsId(Long ysId) public void setPhone(String phone)
{ {
this.ysId = ysId; this.phone = phone;
} }
public Long getYsId() public String getPhone()
{ {
return ysId; return phone;
} }
public void setVote(String vote) public void setVote(String vote)
{ {
this.vote = vote; this.vote = vote;
} }
public String getVote() public String getVote()
{ {
return vote; return vote;
} }
public void setOpinion(String opinion) public void setOpinion(String opinion)
{ {
this.opinion = opinion; this.opinion = opinion;
} }
public String getOpinion() public String getOpinion()
{ {
return opinion; return opinion;
} }
public void setUserId(Long userId) public void setUserId(Long userId)
{ {
this.userId = userId; this.userId = userId;
} }
public Long getUserId() public Long getUserId()
{ {
return userId; return userId;
} }
@ -122,18 +135,19 @@ public class SzxcVoteResult extends BaseEntity
@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("jmId", getJmId()) .append("ysId", getYsId())
.append("cardId", getCardId()) .append("jmId", getJmId())
.append("voteName", getVoteName()) .append("cardId", getCardId())
.append("ysId", getYsId()) .append("voteName", getVoteName())
.append("vote", getVote()) .append("phone", getPhone())
.append("opinion", getOpinion()) .append("vote", getVote())
.append("createBy", getCreateBy()) .append("opinion", getOpinion())
.append("createTime", getCreateTime()) .append("createBy", getCreateBy())
.append("updateBy", getUpdateBy()) .append("createTime", getCreateTime())
.append("updateTime", getUpdateTime()) .append("updateBy", getUpdateBy())
.append("userId", getUserId()) .append("updateTime", getUpdateTime())
.toString(); .append("userId", getUserId())
.toString();
} }
} }

@ -0,0 +1,48 @@
package com.ruoyi.szxc.domain;
public class YsResult {
/** 议事id */
private Long ysId;
/** 同意票数 */
private Integer tyCount;
/** 反对票数 */
private Integer fdCount;
/** 弃权票数 */
private Integer qqCount;
public Long getYsId() {
return ysId;
}
public void setYsId(Long ysId) {
this.ysId = ysId;
}
public Integer getTyCount() {
return tyCount;
}
public void setTyCount(Integer tyCount) {
this.tyCount = tyCount;
}
public Integer getFdCount() {
return fdCount;
}
public void setFdCount(Integer fdCount) {
this.fdCount = fdCount;
}
public Integer getQqCount() {
return qqCount;
}
public void setQqCount(Integer qqCount) {
this.qqCount = qqCount;
}
}

@ -1,7 +1,9 @@
package com.ruoyi.szxc.mapper; package com.ruoyi.szxc.mapper;
import java.util.List;
import com.ruoyi.szxc.domain.SzxcVoteResult; import com.ruoyi.szxc.domain.SzxcVoteResult;
import com.ruoyi.szxc.domain.YsResult;
import java.util.List;
/** /**
* Mapper * Mapper
@ -58,4 +60,6 @@ public interface SzxcVoteResultMapper
* @return * @return
*/ */
public int deleteSzxcVoteResultByIds(Long[] ids); public int deleteSzxcVoteResultByIds(Long[] ids);
YsResult selectSzxcVoteResultByDiscussId(Long ysId);
} }

@ -1,7 +1,9 @@
package com.ruoyi.szxc.service; package com.ruoyi.szxc.service;
import java.util.List;
import com.ruoyi.szxc.domain.SzxcVoteResult; import com.ruoyi.szxc.domain.SzxcVoteResult;
import com.ruoyi.szxc.domain.YsResult;
import java.util.List;
/** /**
* Service * Service
@ -58,4 +60,6 @@ public interface ISzxcVoteResultService
* @return * @return
*/ */
public int deleteSzxcVoteResultById(Long id); public int deleteSzxcVoteResultById(Long id);
YsResult selectSzxcVoteResultByDiscussId(Long ysId);
} }

@ -1,12 +1,14 @@
package com.ruoyi.szxc.service.impl; package com.ruoyi.szxc.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.szxc.mapper.SzxcVoteResultMapper;
import com.ruoyi.szxc.domain.SzxcVoteResult; import com.ruoyi.szxc.domain.SzxcVoteResult;
import com.ruoyi.szxc.domain.YsResult;
import com.ruoyi.szxc.mapper.SzxcVoteResultMapper;
import com.ruoyi.szxc.service.ISzxcVoteResultService; import com.ruoyi.szxc.service.ISzxcVoteResultService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* Service * Service
@ -93,4 +95,9 @@ public class SzxcVoteResultServiceImpl implements ISzxcVoteResultService
{ {
return szxcVoteResultMapper.deleteSzxcVoteResultById(id); return szxcVoteResultMapper.deleteSzxcVoteResultById(id);
} }
@Override
public YsResult selectSzxcVoteResultByDiscussId(Long ysId) {
return szxcVoteResultMapper.selectSzxcVoteResultByDiscussId(ysId);
}
} }

@ -1,15 +1,16 @@
<?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.szxc.mapper.SzxcGyApplyMapper"> <mapper namespace="com.ruoyi.szxc.mapper.SzxcGyApplyMapper">
<resultMap type="SzxcGyApply" id="SzxcGyApplyResult"> <resultMap type="SzxcGyApply" id="SzxcGyApplyResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="jmId" column="jm_id" />
<result property="gyId" column="gy_id" /> <result property="gyId" column="gy_id" />
<result property="jmId" column="jm_id" />
<result property="cardId" column="card_id" /> <result property="cardId" column="card_id" />
<result property="name" column="name" /> <result property="name" column="name" />
<result property="phone" column="phone" />
<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" />
@ -18,58 +19,62 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectSzxcGyApplyVo"> <sql id="selectSzxcGyApplyVo">
select id, jm_id, gy_id, card_id, name, create_by, create_time, update_by, update_time, user_id from szxc_gy_apply select id, gy_id, jm_id, card_id, name, phone, create_by, create_time, update_by, update_time, user_id from szxc_gy_apply
</sql> </sql>
<select id="selectSzxcGyApplyList" parameterType="SzxcGyApply" resultMap="SzxcGyApplyResult"> <select id="selectSzxcGyApplyList" parameterType="SzxcGyApply" resultMap="SzxcGyApplyResult">
<include refid="selectSzxcGyApplyVo"/> <include refid="selectSzxcGyApplyVo"/>
<where> <where>
<if test="jmId != null "> and jm_id = #{jmId}</if>
<if test="gyId != null "> and gy_id = #{gyId}</if> <if test="gyId != null "> and gy_id = #{gyId}</if>
<if test="jmId != null "> and jm_id = #{jmId}</if>
<if test="cardId != null and cardId != ''"> and card_id = #{cardId}</if> <if test="cardId != null and cardId != ''"> and card_id = #{cardId}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
<if test="userId != null "> and user_id = #{userId}</if> <if test="userId != null "> and user_id = #{userId}</if>
</where> </where>
</select> </select>
<select id="selectSzxcGyApplyById" parameterType="Long" resultMap="SzxcGyApplyResult"> <select id="selectSzxcGyApplyById" parameterType="Long" resultMap="SzxcGyApplyResult">
<include refid="selectSzxcGyApplyVo"/> <include refid="selectSzxcGyApplyVo"/>
where id = #{id} where id = #{id}
</select> </select>
<insert id="insertSzxcGyApply" parameterType="SzxcGyApply" useGeneratedKeys="true" keyProperty="id"> <insert id="insertSzxcGyApply" parameterType="SzxcGyApply" useGeneratedKeys="true" keyProperty="id">
insert into szxc_gy_apply insert into szxc_gy_apply
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="jmId != null">jm_id,</if>
<if test="gyId != null">gy_id,</if> <if test="gyId != null">gy_id,</if>
<if test="jmId != null">jm_id,</if>
<if test="cardId != null">card_id,</if> <if test="cardId != null">card_id,</if>
<if test="name != null and name != ''">name,</if> <if test="name != null and name != ''">name,</if>
<if test="phone != null">phone,</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="userId != null">user_id,</if> <if test="userId != null">user_id,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="jmId != null">#{jmId},</if>
<if test="gyId != null">#{gyId},</if> <if test="gyId != null">#{gyId},</if>
<if test="jmId != null">#{jmId},</if>
<if test="cardId != null">#{cardId},</if> <if test="cardId != null">#{cardId},</if>
<if test="name != null and name != ''">#{name},</if> <if test="name != null and name != ''">#{name},</if>
<if test="phone != null">#{phone},</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="userId != null">#{userId},</if> <if test="userId != null">#{userId},</if>
</trim> </trim>
</insert> </insert>
<update id="updateSzxcGyApply" parameterType="SzxcGyApply"> <update id="updateSzxcGyApply" parameterType="SzxcGyApply">
update szxc_gy_apply update szxc_gy_apply
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="jmId != null">jm_id = #{jmId},</if>
<if test="gyId != null">gy_id = #{gyId},</if> <if test="gyId != null">gy_id = #{gyId},</if>
<if test="jmId != null">jm_id = #{jmId},</if>
<if test="cardId != null">card_id = #{cardId},</if> <if test="cardId != null">card_id = #{cardId},</if>
<if test="name != null and name != ''">name = #{name},</if> <if test="name != null and name != ''">name = #{name},</if>
<if test="phone != null">phone = #{phone},</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>
@ -84,7 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete> </delete>
<delete id="deleteSzxcGyApplyByIds" parameterType="String"> <delete id="deleteSzxcGyApplyByIds" parameterType="String">
delete from szxc_gy_apply where id in delete from szxc_gy_apply where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>

@ -3,13 +3,14 @@
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.szxc.mapper.SzxcVoteResultMapper"> <mapper namespace="com.ruoyi.szxc.mapper.SzxcVoteResultMapper">
<resultMap type="SzxcVoteResult" id="SzxcVoteResultResult"> <resultMap type="SzxcVoteResult" id="SzxcVoteResultResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="ysId" column="ys_id" />
<result property="jmId" column="jm_id" /> <result property="jmId" column="jm_id" />
<result property="cardId" column="card_id" /> <result property="cardId" column="card_id" />
<result property="voteName" column="vote_name" /> <result property="voteName" column="vote_name" />
<result property="ysId" column="ys_id" /> <result property="phone" column="phone" />
<result property="vote" column="vote" /> <result property="vote" column="vote" />
<result property="opinion" column="opinion" /> <result property="opinion" column="opinion" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
@ -18,85 +19,69 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="userId" column="user_id" /> <result property="userId" column="user_id" />
</resultMap> </resultMap>
<resultMap type="YsResult" id="YsResult">
<result property="ysId" column="ys_id" />
<result property="tyCount" column="ty" />
<result property="fdCount" column="fd" />
<result property="qqCount" column="qq" />
</resultMap>
<sql id="selectSzxcVoteResultVo"> <sql id="selectSzxcVoteResultVo">
select id, jm_id, card_id, vote_name, ys_id, vote, opinion, create_by, create_time, update_by, update_time, user_id from szxc_vote_result select id, jm_id, card_id, vote_name, ys_id, vote, opinion, create_by, create_time, update_by, update_time, user_id from szxc_vote_result
</sql> </sql>
<sql id="selectSzxcVoteResultVo">
select id, ys_id, jm_id, card_id, vote_name, phone, vote, opinion, create_by, create_time, update_by, update_time, user_id from szxc_vote_result
</sql>
<select id="selectSzxcVoteResultList" parameterType="SzxcVoteResult" resultMap="SzxcVoteResultResult"> <select id="selectSzxcVoteResultList" parameterType="SzxcVoteResult" resultMap="SzxcVoteResultResult">
<include refid="selectSzxcVoteResultVo"/> <include refid="selectSzxcVoteResultVo"/>
<where> <where>
<if test="ysId != null "> and ys_id = #{ysId}</if>
<if test="jmId != null "> and jm_id = #{jmId}</if> <if test="jmId != null "> and jm_id = #{jmId}</if>
<if test="cardId != null and cardId != ''"> and card_id = #{cardId}</if> <if test="cardId != null and cardId != ''"> and card_id = #{cardId}</if>
<if test="voteName != null and voteName != ''"> and vote_name like concat('%', #{voteName}, '%')</if> <if test="voteName != null and voteName != ''"> and vote_name like concat('%', #{voteName}, '%')</if>
<if test="ysId != null "> and ys_id = #{ysId}</if> <if test="phone != null and phone != ''"> and phone = #{phone}</if>
<if test="vote != null and vote != ''"> and vote = #{vote}</if> <if test="vote != null and vote != ''"> and vote = #{vote}</if>
<if test="opinion != null and opinion != ''"> and opinion = #{opinion}</if> <if test="opinion != null and opinion != ''"> and opinion = #{opinion}</if>
<if test="userId != null "> and user_id = #{userId}</if> <if test="userId != null "> and user_id = #{userId}</if>
</where> </where>
</select> </select>
<select id="selectSzxcVoteResultById" parameterType="Long" resultMap="SzxcVoteResultResult"> <select id="selectSzxcVoteResultById" parameterType="Long" resultMap="SzxcVoteResultResult">
<include refid="selectSzxcVoteResultVo"/> <include refid="selectSzxcVoteResultVo"/>
where id = #{id} where id = #{id}
</select> </select>
<insert id="insertSzxcVoteResult" parameterType="SzxcVoteResult" useGeneratedKeys="true" keyProperty="id">
insert into szxc_vote_result
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="jmId != null">jm_id,</if>
<if test="cardId != null">card_id,</if>
<if test="voteName != null and voteName != ''">vote_name,</if>
<if test="ysId != null">ys_id,</if>
<if test="vote != null">vote,</if>
<if test="opinion != null">opinion,</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="userId != null">user_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="jmId != null">#{jmId},</if>
<if test="cardId != null">#{cardId},</if>
<if test="voteName != null and voteName != ''">#{voteName},</if>
<if test="ysId != null">#{ysId},</if>
<if test="vote != null">#{vote},</if>
<if test="opinion != null">#{opinion},</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="userId != null">#{userId},</if>
</trim>
</insert>
<update id="updateSzxcVoteResult" parameterType="SzxcVoteResult"> <!--通过议事id获取投票情况-->
update szxc_vote_result <select id="selectSzxcVoteResultByDiscussId" parameterType="Long" resultMap="YsResult">
<trim prefix="SET" suffixOverrides=","> SELECT ys_Id, COUNT(vote = "0" or null) ty,COUNT(vote = "1" or null) fd,COUNT(vote = "2" or null) qq
<if test="jmId != null">jm_id = #{jmId},</if> FROM `szxc_vote_result`
<if test="cardId != null">card_id = #{cardId},</if> <where>
<if test="voteName != null and voteName != ''">vote_name = #{voteName},</if> <if test="ysId != null "> ys_id = #{ysId}</if>
<if test="ysId != null">ys_id = #{ysId},</if> </where>
<if test="vote != null">vote = #{vote},</if> </select>
<if test="opinion != null">opinion = #{opinion},</if>
<if test="createBy != null">create_by = #{createBy},</if> <sql id="selectSzxcVoteResultVo">
<if test="createTime != null">create_time = #{createTime},</if> select id, ys_id, jm_id, card_id, vote_name, phone, vote, opinion, create_by, create_time, update_by, update_time, user_id from szxc_vote_result
<if test="updateBy != null">update_by = #{updateBy},</if> </sql>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="userId != null">user_id = #{userId},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSzxcVoteResultById" parameterType="Long"> <select id="selectSzxcVoteResultList" parameterType="SzxcVoteResult" resultMap="SzxcVoteResultResult">
delete from szxc_vote_result where id = #{id} <include refid="selectSzxcVoteResultVo"/>
</delete> <where>
<if test="ysId != null "> and ys_id = #{ysId}</if>
<if test="jmId != null "> and jm_id = #{jmId}</if>
<if test="cardId != null and cardId != ''"> and card_id = #{cardId}</if>
<if test="voteName != null and voteName != ''"> and vote_name like concat('%', #{voteName}, '%')</if>
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
<if test="vote != null and vote != ''"> and vote = #{vote}</if>
<if test="opinion != null and opinion != ''"> and opinion = #{opinion}</if>
<if test="userId != null "> and user_id = #{userId}</if>
</where>
</select>
<delete id="deleteSzxcVoteResultByIds" parameterType="String"> <select id="selectSzxcVoteResultById" parameterType="Long" resultMap="SzxcVoteResultResult">
delete from szxc_vote_result where id in <include refid="selectSzxcVoteResultVo"/>
<foreach item="id" collection="array" open="(" separator="," close=")"> where id = #{id}
#{id} </select>
</foreach>
</delete>
</mapper> </mapper>

@ -1,18 +1,18 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="居民id" prop="jmId"> <el-form-item label="公益id" prop="gyId">
<el-input <el-input
v-model="queryParams.jmId" v-model="queryParams.gyId"
placeholder="请输入居民id" placeholder="请输入公益id"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="公益id" prop="gyId"> <el-form-item label="居民id" prop="jmId">
<el-input <el-input
v-model="queryParams.gyId" v-model="queryParams.jmId"
placeholder="请输入公益id" placeholder="请输入居民id"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
@ -33,6 +33,14 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="手机号" prop="phone">
<el-input
v-model="queryParams.phone"
placeholder="请输入手机号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="创建者ID" prop="userId"> <el-form-item label="创建者ID" prop="userId">
<el-input <el-input
v-model="queryParams.userId" v-model="queryParams.userId"
@ -96,10 +104,11 @@
<el-table v-loading="loading" :data="applyList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="applyList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="id" align="center" prop="id" /> <el-table-column label="id" align="center" prop="id" />
<el-table-column label="居民id" align="center" prop="jmId" />
<el-table-column label="公益id" align="center" prop="gyId" /> <el-table-column label="公益id" align="center" prop="gyId" />
<el-table-column label="居民id" align="center" prop="jmId" />
<el-table-column label="身份证号" align="center" prop="cardId" /> <el-table-column label="身份证号" align="center" prop="cardId" />
<el-table-column label="报名人" align="center" prop="name" /> <el-table-column label="报名人" align="center" prop="name" />
<el-table-column label="手机号" align="center" prop="phone" />
<el-table-column label="创建者ID" align="center" prop="userId" /> <el-table-column label="创建者ID" align="center" prop="userId" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
@ -120,7 +129,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total>0"
:total="total" :total="total"
@ -132,18 +141,21 @@
<!-- 添加或修改公益报名情况对话框 --> <!-- 添加或修改公益报名情况对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="居民id" prop="jmId">
<el-input v-model="form.jmId" placeholder="请输入居民id" />
</el-form-item>
<el-form-item label="公益id" prop="gyId"> <el-form-item label="公益id" prop="gyId">
<el-input v-model="form.gyId" placeholder="请输入公益id" /> <el-input v-model="form.gyId" placeholder="请输入公益id" />
</el-form-item> </el-form-item>
<el-form-item label="居民id" prop="jmId">
<el-input v-model="form.jmId" placeholder="请输入居民id" />
</el-form-item>
<el-form-item label="身份证号" prop="cardId"> <el-form-item label="身份证号" prop="cardId">
<el-input v-model="form.cardId" placeholder="请输入身份证号" /> <el-input v-model="form.cardId" placeholder="请输入身份证号" />
</el-form-item> </el-form-item>
<el-form-item label="报名人" prop="name"> <el-form-item label="报名人" prop="name">
<el-input v-model="form.name" placeholder="请输入报名人" /> <el-input v-model="form.name" placeholder="请输入报名人" />
</el-form-item> </el-form-item>
<el-form-item label="手机号" prop="phone">
<el-input v-model="form.phone" placeholder="请输入手机号" />
</el-form-item>
<el-form-item label="创建者ID" prop="userId"> <el-form-item label="创建者ID" prop="userId">
<el-input v-model="form.userId" placeholder="请输入创建者ID" /> <el-input v-model="form.userId" placeholder="请输入创建者ID" />
</el-form-item> </el-form-item>
@ -157,152 +169,154 @@
</template> </template>
<script> <script>
import { listApply, getApply, delApply, addApply, updateApply } from "@/api/szxc/apply"; import { listApply, getApply, delApply, addApply, updateApply } from "@/api/szxc/apply";
export default { export default {
name: "Apply", name: "Apply",
data() { data() {
return { return {
// //
loading: true, loading: true,
// //
ids: [], ids: [],
// //
single: true, single: true,
// //
multiple: true, multiple: true,
// //
showSearch: true, showSearch: true,
// //
total: 0, total: 0,
// //
applyList: [], applyList: [],
// //
title: "", title: "",
// //
open: false, open: false,
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
jmId: null, gyId: null,
gyId: null, jmId: null,
cardId: null, cardId: null,
name: null, name: null,
userId: null phone: null,
}, userId: null
// },
form: {}, //
// form: {},
rules: { //
name: [ rules: {
{ required: true, message: "报名人不能为空", trigger: "blur" } name: [
], { required: true, message: "报名人不能为空", trigger: "blur" }
} ],
}; }
},
created() {
this.getList();
},
methods: {
/** 查询公益报名情况列表 */
getList() {
this.loading = true;
listApply(this.queryParams).then(response => {
this.applyList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
jmId: null,
gyId: null,
cardId: null,
name: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
userId: null
}; };
this.resetForm("form");
}, },
/** 搜索按钮操作 */ created() {
handleQuery() {
this.queryParams.pageNum = 1;
this.getList(); this.getList();
}, },
/** 重置按钮操作 */ methods: {
resetQuery() { /** 查询公益报名情况列表 */
this.resetForm("queryForm"); getList() {
this.handleQuery(); this.loading = true;
}, listApply(this.queryParams).then(response => {
// this.applyList = response.rows;
handleSelectionChange(selection) { this.total = response.total;
this.ids = selection.map(item => item.id) this.loading = false;
this.single = selection.length!==1 });
this.multiple = !selection.length },
}, //
/** 新增按钮操作 */ cancel() {
handleAdd() { this.open = false;
this.reset(); this.reset();
this.open = true; },
this.title = "添加公益报名情况"; //
}, reset() {
/** 修改按钮操作 */ this.form = {
handleUpdate(row) { id: null,
this.reset(); gyId: null,
const id = row.id || this.ids jmId: null,
getApply(id).then(response => { cardId: null,
this.form = response.data; name: null,
phone: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
userId: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true; this.open = true;
this.title = "修改公益报名情况"; this.title = "添加公益报名情况";
}); },
}, /** 修改按钮操作 */
/** 提交按钮 */ handleUpdate(row) {
submitForm() { this.reset();
this.$refs["form"].validate(valid => { const id = row.id || this.ids
if (valid) { getApply(id).then(response => {
if (this.form.id != null) { this.form = response.data;
updateApply(this.form).then(response => { this.open = true;
this.$modal.msgSuccess("修改成功"); this.title = "修改公益报名情况";
this.open = false; });
this.getList(); },
}); /** 提交按钮 */
} else { submitForm() {
addApply(this.form).then(response => { this.$refs["form"].validate(valid => {
this.$modal.msgSuccess("新增成功"); if (valid) {
this.open = false; if (this.form.id != null) {
this.getList(); updateApply(this.form).then(response => {
}); this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addApply(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
} }
} });
}); },
}, /** 删除按钮操作 */
/** 删除按钮操作 */ handleDelete(row) {
handleDelete(row) { const ids = row.id || this.ids;
const ids = row.id || this.ids; this.$modal.confirm('是否确认删除公益报名情况编号为"' + ids + '"的数据项?').then(function() {
this.$modal.confirm('是否确认删除公益报名情况编号为"' + ids + '"的数据项?').then(function() { return delApply(ids);
return delApply(ids); }).then(() => {
}).then(() => { this.getList();
this.getList(); this.$modal.msgSuccess("删除成功");
this.$modal.msgSuccess("删除成功"); }).catch(() => {});
}).catch(() => {}); },
}, /** 导出按钮操作 */
/** 导出按钮操作 */ handleExport() {
handleExport() { this.download('szxc/apply/export', {
this.download('szxc/apply/export', { ...this.queryParams
...this.queryParams }, `apply_${new Date().getTime()}.xlsx`)
}, `apply_${new Date().getTime()}.xlsx`) }
} }
} };
};
</script> </script>

Loading…
Cancel
Save