| | |
| | | import org.apache.commons.lang.builder.ToStringBuilder; |
| | | import org.apache.commons.lang.builder.ToStringStyle; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 考核发布对象 t_check_publish |
| | | * |
| | |
| | | @Excel(name = "考核状态 0/1 启用 / 停用") |
| | | private Long state; |
| | | |
| | | /** 报警分数阈值 */ |
| | | @Excel(name = "报警分数阈值") |
| | | private BigDecimal alarmScore; |
| | | |
| | | private Long createUser; |
| | | @Excel(name = "创建人") |
| | | private String createUserName; |
| | |
| | | |
| | | public void setExamineName(String examineName) { |
| | | this.examineName = examineName; |
| | | } |
| | | |
| | | public BigDecimal getAlarmScore() { |
| | | return alarmScore; |
| | | } |
| | | |
| | | public void setAlarmScore(BigDecimal alarmScore) { |
| | | this.alarmScore = alarmScore; |
| | | } |
| | | |
| | | public void setId(Long id) |
| | |
| | | ", examineRange=" + examineRange + |
| | | ", frequency=" + frequency + |
| | | ", state=" + state + |
| | | ", alarmScore=" + alarmScore + |
| | | ", createUser=" + createUser + |
| | | ", createUserName='" + createUserName + '\'' + |
| | | ", updateUserName='" + updateUserName + '\'' + |
| | |
| | | package com.ycl.system.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | |
| | | private Date createTime; |
| | | |
| | | /** 更新者 */ |
| | | @TableField(fill = FieldFill.UPDATE) |
| | | private String updateBy; |
| | | |
| | | /** 更新时间 */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @TableField(fill = FieldFill.UPDATE) |
| | | private Date updateTime; |
| | | |
| | | /** 备注 */ |
| | |
| | | package com.ycl.plus; |
| | | |
| | | import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; |
| | | import com.ycl.utils.SecurityUtils; |
| | | import org.apache.ibatis.reflection.MetaObject; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public void insertFill(MetaObject metaObject) { |
| | | String username = SecurityUtils.getLoginUser().getUsername(); |
| | | this.setFieldValByName("updateTime", new Date(), metaObject); |
| | | this.setFieldValByName("createTime", new Date(), metaObject); |
| | | this.setFieldValByName("createUser", username, metaObject); |
| | | this.setFieldValByName("createBy", username, metaObject); |
| | | this.setFieldValByName("deleted", "0", metaObject); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public void updateFill(MetaObject metaObject) { |
| | | String username = SecurityUtils.getLoginUser().getUsername(); |
| | | this.setFieldValByName("updateTime", new Date(), metaObject); |
| | | this.setFieldValByName("updateBy",username,metaObject); |
| | | this.setFieldValByName("updateUser",username,metaObject); |
| | | } |
| | | } |
| | |
| | | // 更新缓存用户密码 |
| | | loginUser.getUser().setPassword(newPassword); |
| | | tokenService.setLoginUser(loginUser); |
| | | //将状态改为已修改过密码 |
| | | if (firstLogin == 0) { |
| | | SysUser user = new SysUser(); |
| | | user.setUserId(loginUser.getUserId()); |
| | | user.setFirstLogin((short) 1); |
| | | userMapper.updateUser(user); |
| | | } |
| | | return success(); |
| | | } |
| | | //将状态改为已修改过密码 |
| | | if (firstLogin == 0) { |
| | | SysUser user = new SysUser(); |
| | | user.setUserId(loginUser.getUserId()); |
| | | user.setFirstLogin((short) 1); |
| | | userMapper.updateUser(user); |
| | | } |
| | | return error("修改密码异常,请联系管理员"); |
| | | } |
| | |
| | | <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> |
| | | <if test="remark != null">remark = #{remark},</if> |
| | | <if test="firstLogin !=null ">first_login = #{firstLogin}</if> |
| | | update_time = sysdate() |
| | | </set> |
| | | where user_id = #{userId} |
| | | </update> |
| | |
| | | <result property="updateUser" column="update_user" /> |
| | | <result property="updateUserName" column="update_user_name" /> |
| | | <result property="description" column="description" /> |
| | | <result property="alarmScore" column="alarm_score" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectTCheckPublishVo"> |
| | | select id , examine_name, template_id , examine_range , frequency , state , create_time , create_user , update_time , update_user , description,create_user_name,update_user_name from t_check_publish |
| | | select id , examine_name, template_id , examine_range , frequency , state , create_time , create_user , update_time , update_user , description,create_user_name,update_user_name,alarm_score from t_check_publish |
| | | </sql> |
| | | |
| | | <select id="selectTCheckPublishList" parameterType="com.ycl.platform.domain.entity.TCheckPublish" resultMap="TCheckPublishResult"> |
| | |
| | | <if test="createUser != null "> and create_user = #{createUser}</if> |
| | | <if test="updateUser != null "> and update_user = #{updateUser}</if> |
| | | <if test="description != null and description != ''"> and description = #{description}</if> |
| | | <if test="alarmScore != null"> and alarm_score = #{alarmScore}</if> |
| | | </where> |
| | | </select> |
| | | |
| | |
| | | <if test="updateUser != null">update_user,</if> |
| | | <if test="updateUserName != null and updateUserName!= ''">update_user_name,</if> |
| | | <if test="description != null">description,</if> |
| | | <if test="alarmScore != null">alarm_score,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id},</if> |
| | |
| | | <if test="updateUser != null">#{updateUser},</if> |
| | | <if test="updateUserName != null and updateUserName!= ''">#{updateUserName},</if> |
| | | <if test="description != null">#{description},</if> |
| | | <if test="alarmScore != null">#{alarmScore},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | |
| | | <if test="updateUser != null">update_user = #{updateUser},</if> |
| | | <if test="updateUserName != null and updateUserName!= ''">update_user_name = #{updateUserName},</if> |
| | | <if test="description != null">description = #{description},</if> |
| | | <if test="alarmScore != null">alarm_score = #{alarmScore},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |