From 0980124ec2e8deab58b072a83ebed43390d8024f Mon Sep 17 00:00:00 2001 From: Administrator <zhubaomin> Date: 星期三, 26 六月 2024 21:07:57 +0800 Subject: [PATCH] 2024-06-26 朱宝民 添加字典、字典项管理 --- pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voBa/VoDictItem.java | 28 ++ pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaDict.java | 96 +++++++ pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/dict/DictSv.java | 35 ++ pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaDictItemMapper.java | 37 ++ pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaDictItemMapper.xml | 200 +++++++++++++++ pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaDictItem.java | 107 ++++++++ pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/dict/DictCtrl.java | 43 +++ pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaDictMapper.java | 27 ++ pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaDictMapper.xml | 167 ++++++++++++ 9 files changed, 740 insertions(+), 0 deletions(-) diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaDictItemMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaDictItemMapper.java new file mode 100644 index 0000000..8bf446f --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaDictItemMapper.java @@ -0,0 +1,37 @@ +package com.dy.pipIrrGlobal.daoBa; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dy.pipIrrGlobal.pojoBa.BaDictItem; +import com.dy.pipIrrGlobal.voBa.VoDictItem; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * @author ZhuBaoMin + * @date 2024-06-26 20:14 + * @LastEditTime 2024-06-26 20:14 + * @Description + */ + +@Mapper +public interface BaDictItemMapper extends BaseMapper<BaDictItem> { + int deleteByPrimaryKey(Integer id); + + int insert(BaDictItem record); + + int insertSelective(BaDictItem record); + + BaDictItem selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(BaDictItem record); + + int updateByPrimaryKey(BaDictItem record); + + /** + * 鏍规嵁瀛楀吀Code鑾峰彇瀛楀吀椤� + * @param dictCode + * @return + */ + List<VoDictItem> getDictItemsByDictCode(String dictCode); +} \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaDictMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaDictMapper.java new file mode 100644 index 0000000..1b1e90d --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaDictMapper.java @@ -0,0 +1,27 @@ +package com.dy.pipIrrGlobal.daoBa; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dy.pipIrrGlobal.pojoBa.BaDict; +import org.apache.ibatis.annotations.Mapper; + +/** + * @author ZhuBaoMin + * @date 2024-06-26 20:14 + * @LastEditTime 2024-06-26 20:14 + * @Description + */ + +@Mapper +public interface BaDictMapper extends BaseMapper<BaDict> { + int deleteByPrimaryKey(Integer id); + + int insert(BaDict record); + + int insertSelective(BaDict record); + + BaDict selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(BaDict record); + + int updateByPrimaryKey(BaDict record); +} \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaDict.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaDict.java new file mode 100644 index 0000000..d572314 --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaDict.java @@ -0,0 +1,96 @@ +package com.dy.pipIrrGlobal.pojoBa; + +import com.alibaba.fastjson2.annotation.JSONField; +import com.alibaba.fastjson2.writer.ObjectWriterImplToString; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.*; + +import java.util.Date; + +/** + * @author ZhuBaoMin + * @date 2024-06-26 20:14 + * @LastEditTime 2024-06-26 20:14 + * @Description + */ +/** + * 瀛楀吀琛� + */ + +@TableName(value="ba_dict", autoResultMap = true) +@Data +@ToString +@Builder +@NoArgsConstructor +@AllArgsConstructor +@Schema(name = "瀛楀吀瀹炰綋") +public class BaDict { + public static final long serialVersionUID = 202406262028001L; + + /** + * 涓婚敭 + */ + @JSONField(serializeUsing = ObjectWriterImplToString.class) + @TableId(type = IdType.INPUT) + private Integer id; + + /** + * 鏍囪瘑 + */ + @NotBlank(message = "鏍囪瘑涓嶈兘涓虹┖") + private String code; + + /** + * 鍚嶇О + */ + @NotBlank(message = "鍚嶇О涓嶈兘涓虹┖") + private String title; + + /** + * 鍊肩被鍨�;1-Number锛�2-String锛�3-Boolean + */ + @NotNull(message = "鍊肩被鍨嬩笉鑳戒负绌�") + private Byte valueType; + + /** + * hash鍊�;褰撳瓧鍏搁」琚慨鏀规椂鍙樻洿 + */ + @NotBlank(message = "hash鍊间笉鑳戒负绌�") + private String hashCode; + + /** + * 澶囨敞 + */ + private String remarks; + + /** + * 閫昏緫鍒犻櫎鏍囪瘑;鏈垹闄や负 0锛屽凡鍒犻櫎涓哄垹闄ゆ椂闂� + */ + @JSONField(serializeUsing = ObjectWriterImplToString.class) + private Long deleted; + + /** + * 鍒涘缓浜� + */ + private Integer createBy; + + /** + * 淇敼浜� + */ + private Integer updateBy; + + /** + * 鍒涘缓鏃堕棿 + */ + private Date createTime; + + /** + * 淇敼鏃堕棿 + */ + private Date updateTime; +} \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaDictItem.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaDictItem.java new file mode 100644 index 0000000..b5c53da --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaDictItem.java @@ -0,0 +1,107 @@ +package com.dy.pipIrrGlobal.pojoBa; + +import com.alibaba.fastjson2.annotation.JSONField; +import com.alibaba.fastjson2.writer.ObjectWriterImplToString; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.*; + +import java.util.Date; + +/** + * @author ZhuBaoMin + * @date 2024-06-26 20:14 + * @LastEditTime 2024-06-26 20:14 + * @Description + */ +/** + * 瀛楀吀椤� + */ + +@TableName(value="ba_dict_item", autoResultMap = true) +@Data +@ToString +@Builder +@NoArgsConstructor +@AllArgsConstructor +@Schema(name = "瀛楀吀椤瑰疄浣�") +public class BaDictItem { + public static final long serialVersionUID = 202406262029001L; + + /** + * 涓婚敭 + */ + @JSONField(serializeUsing = ObjectWriterImplToString.class) + @TableId(type = IdType.INPUT) + private Integer id; + + /** + * 瀛楀吀Code + */ + @NotBlank(message = "瀛楀吀Code涓嶈兘涓虹┖") + private String dictCode; + + /** + * 鏁版嵁鍊� + */ + @NotBlank(message = "鏁版嵁鍊间笉鑳戒负绌�") + private String value; + + /** + * 鏍囩 + */ + @NotBlank(message = "鏍囩涓嶈兘涓虹┖") + private String name; + + /** + * 鐘舵��;1-鍚敤锛�0-绂佺敤 + */ + @NotNull(message = "鐘舵�佷笉鑳戒负绌�") + private Byte status; + + /** + * 闄勫姞灞炴�� + */ + private String attributes; + + /** + * 鎺掑簭锛堝崌搴忥級 + */ + @NotNull(message = "鎺掑簭涓嶈兘涓虹┖") + private Integer sort; + + /** + * 澶囨敞 + */ + private String remarks; + + /** + * 閫昏緫鍒犻櫎鏍囪瘑;鏈垹闄や负 0锛屽凡鍒犻櫎涓哄垹闄ゆ椂闂� + */ + @JSONField(serializeUsing = ObjectWriterImplToString.class) + private Long deleted; + + /** + * 鍒涘缓浜� + */ + private Integer createBy; + + /** + * 淇敼浜� + */ + private Integer updateBy; + + /** + * 鍒涘缓鏃堕棿 + */ + private Date createTime; + + /** + * 淇敼鏃堕棿 + */ + private Date updateTime; +} \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voBa/VoDictItem.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voBa/VoDictItem.java new file mode 100644 index 0000000..cf95647 --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voBa/VoDictItem.java @@ -0,0 +1,28 @@ +package com.dy.pipIrrGlobal.voBa; + +import com.dy.common.po.BaseEntity; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @author ZhuBaoMin + * @date 2024-06-26 20:58 + * @LastEditTime 2024-06-26 20:58 + * @Description + */ + +@Data +@Schema(title = "瀛楀吀椤硅鍥惧璞�") +public class VoDictItem implements BaseEntity { + private static final long serialVersionUID = 202406262059001L; + + /** + * 鏍囩 + */ + private String name; + + /** + * 鏁版嵁鍊� + */ + private String value; +} diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaDictItemMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaDictItemMapper.xml new file mode 100644 index 0000000..626c080 --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaDictItemMapper.xml @@ -0,0 +1,200 @@ +<?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"> +<mapper namespace="com.dy.pipIrrGlobal.daoBa.BaDictItemMapper"> + <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoBa.BaDictItem"> + <!--@mbg.generated--> + <!--@Table ba_dict_item--> + <id column="id" jdbcType="INTEGER" property="id" /> + <result column="dict_code" jdbcType="VARCHAR" property="dictCode" /> + <result column="value" jdbcType="VARCHAR" property="value" /> + <result column="name" jdbcType="VARCHAR" property="name" /> + <result column="status" jdbcType="TINYINT" property="status" /> + <result column="attributes" jdbcType="LONGVARCHAR" property="attributes" /> + <result column="sort" jdbcType="INTEGER" property="sort" /> + <result column="remarks" jdbcType="VARCHAR" property="remarks" /> + <result column="deleted" jdbcType="BIGINT" property="deleted" /> + <result column="create_by" jdbcType="INTEGER" property="createBy" /> + <result column="update_by" jdbcType="INTEGER" property="updateBy" /> + <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> + <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> + </resultMap> + <sql id="Base_Column_List"> + <!--@mbg.generated--> + id, dict_code, `value`, `name`, `status`, `attributes`, sort, remarks, deleted, create_by, + update_by, create_time, update_time + </sql> + <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> + <!--@mbg.generated--> + select + <include refid="Base_Column_List" /> + from ba_dict_item + where id = #{id,jdbcType=INTEGER} + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> + <!--@mbg.generated--> + delete from ba_dict_item + where id = #{id,jdbcType=INTEGER} + </delete> + <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoBa.BaDictItem" useGeneratedKeys="true"> + <!--@mbg.generated--> + insert into ba_dict_item (dict_code, `value`, `name`, + `status`, `attributes`, sort, + remarks, deleted, create_by, + update_by, create_time, update_time + ) + values (#{dictCode,jdbcType=VARCHAR}, #{value,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, + #{status,jdbcType=TINYINT}, #{attributes,jdbcType=LONGVARCHAR}, #{sort,jdbcType=INTEGER}, + #{remarks,jdbcType=VARCHAR}, #{deleted,jdbcType=BIGINT}, #{createBy,jdbcType=INTEGER}, + #{updateBy,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP} + ) + </insert> + <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoBa.BaDictItem" useGeneratedKeys="true"> + <!--@mbg.generated--> + insert into ba_dict_item + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="dictCode != null"> + dict_code, + </if> + <if test="value != null"> + `value`, + </if> + <if test="name != null"> + `name`, + </if> + <if test="status != null"> + `status`, + </if> + <if test="attributes != null"> + `attributes`, + </if> + <if test="sort != null"> + sort, + </if> + <if test="remarks != null"> + remarks, + </if> + <if test="deleted != null"> + deleted, + </if> + <if test="createBy != null"> + create_by, + </if> + <if test="updateBy != null"> + update_by, + </if> + <if test="createTime != null"> + create_time, + </if> + <if test="updateTime != null"> + update_time, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="dictCode != null"> + #{dictCode,jdbcType=VARCHAR}, + </if> + <if test="value != null"> + #{value,jdbcType=VARCHAR}, + </if> + <if test="name != null"> + #{name,jdbcType=VARCHAR}, + </if> + <if test="status != null"> + #{status,jdbcType=TINYINT}, + </if> + <if test="attributes != null"> + #{attributes,jdbcType=LONGVARCHAR}, + </if> + <if test="sort != null"> + #{sort,jdbcType=INTEGER}, + </if> + <if test="remarks != null"> + #{remarks,jdbcType=VARCHAR}, + </if> + <if test="deleted != null"> + #{deleted,jdbcType=BIGINT}, + </if> + <if test="createBy != null"> + #{createBy,jdbcType=INTEGER}, + </if> + <if test="updateBy != null"> + #{updateBy,jdbcType=INTEGER}, + </if> + <if test="createTime != null"> + #{createTime,jdbcType=TIMESTAMP}, + </if> + <if test="updateTime != null"> + #{updateTime,jdbcType=TIMESTAMP}, + </if> + </trim> + </insert> + <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoBa.BaDictItem"> + <!--@mbg.generated--> + update ba_dict_item + <set> + <if test="dictCode != null"> + dict_code = #{dictCode,jdbcType=VARCHAR}, + </if> + <if test="value != null"> + `value` = #{value,jdbcType=VARCHAR}, + </if> + <if test="name != null"> + `name` = #{name,jdbcType=VARCHAR}, + </if> + <if test="status != null"> + `status` = #{status,jdbcType=TINYINT}, + </if> + <if test="attributes != null"> + `attributes` = #{attributes,jdbcType=LONGVARCHAR}, + </if> + <if test="sort != null"> + sort = #{sort,jdbcType=INTEGER}, + </if> + <if test="remarks != null"> + remarks = #{remarks,jdbcType=VARCHAR}, + </if> + <if test="deleted != null"> + deleted = #{deleted,jdbcType=BIGINT}, + </if> + <if test="createBy != null"> + create_by = #{createBy,jdbcType=INTEGER}, + </if> + <if test="updateBy != null"> + update_by = #{updateBy,jdbcType=INTEGER}, + </if> + <if test="createTime != null"> + create_time = #{createTime,jdbcType=TIMESTAMP}, + </if> + <if test="updateTime != null"> + update_time = #{updateTime,jdbcType=TIMESTAMP}, + </if> + </set> + where id = #{id,jdbcType=INTEGER} + </update> + <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoBa.BaDictItem"> + <!--@mbg.generated--> + update ba_dict_item + set dict_code = #{dictCode,jdbcType=VARCHAR}, + `value` = #{value,jdbcType=VARCHAR}, + `name` = #{name,jdbcType=VARCHAR}, + `status` = #{status,jdbcType=TINYINT}, + `attributes` = #{attributes,jdbcType=LONGVARCHAR}, + sort = #{sort,jdbcType=INTEGER}, + remarks = #{remarks,jdbcType=VARCHAR}, + deleted = #{deleted,jdbcType=BIGINT}, + create_by = #{createBy,jdbcType=INTEGER}, + update_by = #{updateBy,jdbcType=INTEGER}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=TIMESTAMP} + where id = #{id,jdbcType=INTEGER} + </update> + + <!--鏍规嵁瀛楀吀Code鑾峰彇瀛楀吀椤�--> + <select id="getDictItemsByDictCode" resultType="com.dy.pipIrrGlobal.voBa.VoDictItem"> + SELECT + name, value + FROM ba_dict_item + WHERE deleted = 0 AND status = 1 AND dict_code = #{dictCode} + ORDER BY sort + </select> +</mapper> \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaDictMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaDictMapper.xml new file mode 100644 index 0000000..9a483ca --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaDictMapper.xml @@ -0,0 +1,167 @@ +<?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"> +<mapper namespace="com.dy.pipIrrGlobal.daoBa.BaDictMapper"> + <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoBa.BaDict"> + <!--@mbg.generated--> + <!--@Table ba_dict--> + <id column="id" jdbcType="INTEGER" property="id" /> + <result column="code" jdbcType="VARCHAR" property="code" /> + <result column="title" jdbcType="VARCHAR" property="title" /> + <result column="value_type" jdbcType="TINYINT" property="valueType" /> + <result column="hash_code" jdbcType="VARCHAR" property="hashCode" /> + <result column="remarks" jdbcType="VARCHAR" property="remarks" /> + <result column="deleted" jdbcType="BIGINT" property="deleted" /> + <result column="create_by" jdbcType="INTEGER" property="createBy" /> + <result column="update_by" jdbcType="INTEGER" property="updateBy" /> + <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> + <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> + </resultMap> + <sql id="Base_Column_List"> + <!--@mbg.generated--> + id, code, title, value_type, hash_code, remarks, deleted, create_by, update_by, create_time, + update_time + </sql> + <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> + <!--@mbg.generated--> + select + <include refid="Base_Column_List" /> + from ba_dict + where id = #{id,jdbcType=INTEGER} + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> + <!--@mbg.generated--> + delete from ba_dict + where id = #{id,jdbcType=INTEGER} + </delete> + <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoBa.BaDict" useGeneratedKeys="true"> + <!--@mbg.generated--> + insert into ba_dict (code, title, value_type, + hash_code, remarks, deleted, + create_by, update_by, create_time, + update_time) + values (#{code,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{valueType,jdbcType=TINYINT}, + #{hashCode,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, #{deleted,jdbcType=BIGINT}, + #{createBy,jdbcType=INTEGER}, #{updateBy,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, + #{updateTime,jdbcType=TIMESTAMP}) + </insert> + <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoBa.BaDict" useGeneratedKeys="true"> + <!--@mbg.generated--> + insert into ba_dict + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="code != null"> + code, + </if> + <if test="title != null"> + title, + </if> + <if test="valueType != null"> + value_type, + </if> + <if test="hashCode != null"> + hash_code, + </if> + <if test="remarks != null"> + remarks, + </if> + <if test="deleted != null"> + deleted, + </if> + <if test="createBy != null"> + create_by, + </if> + <if test="updateBy != null"> + update_by, + </if> + <if test="createTime != null"> + create_time, + </if> + <if test="updateTime != null"> + update_time, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="code != null"> + #{code,jdbcType=VARCHAR}, + </if> + <if test="title != null"> + #{title,jdbcType=VARCHAR}, + </if> + <if test="valueType != null"> + #{valueType,jdbcType=TINYINT}, + </if> + <if test="hashCode != null"> + #{hashCode,jdbcType=VARCHAR}, + </if> + <if test="remarks != null"> + #{remarks,jdbcType=VARCHAR}, + </if> + <if test="deleted != null"> + #{deleted,jdbcType=BIGINT}, + </if> + <if test="createBy != null"> + #{createBy,jdbcType=INTEGER}, + </if> + <if test="updateBy != null"> + #{updateBy,jdbcType=INTEGER}, + </if> + <if test="createTime != null"> + #{createTime,jdbcType=TIMESTAMP}, + </if> + <if test="updateTime != null"> + #{updateTime,jdbcType=TIMESTAMP}, + </if> + </trim> + </insert> + <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoBa.BaDict"> + <!--@mbg.generated--> + update ba_dict + <set> + <if test="code != null"> + code = #{code,jdbcType=VARCHAR}, + </if> + <if test="title != null"> + title = #{title,jdbcType=VARCHAR}, + </if> + <if test="valueType != null"> + value_type = #{valueType,jdbcType=TINYINT}, + </if> + <if test="hashCode != null"> + hash_code = #{hashCode,jdbcType=VARCHAR}, + </if> + <if test="remarks != null"> + remarks = #{remarks,jdbcType=VARCHAR}, + </if> + <if test="deleted != null"> + deleted = #{deleted,jdbcType=BIGINT}, + </if> + <if test="createBy != null"> + create_by = #{createBy,jdbcType=INTEGER}, + </if> + <if test="updateBy != null"> + update_by = #{updateBy,jdbcType=INTEGER}, + </if> + <if test="createTime != null"> + create_time = #{createTime,jdbcType=TIMESTAMP}, + </if> + <if test="updateTime != null"> + update_time = #{updateTime,jdbcType=TIMESTAMP}, + </if> + </set> + where id = #{id,jdbcType=INTEGER} + </update> + <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoBa.BaDict"> + <!--@mbg.generated--> + update ba_dict + set code = #{code,jdbcType=VARCHAR}, + title = #{title,jdbcType=VARCHAR}, + value_type = #{valueType,jdbcType=TINYINT}, + hash_code = #{hashCode,jdbcType=VARCHAR}, + remarks = #{remarks,jdbcType=VARCHAR}, + deleted = #{deleted,jdbcType=BIGINT}, + create_by = #{createBy,jdbcType=INTEGER}, + update_by = #{updateBy,jdbcType=INTEGER}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=TIMESTAMP} + where id = #{id,jdbcType=INTEGER} + </update> +</mapper> \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/dict/DictCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/dict/DictCtrl.java new file mode 100644 index 0000000..58b1b24 --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/dict/DictCtrl.java @@ -0,0 +1,43 @@ +package com.dy.pipIrrBase.dict; + +import com.dy.common.aop.SsoAop; +import com.dy.common.webUtil.BaseResponse; +import com.dy.common.webUtil.BaseResponseUtils; +import com.dy.pipIrrGlobal.voBa.VoDictItem; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @author ZhuBaoMin + * @date 2024-06-26 20:36 + * @LastEditTime 2024-06-26 20:36 + * @Description + */ + +@Slf4j +@Tag(name = "瀛楀吀椤圭鐞�", description = "瀛楀吀椤圭鐞�") +@RestController +@RequestMapping(path="dict_item") +public class DictCtrl { + @Autowired + private DictSv dictSv; + + /** + * 鏍规嵁瀛楀吀Code鑾峰彇瀛楀吀椤� + * @param dictCode + * @return + */ + @GetMapping(path = "some") + @SsoAop() + public BaseResponse<List<VoDictItem>> some(@RequestParam String dictCode){ + return BaseResponseUtils.buildSuccess(dictSv.getDictItemsByDictCode(dictCode)); + } + +} diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/dict/DictSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/dict/DictSv.java new file mode 100644 index 0000000..0f6e424 --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/dict/DictSv.java @@ -0,0 +1,35 @@ +package com.dy.pipIrrBase.dict; + +import com.dy.pipIrrGlobal.daoBa.BaDictItemMapper; +import com.dy.pipIrrGlobal.voBa.VoDictItem; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +/** + * @author ZhuBaoMin + * @date 2024-06-26 20:36 + * @LastEditTime 2024-06-26 20:36 + * @Description + */ + +@Slf4j +@Service +public class DictSv { + @Autowired + private BaDictItemMapper dictItemMapper; + + /** + * 鏍规嵁瀛楀吀Code鑾峰彇瀛楀吀椤� + * @param dictCode + * @return + */ + public List<VoDictItem> getDictItemsByDictCode(String dictCode){ + List<VoDictItem> rs = Optional.ofNullable(dictItemMapper.getDictItemsByDictCode(dictCode)).orElse(new ArrayList<>()); + return rs ; + } +} -- Gitblit v1.8.0