属性功能完善
parent
fd28a8fbc8
commit
8cee0c4e43
|
@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
select#foreach($column in $columns) $column.columnName#if($foreach.count != $columns.size()),#end#end from ${tableName}
|
||||
</sql>
|
||||
|
||||
<select id="select${ClassName}List" parameterType="${ClassName}" resultMap="${ClassName}Result">
|
||||
<select id="select${ClassName}List" parameterType="${packageName}.${ClassName}" resultMap="${ClassName}Result">
|
||||
<include refid="select${ClassName}Vo"/>
|
||||
<where>
|
||||
#foreach($column in $columns)
|
||||
|
@ -72,7 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#end
|
||||
</select>
|
||||
|
||||
<insert id="insert${ClassName}" parameterType="${ClassName}"#if($pkColumn.increment) useGeneratedKeys="true" keyProperty="$pkColumn.javaField"#end>
|
||||
<insert id="insert${ClassName}" parameterType="${packageName}.${ClassName}"#if($pkColumn.increment) useGeneratedKeys="true" keyProperty="$pkColumn.javaField"#end>
|
||||
insert into ${tableName}
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#foreach($column in $columns)
|
||||
|
@ -90,7 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="update${ClassName}" parameterType="${ClassName}">
|
||||
<update id="update${ClassName}" parameterType="${packageName}.${ClassName}">
|
||||
update ${tableName}
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
#foreach($column in $columns)
|
||||
|
|
|
@ -23,5 +23,9 @@
|
|||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-security</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package com.muyu.product.domain;
|
||||
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.TreeEntity;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
|
@ -62,7 +64,7 @@ public class Address extends TreeEntity
|
|||
.append("sonId", getSonId())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateBy", SecurityUtils.getUsername())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package com.muyu.product.domain;
|
||||
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
|
@ -63,7 +65,7 @@ public class AsAttributeGroup extends BaseEntity
|
|||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateBy", SecurityUtils.getUsername())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
package com.muyu.product.domain;
|
||||
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 属性对象 attribute
|
||||
*
|
||||
* @author Saisai
|
||||
* @author saisai
|
||||
* @date 2024-02-29
|
||||
*/
|
||||
public class Attribute extends BaseEntity
|
||||
|
@ -18,14 +20,14 @@ public class Attribute extends BaseEntity
|
|||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 属性编码 */
|
||||
@Excel(name = "属性编码")
|
||||
private String code;
|
||||
|
||||
/** 属性名 */
|
||||
@Excel(name = "属性名")
|
||||
private String name;
|
||||
|
||||
/** 分组 */
|
||||
@Excel(name = "分组")
|
||||
private String groupId;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
|
@ -35,6 +37,15 @@ public class Attribute extends BaseEntity
|
|||
{
|
||||
return id;
|
||||
}
|
||||
public void setCode(String code)
|
||||
{
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
|
@ -44,26 +55,17 @@ public class Attribute extends BaseEntity
|
|||
{
|
||||
return name;
|
||||
}
|
||||
public void setGroupId(String groupId)
|
||||
{
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
public String getGroupId()
|
||||
{
|
||||
return groupId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("code", getCode())
|
||||
.append("name", getName())
|
||||
.append("groupId", getGroupId())
|
||||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateBy", SecurityUtils.getUsername())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.muyu.product.domain;
|
||||
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
|
@ -63,7 +64,7 @@ public class AttributeGroup extends BaseEntity
|
|||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateBy", SecurityUtils.getUsername())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.muyu.product.domain;
|
||||
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
|
@ -77,7 +78,7 @@ public class AttributeProduct extends BaseEntity
|
|||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateBy", SecurityUtils.getUsername())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.muyu.product.domain;
|
||||
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
|
@ -105,7 +106,7 @@ public class Brand extends BaseEntity
|
|||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateBy", SecurityUtils.getUsername())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.muyu.product.domain;
|
||||
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
|
@ -63,7 +64,7 @@ public class BrandCategory extends BaseEntity
|
|||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateBy", SecurityUtils.getUsername())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.muyu.product.domain;
|
||||
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
|
@ -63,7 +64,7 @@ public class CategoryAttribute extends BaseEntity
|
|||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateBy", SecurityUtils.getUsername())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.muyu.product.domain;
|
||||
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
|
@ -63,7 +64,7 @@ public class CategoryAttributeGroup extends BaseEntity
|
|||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateBy", SecurityUtils.getUsername())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.muyu.product.domain;
|
||||
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.TreeEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
|
@ -78,7 +79,7 @@ public class CategoryInfo extends TreeEntity
|
|||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateBy", SecurityUtils.getUsername())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.muyu.product.domain;
|
||||
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
|
@ -63,7 +64,7 @@ public class ProductCategory extends BaseEntity
|
|||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateBy", SecurityUtils.getUsername())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.muyu.product.domain;
|
||||
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.muyu.product.domain;
|
||||
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
|
@ -49,7 +50,7 @@ public class Rule extends BaseEntity
|
|||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateBy", SecurityUtils.getUsername())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.muyu.product.domain;
|
||||
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
|
@ -77,7 +78,7 @@ public class RuleProduct extends BaseEntity
|
|||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateBy", SecurityUtils.getUsername())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ import com.muyu.common.core.web.page.TableDataInfo;
|
|||
/**
|
||||
* 属性Controller
|
||||
*
|
||||
* @author Saisai
|
||||
* @author saisai
|
||||
* @date 2024-02-29
|
||||
*/
|
||||
@RestController
|
||||
|
|
|
@ -6,7 +6,7 @@ import com.muyu.product.domain.Attribute;
|
|||
/**
|
||||
* 属性Mapper接口
|
||||
*
|
||||
* @author Saisai
|
||||
* @author saisai
|
||||
* @date 2024-02-29
|
||||
*/
|
||||
public interface AttributeMapper
|
||||
|
|
|
@ -6,7 +6,7 @@ import com.muyu.product.domain.Attribute;
|
|||
/**
|
||||
* 属性Service接口
|
||||
*
|
||||
* @author Saisai
|
||||
* @author saisai
|
||||
* @date 2024-02-29
|
||||
*/
|
||||
public interface IAttributeService
|
||||
|
|
|
@ -11,7 +11,7 @@ import com.muyu.product.service.IAttributeService;
|
|||
/**
|
||||
* 属性Service业务层处理
|
||||
*
|
||||
* @author Saisai
|
||||
* @author saisai
|
||||
* @date 2024-02-29
|
||||
*/
|
||||
@Service
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.product.mapper.AttributeMapper">
|
||||
|
||||
<resultMap type="com.muyu.product.domain.Attribute" id="AttributeResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="code" column="code" />
|
||||
<result property="name" column="name" />
|
||||
<result property="groupId" column="group_id" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
|
@ -16,14 +16,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectAttributeVo">
|
||||
select id, name, group_id, remark, create_by, create_time, update_by, update_time from attribute
|
||||
select id, code, name, remark, create_by, create_time, update_by, update_time from attribute
|
||||
</sql>
|
||||
|
||||
<select id="selectAttributeList" parameterType="com.muyu.product.domain.Attribute" resultMap="AttributeResult">
|
||||
<include refid="selectAttributeVo"/>
|
||||
<where>
|
||||
<if test="code != null and code != ''"> and code = #{code}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="groupId != null and groupId != ''"> and group_id = #{groupId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
@ -35,8 +35,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<insert id="insertAttribute" parameterType="com.muyu.product.domain.Attribute" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into attribute
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="code != null and code != ''">code,</if>
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="groupId != null and groupId != ''">group_id,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
|
@ -44,8 +44,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="code != null and code != ''">#{code},</if>
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="groupId != null and groupId != ''">#{groupId},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
|
@ -57,8 +57,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<update id="updateAttribute" parameterType="com.muyu.product.domain.Attribute">
|
||||
update attribute
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="code != null and code != ''">code = #{code},</if>
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="groupId != null and groupId != ''">group_id = #{groupId},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
|
|
Loading…
Reference in New Issue