Browse Source

feat(port): 添加端口信息状态字段

- 在PortInfo实体类中新增active状态属性
- 为active字段添加Swagger文档注解
- 更新MyBatis映射文件中的结果映射和查询字段
- 在插入新记录时默认设置状态为启用(Y)
- 添加根据状态查询的功能支持
master
qiankanghui 2 months ago
parent
commit
d288687440
  1. 5
      src/main/java/com/xujie/modules/port/entity/PortInfo.java
  2. 1
      src/main/java/com/xujie/modules/port/service/Impl/PortInfoServiceImpl.java
  3. 4
      src/main/resources/mapper/port/PortInfoMapper.xml

5
src/main/java/com/xujie/modules/port/entity/PortInfo.java

@ -13,7 +13,7 @@ import java.util.Date;
/**
* <p>
*
*
* </p>
*
* @author jyy
@ -50,6 +50,9 @@ public class PortInfo extends QueryPage {
private Integer id;
@ApiModelProperty(value = "状态")
private String active;
public Object getKey() {
return this.id;
}

1
src/main/java/com/xujie/modules/port/service/Impl/PortInfoServiceImpl.java

@ -36,6 +36,7 @@ public class PortInfoServiceImpl extends ServiceImpl<PortInfoMapper, PortInfo> i
baseMapper.updateByportCode(model);
} else {
model.setCreateDate(new Date());
model.setActive("Y");
baseMapper.insert(model);
}
}

4
src/main/resources/mapper/port/PortInfoMapper.xml

@ -12,11 +12,12 @@
<result column="create_date" property="createDate" />
<result column="update_by" property="updateBy" />
<result column="update_date" property="updateDate" />
<result column="active" property="active" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="BaseColumnList">
port_code, port_name, remark, create_by, create_date, update_by, update_date, id
port_code, port_name, remark, create_by, create_date, update_by, update_date, id,active
</sql>
<select id="getListByModel" resultType="com.xujie.modules.port.entity.PortInfo">
@ -48,6 +49,7 @@
<if test="query.updateBy != null and query.updateBy != '' "> and update_by like '%${query.updateBy}%'</if>
<if test="query.updateDate != null and query.updateDate != '' "> and update_date like '%${query.updateDate}%'</if>
<if test="query.id != null "> and id = '${query.id}'</if>
<if test="query.active != null "> and id = '${query.active}'</if>
</where>
order by id desc
</select>

Loading…
Cancel
Save