upd: 编码规范

This commit is contained in:
2025-03-24 20:22:27 +08:00
parent ca2bed6aaf
commit 501222efa8
4 changed files with 9 additions and 12 deletions
@@ -19,7 +19,7 @@ public class Dict extends MyEntity {
@NotNull(groups = Update.class) @NotNull(groups = Update.class)
@ApiModelProperty(value = "ID", hidden = true) @ApiModelProperty(value = "ID", hidden = true)
@TableId(value = "dict_id", type = IdType.AUTO) @TableId(value = "id", type = IdType.AUTO)
private Long id; private Long id;
@NotBlank @NotBlank
@@ -18,7 +18,7 @@ public class DictDetail extends MyEntity {
@NotNull(groups = Update.class) @NotNull(groups = Update.class)
@ApiModelProperty(value = "ID", hidden = true) @ApiModelProperty(value = "ID", hidden = true)
@TableId(value = "detail_id", type = IdType.AUTO) @TableId(value = "id", type = IdType.AUTO)
private Long id; private Long id;
@TableField(value = "dict_id") @TableField(value = "dict_id")
@@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.odboy.modules.system.mapper.DictDetailMapper"> <mapper namespace="cn.odboy.modules.system.mapper.DictDetailMapper">
<resultMap id="BaseResultMap" type="cn.odboy.model.system.domain.DictDetail"> <resultMap id="BaseResultMap" type="cn.odboy.model.system.domain.DictDetail">
<id column="detail_id" property="id" jdbcType="BIGINT"/> <id column="id" property="id" jdbcType="BIGINT"/>
<result column="label" property="label" jdbcType="VARCHAR"/> <result column="label" property="label" jdbcType="VARCHAR"/>
<result column="value" property="value" jdbcType="VARCHAR"/> <result column="value" property="value" jdbcType="VARCHAR"/>
<result column="dict_sort" property="dictSort" jdbcType="INTEGER"/> <result column="dict_sort" property="dictSort" jdbcType="INTEGER"/>
@@ -12,24 +12,21 @@
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/> <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
<!-- 一对一关联 --> <!-- 一对一关联 -->
<association property="dict" javaType="cn.odboy.model.system.domain.Dict"> <association property="dict" javaType="cn.odboy.model.system.domain.Dict">
<id column="dict_id" property="id" jdbcType="BIGINT"/> <id column="id" property="id" jdbcType="BIGINT"/>
<result column="name" property="name" jdbcType="VARCHAR"/> <result column="name" property="name" jdbcType="VARCHAR"/>
</association> </association>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
dd dd.id, dd.label, dd.`value`, dd.`dict_sort`, dd.create_by, dd.update_by, dd.create_time, dd.update_time,
. d.id as dict_id, d.name
detail_id
, dd.label, dd.`value`, dd.`dict_sort`, dd.create_by, dd.update_by, dd.create_time, dd.update_time,
d.dict_id, d.name
</sql> </sql>
<select id="findAll" resultMap="BaseResultMap"> <select id="findAll" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from sys_dict_detail dd, sys_dict d from sys_dict_detail dd, sys_dict d
where dd.dict_id = d.dict_id where dd.dict_id = d.id
<if test="criteria.dictName != null and criteria.dictName != ''"> <if test="criteria.dictName != null and criteria.dictName != ''">
and d.name = #{criteria.dictName} and d.name = #{criteria.dictName}
</if> </if>
@@ -43,7 +40,7 @@
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from sys_dict_detail dd, sys_dict d from sys_dict_detail dd, sys_dict d
where dd.dict_id = d.dict_id where dd.dict_id = d.id
<if test="name != null and name != ''"> <if test="name != null and name != ''">
and d.name = #{name} and d.name = #{name}
</if> </if>
@@ -13,6 +13,6 @@
) )
</if> </if>
</where> </where>
order by d.dict_id desc order by d.id desc
</select> </select>
</mapper> </mapper>