编号:ZSSAC-163 描述:新增应用编码
This commit is contained in:
parent
897f3d6ed0
commit
d0b1a07bdb
@ -7,127 +7,147 @@ import com.sf.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 应用列对象 APPLY_LIST_INFO
|
||||
*
|
||||
*
|
||||
* @author ztzh
|
||||
* @date 2024-04-11
|
||||
*/
|
||||
public class ApplyListInfo extends BaseEntity
|
||||
{
|
||||
public class ApplyListInfo extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/** 应用名称 */
|
||||
/**
|
||||
* 应用code
|
||||
*/
|
||||
@Excel(name = "应用编号")
|
||||
private String appCode;
|
||||
/**
|
||||
* 应用名称
|
||||
*/
|
||||
@Excel(name = "应用名称")
|
||||
private String appName;
|
||||
|
||||
/** 应用描述 */
|
||||
/**
|
||||
* 应用描述
|
||||
*/
|
||||
@Excel(name = "应用描述")
|
||||
private String appDesc;
|
||||
|
||||
/** 图片 */
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
@Excel(name = "图片")
|
||||
private String picture;
|
||||
|
||||
/** 排序 */
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Long orderNum;
|
||||
|
||||
/** 逻辑删除,0:未删除,1:删除 */
|
||||
/**
|
||||
* 逻辑删除,0:未删除,1:删除
|
||||
*/
|
||||
private Long isDelete;
|
||||
|
||||
/** 创建人 */
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String created;
|
||||
|
||||
/** 更新人 */
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String modified;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
public void setAppName(String appName)
|
||||
{
|
||||
|
||||
public void setAppName(String appName) {
|
||||
this.appName = appName;
|
||||
}
|
||||
|
||||
public String getAppName()
|
||||
{
|
||||
public String getAppName() {
|
||||
return appName;
|
||||
}
|
||||
public void setAppDesc(String appDesc)
|
||||
{
|
||||
|
||||
public void setAppDesc(String appDesc) {
|
||||
this.appDesc = appDesc;
|
||||
}
|
||||
|
||||
public String getAppDesc()
|
||||
{
|
||||
public String getAppDesc() {
|
||||
return appDesc;
|
||||
}
|
||||
public void setPicture(String picture)
|
||||
{
|
||||
|
||||
public void setPicture(String picture) {
|
||||
this.picture = picture;
|
||||
}
|
||||
|
||||
public String getPicture()
|
||||
{
|
||||
public String getPicture() {
|
||||
return picture;
|
||||
}
|
||||
public void setOrderNum(Long orderNum)
|
||||
{
|
||||
|
||||
public void setOrderNum(Long orderNum) {
|
||||
this.orderNum = orderNum;
|
||||
}
|
||||
|
||||
public Long getOrderNum()
|
||||
{
|
||||
public Long getOrderNum() {
|
||||
return orderNum;
|
||||
}
|
||||
public void setIsDelete(Long isDelete)
|
||||
{
|
||||
|
||||
public void setIsDelete(Long isDelete) {
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
public Long getIsDelete()
|
||||
{
|
||||
public Long getIsDelete() {
|
||||
return isDelete;
|
||||
}
|
||||
public void setCreated(String created)
|
||||
{
|
||||
|
||||
public void setCreated(String created) {
|
||||
this.created = created;
|
||||
}
|
||||
|
||||
public String getCreated()
|
||||
{
|
||||
public String getCreated() {
|
||||
return created;
|
||||
}
|
||||
public void setModified(String modified)
|
||||
{
|
||||
|
||||
public void setModified(String modified) {
|
||||
this.modified = modified;
|
||||
}
|
||||
|
||||
public String getModified()
|
||||
{
|
||||
public String getModified() {
|
||||
return modified;
|
||||
}
|
||||
|
||||
public void setAppCode(String appCode) {
|
||||
this.appCode = appCode;
|
||||
}
|
||||
|
||||
public String getAppCode() {
|
||||
return appCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("appName", getAppName())
|
||||
.append("appDesc", getAppDesc())
|
||||
.append("picture", getPicture())
|
||||
.append("orderNum", getOrderNum())
|
||||
.append("isDelete", getIsDelete())
|
||||
.append("created", getCreated())
|
||||
.append("modified", getModified())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("appCode",getAppCode())
|
||||
.append("appName", getAppName())
|
||||
.append("appDesc", getAppDesc())
|
||||
.append("picture", getPicture())
|
||||
.append("orderNum", getOrderNum())
|
||||
.append("isDelete", getIsDelete())
|
||||
.append("created", getCreated())
|
||||
.append("modified", getModified())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.sf.index.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.sf.common.utils.DateUtils;
|
||||
import com.sf.common.utils.uuid.IdUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.sf.index.mapper.ApplyListInfoMapper;
|
||||
@ -54,6 +55,7 @@ public class ApplyListInfoServiceImpl implements IApplyListInfoService
|
||||
public int insertApplyListInfo(ApplyListInfo applyListInfo)
|
||||
{
|
||||
applyListInfo.setCreateTime(DateUtils.getNowDate());
|
||||
applyListInfo.setAppCode(IdUtils.randomTime("ZT"));
|
||||
return applyListInfoMapper.insertApplyListInfo(applyListInfo);
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<resultMap type="ApplyListInfo" id="ApplyListInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="appCode" column="app_code" />
|
||||
<result property="appName" column="app_name" />
|
||||
<result property="appDesc" column="app_desc" />
|
||||
<result property="picture" column="picture" />
|
||||
@ -18,7 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectApplyListInfoVo">
|
||||
select id, app_name, app_desc, picture, order_num, is_delete, created, modified, create_time, update_time from APPLY_LIST_INFO
|
||||
select id, app_code, app_name, app_desc, picture, order_num, is_delete, created, modified, create_time, update_time from APPLY_LIST_INFO
|
||||
</sql>
|
||||
|
||||
<select id="selectApplyListInfoList" parameterType="ApplyListInfo" resultMap="ApplyListInfoResult">
|
||||
@ -36,6 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<insert id="insertApplyListInfo" parameterType="ApplyListInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into APPLY_LIST_INFO
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="appCode != null and appCode != ''">app_code,</if>
|
||||
<if test="appName != null and appName != ''">app_name,</if>
|
||||
<if test="appDesc != null and appDesc != ''">app_desc,</if>
|
||||
<if test="picture != null">picture,</if>
|
||||
@ -47,6 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="appCode != null and appCode != ''">#{appCode},</if>
|
||||
<if test="appName != null and appName != ''">#{appName},</if>
|
||||
<if test="appDesc != null and appDesc != ''">#{appDesc},</if>
|
||||
<if test="picture != null">#{picture},</if>
|
||||
@ -62,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<update id="updateApplyListInfo" parameterType="ApplyListInfo">
|
||||
update APPLY_LIST_INFO
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="appCode != null and appCode != ''">app_code = #{appCode},</if>
|
||||
<if test="appName != null and appName != ''">app_name = #{appName},</if>
|
||||
<if test="appDesc != null and appDesc != ''">app_desc = #{appDesc},</if>
|
||||
<if test="picture != null">picture = #{picture},</if>
|
||||
|
@ -2,48 +2,53 @@ package com.sf.common.utils.uuid;
|
||||
|
||||
/**
|
||||
* ID生成器工具类
|
||||
*
|
||||
*
|
||||
* @author ztzh
|
||||
*/
|
||||
public class IdUtils
|
||||
{
|
||||
public class IdUtils {
|
||||
/**
|
||||
* 获取随机UUID
|
||||
*
|
||||
*
|
||||
* @return 随机UUID
|
||||
*/
|
||||
public static String randomUUID()
|
||||
{
|
||||
public static String randomUUID() {
|
||||
return UUID.randomUUID().toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 简化的UUID,去掉了横线
|
||||
*
|
||||
*
|
||||
* @return 简化的UUID,去掉了横线
|
||||
*/
|
||||
public static String simpleUUID()
|
||||
{
|
||||
public static String simpleUUID() {
|
||||
return UUID.randomUUID().toString(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取随机UUID,使用性能更好的ThreadLocalRandom生成UUID
|
||||
*
|
||||
*
|
||||
* @return 随机UUID
|
||||
*/
|
||||
public static String fastUUID()
|
||||
{
|
||||
public static String fastUUID() {
|
||||
return UUID.fastUUID().toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 简化的UUID,去掉了横线,使用性能更好的ThreadLocalRandom生成UUID
|
||||
*
|
||||
*
|
||||
* @return 简化的UUID,去掉了横线
|
||||
*/
|
||||
public static String fastSimpleUUID()
|
||||
{
|
||||
public static String fastSimpleUUID() {
|
||||
return UUID.fastUUID().toString(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成一个由时间错与字母组成的唯一id
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String randomTime(String data) {
|
||||
long uniqueID = System.currentTimeMillis();
|
||||
return data + "_" + uniqueID;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user