数据表添加、用户添加身份证号及验证

main
hansha 2 years ago
parent c5123d0c12
commit 8786e12d76

@ -65,6 +65,10 @@ public class SysProfileController extends BaseController
currentUser.setEmail(user.getEmail()); currentUser.setEmail(user.getEmail());
currentUser.setPhonenumber(user.getPhonenumber()); currentUser.setPhonenumber(user.getPhonenumber());
currentUser.setSex(user.getSex()); currentUser.setSex(user.getSex());
if (StringUtils.isNotEmpty(user.getCardId()) && !userService.checkCardIdUnique(currentUser))
{
return error("修改用户'" + loginUser.getUsername() + "'失败,身份证号已存在");
}
if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser)) if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser))
{ {
return error("修改用户'" + loginUser.getUsername() + "'失败,手机号码已存在"); return error("修改用户'" + loginUser.getUsername() + "'失败,手机号码已存在");

@ -1,21 +1,5 @@
package com.ruoyi.web.controller.system; package com.ruoyi.web.controller.system;
import java.util.List;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
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;
@ -31,6 +15,16 @@ import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.system.service.ISysPostService; import com.ruoyi.system.service.ISysPostService;
import com.ruoyi.system.service.ISysRoleService; import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.service.ISysUserService; import com.ruoyi.system.service.ISysUserService;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.stream.Collectors;
/** /**
* *
@ -128,6 +122,10 @@ public class SysUserController extends BaseController
{ {
return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在"); return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
} }
else if (StringUtils.isNotEmpty(user.getCardId()) && !userService.checkCardIdUnique(user))
{
return error("新增用户'" + user.getUserName() + "'失败,身份证号已存在");
}
else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
{ {
return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在"); return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
@ -158,8 +156,10 @@ public class SysUserController extends BaseController
else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
{ {
return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在"); return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
} }else if(StringUtils.isNotEmpty(user.getCardId()) && !userService.checkCardIdUnique(user))
else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) {
return error("修改用户'" + user.getUserName() + "'失败,身份证号已存在");
}else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
{ {
return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在"); return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
} }

@ -1,16 +1,19 @@
package com.ruoyi.common.core.domain.entity; package com.ruoyi.common.core.domain.entity;
import java.util.Date;
import java.util.List;
import javax.validation.constraints.*;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.annotation.Excel.ColumnType; import com.ruoyi.common.annotation.Excel.ColumnType;
import com.ruoyi.common.annotation.Excel.Type; import com.ruoyi.common.annotation.Excel.Type;
import com.ruoyi.common.annotation.Excels; import com.ruoyi.common.annotation.Excels;
import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.xss.Xss; import com.ruoyi.common.xss.Xss;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.util.Date;
import java.util.List;
/** /**
* sys_user * sys_user
@ -45,6 +48,10 @@ public class SysUser extends BaseEntity
@Excel(name = "手机号码") @Excel(name = "手机号码")
private String phonenumber; private String phonenumber;
/** 身份证号 */
@Excel(name = "身份证号")
private String cardId;
/** 用户性别 */ /** 用户性别 */
@Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知") @Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
private String sex; private String sex;
@ -177,6 +184,14 @@ public class SysUser extends BaseEntity
this.phonenumber = phonenumber; this.phonenumber = phonenumber;
} }
public void setCardId(String cardId)
{
this.cardId = cardId;
}
public String getCardId() {
return cardId;
}
public String getSex() public String getSex()
{ {
return sex; return sex;
@ -306,6 +321,7 @@ public class SysUser extends BaseEntity
.append("nickName", getNickName()) .append("nickName", getNickName())
.append("email", getEmail()) .append("email", getEmail())
.append("phonenumber", getPhonenumber()) .append("phonenumber", getPhonenumber())
.append("cardId", getCardId())
.append("sex", getSex()) .append("sex", getSex())
.append("avatar", getAvatar()) .append("avatar", getAvatar())
.append("password", getPassword()) .append("password", getPassword())

@ -1,8 +1,9 @@
package com.ruoyi.system.mapper; package com.ruoyi.system.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUser;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* *
@ -124,4 +125,12 @@ public interface SysUserMapper
* @return * @return
*/ */
public SysUser checkEmailUnique(String email); public SysUser checkEmailUnique(String email);
/**
* cardId
*
* @param cardId
* @return
*/
public SysUser checkCardIdUnique(String cardId);
} }

@ -1,8 +1,9 @@
package com.ruoyi.system.service; package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUser;
import java.util.List;
/** /**
* *
* *
@ -90,6 +91,14 @@ public interface ISysUserService
*/ */
public boolean checkEmailUnique(SysUser user); public boolean checkEmailUnique(SysUser user);
/**
* cardId
*
* @param user
* @return
*/
public boolean checkCardIdUnique(SysUser user);
/** /**
* *
* *

@ -1,15 +1,5 @@
package com.ruoyi.system.service.impl; package com.ruoyi.system.service.impl;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import javax.validation.Validator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.domain.entity.SysRole; import com.ruoyi.common.core.domain.entity.SysRole;
@ -22,13 +12,20 @@ import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.system.domain.SysPost; import com.ruoyi.system.domain.SysPost;
import com.ruoyi.system.domain.SysUserPost; import com.ruoyi.system.domain.SysUserPost;
import com.ruoyi.system.domain.SysUserRole; import com.ruoyi.system.domain.SysUserRole;
import com.ruoyi.system.mapper.SysPostMapper; import com.ruoyi.system.mapper.*;
import com.ruoyi.system.mapper.SysRoleMapper;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.mapper.SysUserPostMapper;
import com.ruoyi.system.mapper.SysUserRoleMapper;
import com.ruoyi.system.service.ISysConfigService; import com.ruoyi.system.service.ISysConfigService;
import com.ruoyi.system.service.ISysUserService; import com.ruoyi.system.service.ISysUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.validation.Validator;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/** /**
* *
@ -212,6 +209,24 @@ public class SysUserServiceImpl implements ISysUserService
return UserConstants.UNIQUE; return UserConstants.UNIQUE;
} }
/**
* email
*
* @param user
* @return
*/
@Override
public boolean checkCardIdUnique(SysUser user)
{
Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
SysUser info = userMapper.checkCardIdUnique(user.getCardId());
if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue())
{
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
}
/** /**
* *
* *

@ -11,6 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="nickName" column="nick_name" /> <result property="nickName" column="nick_name" />
<result property="email" column="email" /> <result property="email" column="email" />
<result property="phonenumber" column="phonenumber" /> <result property="phonenumber" column="phonenumber" />
<result property="cardId" column="card_id" />
<result property="sex" column="sex" /> <result property="sex" column="sex" />
<result property="avatar" column="avatar" /> <result property="avatar" column="avatar" />
<result property="password" column="password" /> <result property="password" column="password" />
@ -47,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectUserVo"> <sql id="selectUserVo">
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber,u.card_id, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
from sys_user u from sys_user u
@ -57,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql> </sql>
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult"> <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber,u.card_id, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
left join sys_dept d on u.dept_id = d.dept_id left join sys_dept d on u.dept_id = d.dept_id
where u.del_flag = '0' where u.del_flag = '0'
<if test="userId != null and userId != 0"> <if test="userId != null and userId != 0">
@ -72,6 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="phonenumber != null and phonenumber != ''"> <if test="phonenumber != null and phonenumber != ''">
AND u.phonenumber like concat('%', #{phonenumber}, '%') AND u.phonenumber like concat('%', #{phonenumber}, '%')
</if> </if>
<if test="cardId != null and cardId != ''"> and card_id = #{cardId}</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format(u.create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d') AND date_format(u.create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if> </if>
@ -86,7 +88,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult"> <select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber,u.card_id, u.status, u.create_time
from sys_user u from sys_user u
left join sys_dept d on u.dept_id = d.dept_id left join sys_dept d on u.dept_id = d.dept_id
left join sys_user_role ur on u.user_id = ur.user_id left join sys_user_role ur on u.user_id = ur.user_id
@ -98,12 +100,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="phonenumber != null and phonenumber != ''"> <if test="phonenumber != null and phonenumber != ''">
AND u.phonenumber like concat('%', #{phonenumber}, '%') AND u.phonenumber like concat('%', #{phonenumber}, '%')
</if> </if>
<if test="cardId != null and cardId != ''"> and card_id = #{cardId}</if>
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
${params.dataScope} ${params.dataScope}
</select> </select>
<select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult"> <select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber,u.card_id, u.status, u.create_time
from sys_user u from sys_user u
left join sys_dept d on u.dept_id = d.dept_id left join sys_dept d on u.dept_id = d.dept_id
left join sys_user_role ur on u.user_id = ur.user_id left join sys_user_role ur on u.user_id = ur.user_id
@ -116,6 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="phonenumber != null and phonenumber != ''"> <if test="phonenumber != null and phonenumber != ''">
AND u.phonenumber like concat('%', #{phonenumber}, '%') AND u.phonenumber like concat('%', #{phonenumber}, '%')
</if> </if>
<if test="cardId != null and cardId != ''"> and card_id = #{cardId}</if>
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
${params.dataScope} ${params.dataScope}
</select> </select>
@ -142,6 +146,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1 select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1
</select> </select>
<select id="checkCardIdUnique" parameterType="String" resultMap="SysUserResult">
select user_id, card_id from sys_user where card_id = #{cardId} and del_flag = '0' limit 1
</select>
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId"> <insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
insert into sys_user( insert into sys_user(
<if test="userId != null and userId != 0">user_id,</if> <if test="userId != null and userId != 0">user_id,</if>
@ -151,6 +159,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="email != null and email != ''">email,</if> <if test="email != null and email != ''">email,</if>
<if test="avatar != null and avatar != ''">avatar,</if> <if test="avatar != null and avatar != ''">avatar,</if>
<if test="phonenumber != null and phonenumber != ''">phonenumber,</if> <if test="phonenumber != null and phonenumber != ''">phonenumber,</if>
<if test="cardId != null">card_id,</if>
<if test="sex != null and sex != ''">sex,</if> <if test="sex != null and sex != ''">sex,</if>
<if test="password != null and password != ''">password,</if> <if test="password != null and password != ''">password,</if>
<if test="status != null and status != ''">status,</if> <if test="status != null and status != ''">status,</if>
@ -165,6 +174,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="email != null and email != ''">#{email},</if> <if test="email != null and email != ''">#{email},</if>
<if test="avatar != null and avatar != ''">#{avatar},</if> <if test="avatar != null and avatar != ''">#{avatar},</if>
<if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if> <if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if>
<if test="cardId != null">#{cardId},</if>
<if test="sex != null and sex != ''">#{sex},</if> <if test="sex != null and sex != ''">#{sex},</if>
<if test="password != null and password != ''">#{password},</if> <if test="password != null and password != ''">#{password},</if>
<if test="status != null and status != ''">#{status},</if> <if test="status != null and status != ''">#{status},</if>
@ -182,6 +192,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if> <if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
<if test="email != null ">email = #{email},</if> <if test="email != null ">email = #{email},</if>
<if test="phonenumber != null ">phonenumber = #{phonenumber},</if> <if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
<if test="cardId != null">card_id = #{cardId},</if>
<if test="sex != null and sex != ''">sex = #{sex},</if> <if test="sex != null and sex != ''">sex = #{sex},</if>
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if> <if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
<if test="password != null and password != ''">password = #{password},</if> <if test="password != null and password != ''">password = #{password},</if>

@ -1,48 +1,42 @@
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.szxc.domain.News;
import com.ruoyi.szxc.service.INewsService;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.szxc.domain.SzxcNews;
import com.ruoyi.szxc.service.ISzxcNewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/** /**
* Controller * Controller
* *
* @author hs * @author hs
* @date 2024-03-15 * @date 2024-03-16
*/ */
@RestController @RestController
@RequestMapping("/szxc/news") @RequestMapping("/szxc/news")
public class NewsController extends BaseController public class SzxcNewsController extends BaseController
{ {
@Autowired @Autowired
private INewsService newsService; private ISzxcNewsService szxcNewsService;
/** /**
* *
*/ */
@PreAuthorize("@ss.hasPermi('szxc:news:list')") @PreAuthorize("@ss.hasPermi('szxc:news:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(News news) public TableDataInfo list(SzxcNews szxcNews)
{ {
startPage(); startPage();
List<News> list = newsService.selectNewsList(news); List<SzxcNews> list = szxcNewsService.selectSzxcNewsList(szxcNews);
return getDataTable(list); return getDataTable(list);
} }
@ -52,10 +46,10 @@ public class NewsController extends BaseController
@PreAuthorize("@ss.hasPermi('szxc:news:export')") @PreAuthorize("@ss.hasPermi('szxc:news:export')")
@Log(title = "公告资讯", businessType = BusinessType.EXPORT) @Log(title = "公告资讯", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, News news) public void export(HttpServletResponse response, SzxcNews szxcNews)
{ {
List<News> list = newsService.selectNewsList(news); List<SzxcNews> list = szxcNewsService.selectSzxcNewsList(szxcNews);
ExcelUtil<News> util = new ExcelUtil<News>(News.class); ExcelUtil<SzxcNews> util = new ExcelUtil<SzxcNews>(SzxcNews.class);
util.exportExcel(response, list, "公告资讯数据"); util.exportExcel(response, list, "公告资讯数据");
} }
@ -66,7 +60,7 @@ public class NewsController extends BaseController
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id)
{ {
return success(newsService.selectNewsById(id)); return success(szxcNewsService.selectSzxcNewsById(id));
} }
/** /**
@ -75,9 +69,9 @@ public class NewsController extends BaseController
@PreAuthorize("@ss.hasPermi('szxc:news:add')") @PreAuthorize("@ss.hasPermi('szxc:news:add')")
@Log(title = "公告资讯", businessType = BusinessType.INSERT) @Log(title = "公告资讯", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody News news) public AjaxResult add(@RequestBody SzxcNews szxcNews)
{ {
return toAjax(newsService.insertNews(news)); return toAjax(szxcNewsService.insertSzxcNews(szxcNews));
} }
/** /**
@ -86,9 +80,9 @@ public class NewsController extends BaseController
@PreAuthorize("@ss.hasPermi('szxc:news:edit')") @PreAuthorize("@ss.hasPermi('szxc:news:edit')")
@Log(title = "公告资讯", businessType = BusinessType.UPDATE) @Log(title = "公告资讯", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody News news) public AjaxResult edit(@RequestBody SzxcNews szxcNews)
{ {
return toAjax(newsService.updateNews(news)); return toAjax(szxcNewsService.updateSzxcNews(szxcNews));
} }
/** /**
@ -99,6 +93,6 @@ public class NewsController extends BaseController
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) public AjaxResult remove(@PathVariable Long[] ids)
{ {
return toAjax(newsService.deleteNewsByIds(ids)); return toAjax(szxcNewsService.deleteSzxcNewsByIds(ids));
} }
} }

@ -0,0 +1,49 @@
package com.ruoyi.szxc.domain;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* szxc_jm_car
*
* @author hs
* @date 2024-03-16
*/
public class SzxcJmCar extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 居民id */
private Long jmId;
/** 车辆id */
private Long carId;
public void setJmId(Long jmId)
{
this.jmId = jmId;
}
public Long getJmId()
{
return jmId;
}
public void setCarId(Long carId)
{
this.carId = carId;
}
public Long getCarId()
{
return carId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("jmId", getJmId())
.append("carId", getCarId())
.toString();
}
}

@ -0,0 +1,50 @@
package com.ruoyi.szxc.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* szxc_jm_house
*
* @author hs
* @date 2024-03-16
*/
public class SzxcJmHouse extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 居民id */
private Long jmId;
/** 房屋id */
private Long houseId;
public void setJmId(Long jmId)
{
this.jmId = jmId;
}
public Long getJmId()
{
return jmId;
}
public void setHouseId(Long houseId)
{
this.houseId = houseId;
}
public Long getHouseId()
{
return houseId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("jmId", getJmId())
.append("houseId", getHouseId())
.toString();
}
}

@ -1,17 +1,18 @@
package com.ruoyi.szxc.domain; package com.ruoyi.szxc.domain;
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.ToStringStyle;
import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/** /**
* szxc_jm_info * szxc_jm_info
* *
* @author hs * @author hs
* @date 2024-03-15 * @date 2024-03-16
*/ */
public class SzxcJmInfo extends BaseEntity public class SzxcJmInfo extends BaseEntity
{ {
@ -42,7 +43,7 @@ public class SzxcJmInfo extends BaseEntity
/** 身份证号 */ /** 身份证号 */
@Excel(name = "身份证号") @Excel(name = "身份证号")
private String idCard; private String cardId;
/** 出生日期 */ /** 出生日期 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@ -53,8 +54,8 @@ public class SzxcJmInfo extends BaseEntity
@Excel(name = "年龄") @Excel(name = "年龄")
private Long age; private Long age;
/** 用户性别0男 1女 */ /** 性别0男 1女 2未知 */
@Excel(name = "用户性别", readConverterExp = "0=男,1=女") @Excel(name = "性别", readConverterExp = "0=男,1=女,2=未知")
private String sex; private String sex;
/** 籍贯 */ /** 籍贯 */
@ -151,14 +152,14 @@ public class SzxcJmInfo extends BaseEntity
{ {
return nationality; return nationality;
} }
public void setIdCard(String idCard) public void setCardId(String cardId)
{ {
this.idCard = idCard; this.cardId = cardId;
} }
public String getIdCard() public String getCardId()
{ {
return idCard; return cardId;
} }
public void setBornDate(Date bornDate) public void setBornDate(Date bornDate)
{ {
@ -287,7 +288,7 @@ public class SzxcJmInfo extends BaseEntity
.append("name", getName()) .append("name", getName())
.append("oldName", getOldName()) .append("oldName", getOldName())
.append("nationality", getNationality()) .append("nationality", getNationality())
.append("idCard", getIdCard()) .append("cardId", getCardId())
.append("bornDate", getBornDate()) .append("bornDate", getBornDate())
.append("age", getAge()) .append("age", getAge())
.append("sex", getSex()) .append("sex", getSex())

@ -0,0 +1,50 @@
package com.ruoyi.szxc.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* szxc_jm_tag
*
* @author hs
* @date 2024-03-16
*/
public class SzxcJmTag extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 居民id */
private Long jmId;
/** 标签id */
private Long tagId;
public void setJmId(Long jmId)
{
this.jmId = jmId;
}
public Long getJmId()
{
return jmId;
}
public void setTagId(Long tagId)
{
this.tagId = tagId;
}
public Long getTagId()
{
return tagId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("jmId", getJmId())
.append("tagId", getTagId())
.toString();
}
}

@ -6,12 +6,12 @@ import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;
/** /**
* news * szxc_news
* *
* @author hs * @author hs
* @date 2024-03-15 * @date 2024-03-16
*/ */
public class News extends BaseEntity public class SzxcNews extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

@ -0,0 +1,62 @@
package com.ruoyi.szxc.mapper;
import com.ruoyi.szxc.domain.SzxcJmCar;
import java.util.List;
/**
* Mapper
*
* @author hs
* @date 2024-03-16
*/
public interface SzxcJmCarMapper
{
/**
*
*
* @param jmId
* @return
*/
public SzxcJmCar selectSzxcJmCarByJmId(Long jmId);
/**
*
*
* @param szxcJmCar
* @return
*/
public List<SzxcJmCar> selectSzxcJmCarList(SzxcJmCar szxcJmCar);
/**
*
*
* @param szxcJmCar
* @return
*/
public int insertSzxcJmCar(SzxcJmCar szxcJmCar);
/**
*
*
* @param szxcJmCar
* @return
*/
public int updateSzxcJmCar(SzxcJmCar szxcJmCar);
/**
*
*
* @param jmId
* @return
*/
public int deleteSzxcJmCarByJmId(Long jmId);
/**
*
*
* @param jmIds
* @return
*/
public int deleteSzxcJmCarByJmIds(Long[] jmIds);
}

@ -0,0 +1,61 @@
package com.ruoyi.szxc.mapper;
import java.util.List;
import com.ruoyi.szxc.domain.SzxcJmHouse;
/**
* Mapper
*
* @author hs
* @date 2024-03-16
*/
public interface SzxcJmHouseMapper
{
/**
*
*
* @param jmId
* @return
*/
public SzxcJmHouse selectSzxcJmHouseByJmId(Long jmId);
/**
*
*
* @param szxcJmHouse
* @return
*/
public List<SzxcJmHouse> selectSzxcJmHouseList(SzxcJmHouse szxcJmHouse);
/**
*
*
* @param szxcJmHouse
* @return
*/
public int insertSzxcJmHouse(SzxcJmHouse szxcJmHouse);
/**
*
*
* @param szxcJmHouse
* @return
*/
public int updateSzxcJmHouse(SzxcJmHouse szxcJmHouse);
/**
*
*
* @param jmId
* @return
*/
public int deleteSzxcJmHouseByJmId(Long jmId);
/**
*
*
* @param jmIds
* @return
*/
public int deleteSzxcJmHouseByJmIds(Long[] jmIds);
}

@ -0,0 +1,61 @@
package com.ruoyi.szxc.mapper;
import java.util.List;
import com.ruoyi.szxc.domain.SzxcJmTag;
/**
* Mapper
*
* @author hs
* @date 2024-03-16
*/
public interface SzxcJmTagMapper
{
/**
*
*
* @param jmId
* @return
*/
public SzxcJmTag selectSzxcJmTagByJmId(Long jmId);
/**
*
*
* @param szxcJmTag
* @return
*/
public List<SzxcJmTag> selectSzxcJmTagList(SzxcJmTag szxcJmTag);
/**
*
*
* @param szxcJmTag
* @return
*/
public int insertSzxcJmTag(SzxcJmTag szxcJmTag);
/**
*
*
* @param szxcJmTag
* @return
*/
public int updateSzxcJmTag(SzxcJmTag szxcJmTag);
/**
*
*
* @param jmId
* @return
*/
public int deleteSzxcJmTagByJmId(Long jmId);
/**
*
*
* @param jmIds
* @return
*/
public int deleteSzxcJmTagByJmIds(Long[] jmIds);
}

@ -1,16 +1,15 @@
package com.ruoyi.szxc.mapper; package com.ruoyi.szxc.mapper;
import com.ruoyi.szxc.domain.News;
import java.util.List; import java.util.List;
import com.ruoyi.szxc.domain.SzxcNews;
/** /**
* Mapper * Mapper
* *
* @author hs * @author hs
* @date 2024-03-15 * @date 2024-03-16
*/ */
public interface NewsMapper public interface SzxcNewsMapper
{ {
/** /**
* *
@ -18,31 +17,31 @@ public interface NewsMapper
* @param id * @param id
* @return * @return
*/ */
public News selectNewsById(Long id); public SzxcNews selectSzxcNewsById(Long id);
/** /**
* *
* *
* @param news * @param szxcNews
* @return * @return
*/ */
public List<News> selectNewsList(News news); public List<SzxcNews> selectSzxcNewsList(SzxcNews szxcNews);
/** /**
* *
* *
* @param news * @param szxcNews
* @return * @return
*/ */
public int insertNews(News news); public int insertSzxcNews(SzxcNews szxcNews);
/** /**
* *
* *
* @param news * @param szxcNews
* @return * @return
*/ */
public int updateNews(News news); public int updateSzxcNews(SzxcNews szxcNews);
/** /**
* *
@ -50,7 +49,7 @@ public interface NewsMapper
* @param id * @param id
* @return * @return
*/ */
public int deleteNewsById(Long id); public int deleteSzxcNewsById(Long id);
/** /**
* *
@ -58,5 +57,5 @@ public interface NewsMapper
* @param ids * @param ids
* @return * @return
*/ */
public int deleteNewsByIds(Long[] ids); public int deleteSzxcNewsByIds(Long[] ids);
} }

@ -0,0 +1,62 @@
package com.ruoyi.szxc.service;
import com.ruoyi.szxc.domain.SzxcJmCar;
import java.util.List;
/**
* Service
*
* @author hs
* @date 2024-03-16
*/
public interface ISzxcJmCarService
{
/**
*
*
* @param jmId
* @return
*/
public SzxcJmCar selectSzxcJmCarByJmId(Long jmId);
/**
*
*
* @param szxcJmCar
* @return
*/
public List<SzxcJmCar> selectSzxcJmCarList(SzxcJmCar szxcJmCar);
/**
*
*
* @param szxcJmCar
* @return
*/
public int insertSzxcJmCar(SzxcJmCar szxcJmCar);
/**
*
*
* @param szxcJmCar
* @return
*/
public int updateSzxcJmCar(SzxcJmCar szxcJmCar);
/**
*
*
* @param jmIds
* @return
*/
public int deleteSzxcJmCarByJmIds(Long[] jmIds);
/**
*
*
* @param jmId
* @return
*/
public int deleteSzxcJmCarByJmId(Long jmId);
}

@ -0,0 +1,61 @@
package com.ruoyi.szxc.service;
import java.util.List;
import com.ruoyi.szxc.domain.SzxcJmHouse;
/**
* Service
*
* @author hs
* @date 2024-03-16
*/
public interface ISzxcJmHouseService
{
/**
*
*
* @param jmId
* @return
*/
public SzxcJmHouse selectSzxcJmHouseByJmId(Long jmId);
/**
*
*
* @param szxcJmHouse
* @return
*/
public List<SzxcJmHouse> selectSzxcJmHouseList(SzxcJmHouse szxcJmHouse);
/**
*
*
* @param szxcJmHouse
* @return
*/
public int insertSzxcJmHouse(SzxcJmHouse szxcJmHouse);
/**
*
*
* @param szxcJmHouse
* @return
*/
public int updateSzxcJmHouse(SzxcJmHouse szxcJmHouse);
/**
*
*
* @param jmIds
* @return
*/
public int deleteSzxcJmHouseByJmIds(Long[] jmIds);
/**
*
*
* @param jmId
* @return
*/
public int deleteSzxcJmHouseByJmId(Long jmId);
}

@ -0,0 +1,61 @@
package com.ruoyi.szxc.service;
import java.util.List;
import com.ruoyi.szxc.domain.SzxcJmTag;
/**
* Service
*
* @author hs
* @date 2024-03-16
*/
public interface ISzxcJmTagService
{
/**
*
*
* @param jmId
* @return
*/
public SzxcJmTag selectSzxcJmTagByJmId(Long jmId);
/**
*
*
* @param szxcJmTag
* @return
*/
public List<SzxcJmTag> selectSzxcJmTagList(SzxcJmTag szxcJmTag);
/**
*
*
* @param szxcJmTag
* @return
*/
public int insertSzxcJmTag(SzxcJmTag szxcJmTag);
/**
*
*
* @param szxcJmTag
* @return
*/
public int updateSzxcJmTag(SzxcJmTag szxcJmTag);
/**
*
*
* @param jmIds
* @return
*/
public int deleteSzxcJmTagByJmIds(Long[] jmIds);
/**
*
*
* @param jmId
* @return
*/
public int deleteSzxcJmTagByJmId(Long jmId);
}

@ -1,16 +1,15 @@
package com.ruoyi.szxc.service; package com.ruoyi.szxc.service;
import com.ruoyi.szxc.domain.News;
import java.util.List; import java.util.List;
import com.ruoyi.szxc.domain.SzxcNews;
/** /**
* Service * Service
* *
* @author hs * @author hs
* @date 2024-03-15 * @date 2024-03-16
*/ */
public interface INewsService public interface ISzxcNewsService
{ {
/** /**
* *
@ -18,31 +17,31 @@ public interface INewsService
* @param id * @param id
* @return * @return
*/ */
public News selectNewsById(Long id); public SzxcNews selectSzxcNewsById(Long id);
/** /**
* *
* *
* @param news * @param szxcNews
* @return * @return
*/ */
public List<News> selectNewsList(News news); public List<SzxcNews> selectSzxcNewsList(SzxcNews szxcNews);
/** /**
* *
* *
* @param news * @param szxcNews
* @return * @return
*/ */
public int insertNews(News news); public int insertSzxcNews(SzxcNews szxcNews);
/** /**
* *
* *
* @param news * @param szxcNews
* @return * @return
*/ */
public int updateNews(News news); public int updateSzxcNews(SzxcNews szxcNews);
/** /**
* *
@ -50,7 +49,7 @@ public interface INewsService
* @param ids * @param ids
* @return * @return
*/ */
public int deleteNewsByIds(Long[] ids); public int deleteSzxcNewsByIds(Long[] ids);
/** /**
* *
@ -58,5 +57,5 @@ public interface INewsService
* @param id * @param id
* @return * @return
*/ */
public int deleteNewsById(Long id); public int deleteSzxcNewsById(Long id);
} }

@ -1,97 +0,0 @@
package com.ruoyi.szxc.service.impl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.szxc.domain.News;
import com.ruoyi.szxc.mapper.NewsMapper;
import com.ruoyi.szxc.service.INewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author hs
* @date 2024-03-15
*/
@Service
public class NewsServiceImpl implements INewsService
{
@Autowired
private NewsMapper newsMapper;
/**
*
*
* @param id
* @return
*/
@Override
public News selectNewsById(Long id)
{
return newsMapper.selectNewsById(id);
}
/**
*
*
* @param news
* @return
*/
@Override
public List<News> selectNewsList(News news)
{
return newsMapper.selectNewsList(news);
}
/**
*
*
* @param news
* @return
*/
@Override
public int insertNews(News news)
{
news.setCreateTime(DateUtils.getNowDate());
return newsMapper.insertNews(news);
}
/**
*
*
* @param news
* @return
*/
@Override
public int updateNews(News news)
{
news.setUpdateTime(DateUtils.getNowDate());
return newsMapper.updateNews(news);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteNewsByIds(Long[] ids)
{
return newsMapper.deleteNewsByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteNewsById(Long id)
{
return newsMapper.deleteNewsById(id);
}
}

@ -0,0 +1,94 @@
package com.ruoyi.szxc.service.impl;
import com.ruoyi.szxc.domain.SzxcJmCar;
import com.ruoyi.szxc.mapper.SzxcJmCarMapper;
import com.ruoyi.szxc.service.ISzxcJmCarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author hs
* @date 2024-03-16
*/
@Service
public class SzxcJmCarServiceImpl implements ISzxcJmCarService
{
@Autowired
private SzxcJmCarMapper szxcJmCarMapper;
/**
*
*
* @param jmId
* @return
*/
@Override
public SzxcJmCar selectSzxcJmCarByJmId(Long jmId)
{
return szxcJmCarMapper.selectSzxcJmCarByJmId(jmId);
}
/**
*
*
* @param szxcJmCar
* @return
*/
@Override
public List<SzxcJmCar> selectSzxcJmCarList(SzxcJmCar szxcJmCar)
{
return szxcJmCarMapper.selectSzxcJmCarList(szxcJmCar);
}
/**
*
*
* @param szxcJmCar
* @return
*/
@Override
public int insertSzxcJmCar(SzxcJmCar szxcJmCar)
{
return szxcJmCarMapper.insertSzxcJmCar(szxcJmCar);
}
/**
*
*
* @param szxcJmCar
* @return
*/
@Override
public int updateSzxcJmCar(SzxcJmCar szxcJmCar)
{
return szxcJmCarMapper.updateSzxcJmCar(szxcJmCar);
}
/**
*
*
* @param jmIds
* @return
*/
@Override
public int deleteSzxcJmCarByJmIds(Long[] jmIds)
{
return szxcJmCarMapper.deleteSzxcJmCarByJmIds(jmIds);
}
/**
*
*
* @param jmId
* @return
*/
@Override
public int deleteSzxcJmCarByJmId(Long jmId)
{
return szxcJmCarMapper.deleteSzxcJmCarByJmId(jmId);
}
}

@ -0,0 +1,93 @@
package com.ruoyi.szxc.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.szxc.mapper.SzxcJmHouseMapper;
import com.ruoyi.szxc.domain.SzxcJmHouse;
import com.ruoyi.szxc.service.ISzxcJmHouseService;
/**
* Service
*
* @author hs
* @date 2024-03-16
*/
@Service
public class SzxcJmHouseServiceImpl implements ISzxcJmHouseService
{
@Autowired
private SzxcJmHouseMapper szxcJmHouseMapper;
/**
*
*
* @param jmId
* @return
*/
@Override
public SzxcJmHouse selectSzxcJmHouseByJmId(Long jmId)
{
return szxcJmHouseMapper.selectSzxcJmHouseByJmId(jmId);
}
/**
*
*
* @param szxcJmHouse
* @return
*/
@Override
public List<SzxcJmHouse> selectSzxcJmHouseList(SzxcJmHouse szxcJmHouse)
{
return szxcJmHouseMapper.selectSzxcJmHouseList(szxcJmHouse);
}
/**
*
*
* @param szxcJmHouse
* @return
*/
@Override
public int insertSzxcJmHouse(SzxcJmHouse szxcJmHouse)
{
return szxcJmHouseMapper.insertSzxcJmHouse(szxcJmHouse);
}
/**
*
*
* @param szxcJmHouse
* @return
*/
@Override
public int updateSzxcJmHouse(SzxcJmHouse szxcJmHouse)
{
return szxcJmHouseMapper.updateSzxcJmHouse(szxcJmHouse);
}
/**
*
*
* @param jmIds
* @return
*/
@Override
public int deleteSzxcJmHouseByJmIds(Long[] jmIds)
{
return szxcJmHouseMapper.deleteSzxcJmHouseByJmIds(jmIds);
}
/**
*
*
* @param jmId
* @return
*/
@Override
public int deleteSzxcJmHouseByJmId(Long jmId)
{
return szxcJmHouseMapper.deleteSzxcJmHouseByJmId(jmId);
}
}

@ -0,0 +1,93 @@
package com.ruoyi.szxc.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.szxc.mapper.SzxcJmTagMapper;
import com.ruoyi.szxc.domain.SzxcJmTag;
import com.ruoyi.szxc.service.ISzxcJmTagService;
/**
* Service
*
* @author hs
* @date 2024-03-16
*/
@Service
public class SzxcJmTagServiceImpl implements ISzxcJmTagService
{
@Autowired
private SzxcJmTagMapper szxcJmTagMapper;
/**
*
*
* @param jmId
* @return
*/
@Override
public SzxcJmTag selectSzxcJmTagByJmId(Long jmId)
{
return szxcJmTagMapper.selectSzxcJmTagByJmId(jmId);
}
/**
*
*
* @param szxcJmTag
* @return
*/
@Override
public List<SzxcJmTag> selectSzxcJmTagList(SzxcJmTag szxcJmTag)
{
return szxcJmTagMapper.selectSzxcJmTagList(szxcJmTag);
}
/**
*
*
* @param szxcJmTag
* @return
*/
@Override
public int insertSzxcJmTag(SzxcJmTag szxcJmTag)
{
return szxcJmTagMapper.insertSzxcJmTag(szxcJmTag);
}
/**
*
*
* @param szxcJmTag
* @return
*/
@Override
public int updateSzxcJmTag(SzxcJmTag szxcJmTag)
{
return szxcJmTagMapper.updateSzxcJmTag(szxcJmTag);
}
/**
*
*
* @param jmIds
* @return
*/
@Override
public int deleteSzxcJmTagByJmIds(Long[] jmIds)
{
return szxcJmTagMapper.deleteSzxcJmTagByJmIds(jmIds);
}
/**
*
*
* @param jmId
* @return
*/
@Override
public int deleteSzxcJmTagByJmId(Long jmId)
{
return szxcJmTagMapper.deleteSzxcJmTagByJmId(jmId);
}
}

@ -0,0 +1,97 @@
package com.ruoyi.szxc.service.impl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.szxc.domain.SzxcNews;
import com.ruoyi.szxc.mapper.SzxcNewsMapper;
import com.ruoyi.szxc.service.ISzxcNewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author hs
* @date 2024-03-16
*/
@Service
public class SzxcNewsServiceImpl implements ISzxcNewsService
{
@Autowired
private SzxcNewsMapper szxcNewsMapper;
/**
*
*
* @param id
* @return
*/
@Override
public SzxcNews selectSzxcNewsById(Long id)
{
return szxcNewsMapper.selectSzxcNewsById(id);
}
/**
*
*
* @param szxcNews
* @return
*/
@Override
public List<SzxcNews> selectSzxcNewsList(SzxcNews szxcNews)
{
return szxcNewsMapper.selectSzxcNewsList(szxcNews);
}
/**
*
*
* @param szxcNews
* @return
*/
@Override
public int insertSzxcNews(SzxcNews szxcNews)
{
szxcNews.setCreateTime(DateUtils.getNowDate());
return szxcNewsMapper.insertSzxcNews(szxcNews);
}
/**
*
*
* @param szxcNews
* @return
*/
@Override
public int updateSzxcNews(SzxcNews szxcNews)
{
szxcNews.setUpdateTime(DateUtils.getNowDate());
return szxcNewsMapper.updateSzxcNews(szxcNews);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteSzxcNewsByIds(Long[] ids)
{
return szxcNewsMapper.deleteSzxcNewsByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteSzxcNewsById(Long id)
{
return szxcNewsMapper.deleteSzxcNewsById(id);
}
}

@ -11,7 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="name" column="name" /> <result property="name" column="name" />
<result property="oldName" column="old_name" /> <result property="oldName" column="old_name" />
<result property="nationality" column="nationality" /> <result property="nationality" column="nationality" />
<result property="idCard" column="id_card" /> <result property="cardId" column="card_id" />
<result property="bornDate" column="born_date" /> <result property="bornDate" column="born_date" />
<result property="age" column="age" /> <result property="age" column="age" />
<result property="sex" column="sex" /> <result property="sex" column="sex" />
@ -32,7 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectSzxcJmInfoVo"> <sql id="selectSzxcJmInfoVo">
select id, dept_id, dept_name, name, old_name, nationality, id_card, born_date, age, sex, jg, relation, jg_nature, long_live, hj_address, phone, head, same_head_ids, off, create_by, create_time, update_by, update_time, user_id from szxc_jm_info select id, dept_id, dept_name, name, old_name, nationality, card_id, born_date, age, sex, jg, relation, jg_nature, long_live, hj_address, phone, head, same_head_ids, off, create_by, create_time, update_by, update_time, user_id from szxc_jm_info
</sql> </sql>
<select id="selectSzxcJmInfoList" parameterType="SzxcJmInfo" resultMap="SzxcJmInfoResult"> <select id="selectSzxcJmInfoList" parameterType="SzxcJmInfo" resultMap="SzxcJmInfoResult">
@ -43,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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="oldName != null and oldName != ''"> and old_name like concat('%', #{oldName}, '%')</if> <if test="oldName != null and oldName != ''"> and old_name like concat('%', #{oldName}, '%')</if>
<if test="nationality != null and nationality != ''"> and nationality = #{nationality}</if> <if test="nationality != null and nationality != ''"> and nationality = #{nationality}</if>
<if test="idCard != null and idCard != ''"> and id_card = #{idCard}</if> <if test="cardId != null and cardId != ''"> and card_id = #{cardId}</if>
<if test="bornDate != null "> and born_date = #{bornDate}</if> <if test="bornDate != null "> and born_date = #{bornDate}</if>
<if test="age != null "> and age = #{age}</if> <if test="age != null "> and age = #{age}</if>
<if test="sex != null and sex != ''"> and sex = #{sex}</if> <if test="sex != null and sex != ''"> and sex = #{sex}</if>
@ -73,7 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="name != null">name,</if> <if test="name != null">name,</if>
<if test="oldName != null">old_name,</if> <if test="oldName != null">old_name,</if>
<if test="nationality != null">nationality,</if> <if test="nationality != null">nationality,</if>
<if test="idCard != null">id_card,</if> <if test="cardId != null">card_id,</if>
<if test="bornDate != null">born_date,</if> <if test="bornDate != null">born_date,</if>
<if test="age != null">age,</if> <if test="age != null">age,</if>
<if test="sex != null">sex,</if> <if test="sex != null">sex,</if>
@ -98,7 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="name != null">#{name},</if> <if test="name != null">#{name},</if>
<if test="oldName != null">#{oldName},</if> <if test="oldName != null">#{oldName},</if>
<if test="nationality != null">#{nationality},</if> <if test="nationality != null">#{nationality},</if>
<if test="idCard != null">#{idCard},</if> <if test="cardId != null">#{cardId},</if>
<if test="bornDate != null">#{bornDate},</if> <if test="bornDate != null">#{bornDate},</if>
<if test="age != null">#{age},</if> <if test="age != null">#{age},</if>
<if test="sex != null">#{sex},</if> <if test="sex != null">#{sex},</if>
@ -127,7 +127,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="name != null">name = #{name},</if> <if test="name != null">name = #{name},</if>
<if test="oldName != null">old_name = #{oldName},</if> <if test="oldName != null">old_name = #{oldName},</if>
<if test="nationality != null">nationality = #{nationality},</if> <if test="nationality != null">nationality = #{nationality},</if>
<if test="idCard != null">id_card = #{idCard},</if> <if test="cardId != null">card_id = #{cardId},</if>
<if test="bornDate != null">born_date = #{bornDate},</if> <if test="bornDate != null">born_date = #{bornDate},</if>
<if test="age != null">age = #{age},</if> <if test="age != null">age = #{age},</if>
<if test="sex != null">sex = #{sex},</if> <if test="sex != null">sex = #{sex},</if>

@ -2,9 +2,9 @@
<!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.NewsMapper"> <mapper namespace="com.ruoyi.szxc.mapper.SzxcNewsMapper">
<resultMap type="News" id="NewsResult"> <resultMap type="SzxcNews" id="SzxcNewsResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="title" column="title" /> <result property="title" column="title" />
<result property="type" column="type" /> <result property="type" column="type" />
@ -20,12 +20,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="userId" column="user_id" /> <result property="userId" column="user_id" />
</resultMap> </resultMap>
<sql id="selectNewsVo"> <sql id="selectSzxcNewsVo">
select id, title, type, picture, content, leave, create_by, create_time, update_by, update_time, dept_id, dept_name, user_id from news select id, title, type, picture, content, leave, create_by, create_time, update_by, update_time, dept_id, dept_name, user_id from szxc_news
</sql> </sql>
<select id="selectNewsList" parameterType="News" resultMap="NewsResult"> <select id="selectSzxcNewsList" parameterType="SzxcNews" resultMap="SzxcNewsResult">
<include refid="selectNewsVo"/> <include refid="selectSzxcNewsVo"/>
<where> <where>
<if test="title != null and title != ''"> and title = #{title}</if> <if test="title != null and title != ''"> and title = #{title}</if>
<if test="type != null and type != ''"> and type = #{type}</if> <if test="type != null and type != ''"> and type = #{type}</if>
@ -38,13 +38,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
</select> </select>
<select id="selectNewsById" parameterType="Long" resultMap="NewsResult"> <select id="selectSzxcNewsById" parameterType="Long" resultMap="SzxcNewsResult">
<include refid="selectNewsVo"/> <include refid="selectSzxcNewsVo"/>
where id = #{id} where id = #{id}
</select> </select>
<insert id="insertNews" parameterType="News" useGeneratedKeys="true" keyProperty="id"> <insert id="insertSzxcNews" parameterType="SzxcNews" useGeneratedKeys="true" keyProperty="id">
insert into news insert into szxc_news
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="title != null and title != ''">title,</if> <if test="title != null and title != ''">title,</if>
<if test="type != null">type,</if> <if test="type != null">type,</if>
@ -75,8 +75,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim> </trim>
</insert> </insert>
<update id="updateNews" parameterType="News"> <update id="updateSzxcNews" parameterType="SzxcNews">
update news update szxc_news
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="title != null and title != ''">title = #{title},</if> <if test="title != null and title != ''">title = #{title},</if>
<if test="type != null">type = #{type},</if> <if test="type != null">type = #{type},</if>
@ -94,12 +94,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id} where id = #{id}
</update> </update>
<delete id="deleteNewsById" parameterType="Long"> <delete id="deleteSzxcNewsById" parameterType="Long">
delete from news where id = #{id} delete from szxc_news where id = #{id}
</delete> </delete>
<delete id="deleteNewsByIds" parameterType="String"> <delete id="deleteSzxcNewsByIds" parameterType="String">
delete from news where id in delete from szxc_news where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>

@ -41,9 +41,9 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="身份证号" prop="idCard"> <el-form-item label="身份证号" prop="cardId">
<el-input <el-input
v-model="queryParams.idCard" v-model="queryParams.cardId"
placeholder="请输入身份证号" placeholder="请输入身份证号"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
@ -205,14 +205,14 @@
<el-table-column label="姓名" align="center" prop="name" /> <el-table-column label="姓名" align="center" prop="name" />
<el-table-column label="曾用名" align="center" prop="oldName" /> <el-table-column label="曾用名" align="center" prop="oldName" />
<el-table-column label="国籍" align="center" prop="nationality" /> <el-table-column label="国籍" align="center" prop="nationality" />
<el-table-column label="身份证号" align="center" prop="idCard" /> <el-table-column label="身份证号" align="center" prop="cardId" />
<el-table-column label="出生日期" align="center" prop="bornDate" width="180"> <el-table-column label="出生日期" align="center" prop="bornDate" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.bornDate, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.bornDate, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="年龄" align="center" prop="age" /> <el-table-column label="年龄" align="center" prop="age" />
<el-table-column label="用户性别" align="center" prop="sex" /> <el-table-column label="性别" align="center" prop="sex" />
<el-table-column label="籍贯" align="center" prop="jg" /> <el-table-column label="籍贯" align="center" prop="jg" />
<el-table-column label="与户主关系" align="center" prop="relation" /> <el-table-column label="与户主关系" align="center" prop="relation" />
<el-table-column label="籍贯性质" align="center" prop="jgNature" /> <el-table-column label="籍贯性质" align="center" prop="jgNature" />
@ -269,8 +269,8 @@
<el-form-item label="国籍" prop="nationality"> <el-form-item label="国籍" prop="nationality">
<el-input v-model="form.nationality" placeholder="请输入国籍" /> <el-input v-model="form.nationality" placeholder="请输入国籍" />
</el-form-item> </el-form-item>
<el-form-item label="身份证号" prop="idCard"> <el-form-item label="身份证号" prop="cardId">
<el-input v-model="form.idCard" placeholder="请输入身份证号" /> <el-input v-model="form.cardId" placeholder="请输入身份证号" />
</el-form-item> </el-form-item>
<el-form-item label="出生日期" prop="bornDate"> <el-form-item label="出生日期" prop="bornDate">
<el-date-picker clearable <el-date-picker clearable
@ -356,7 +356,7 @@ export default {
name: null, name: null,
oldName: null, oldName: null,
nationality: null, nationality: null,
idCard: null, cardId: null,
bornDate: null, bornDate: null,
age: null, age: null,
sex: null, sex: null,
@ -414,7 +414,7 @@ export default {
name: null, name: null,
oldName: null, oldName: null,
nationality: null, nationality: null,
idCard: null, cardId: null,
bornDate: null, bornDate: null,
age: null, age: null,
sex: null, sex: null,

Loading…
Cancel
Save