fuliqi
2024-09-27 c5220156021c5d90b6b7d33ec9154259936c3060
自定义列迁移
3个文件已修改
56 ■■■■■ 已修改文件
ycl-pojo/src/main/java/com/ycl/platform/domain/query/YwPointQuery.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-pojo/src/main/java/com/ycl/platform/domain/vo/YwPointVO.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/resources/mapper/zgyw/YwPointMapper.xml 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-pojo/src/main/java/com/ycl/platform/domain/query/YwPointQuery.java
@@ -20,6 +20,11 @@
@Accessors(chain = true)
@ApiModel(value = "YwPoint查询", description = "运维点位查询")
public class YwPointQuery extends AbsQuery {
    /** 关键词 */
    private String keyword;
    /** 动态列的表明条件 */
    private String tableName = "t_yw_point";
    private String pointName;
ycl-pojo/src/main/java/com/ycl/platform/domain/vo/YwPointVO.java
@@ -61,6 +61,11 @@
    /** 国标码 */
    private String serialNumber;
    /**
     * 动态列
     */
    private List<DynamicColumnVO> dynamicColumnList;
    public static YwPointVO getVoByEntity(@NonNull YwPoint entity, YwPointVO vo) {
        if(vo == null) {
            vo = new YwPointVO();
ycl-server/src/main/resources/mapper/zgyw/YwPointMapper.xml
@@ -22,11 +22,38 @@
        <result column="dept_tag" property="deptTag"/>
    </resultMap>
    <!-- 通用查询映射结果 -->
    <resultMap id="pageMap" type="com.ycl.platform.domain.vo.YwPointVO">
        <result column="id" property="id"/>
        <result column="point_name" property="pointName"/>
        <result column="start_time" property="startTime"/>
        <result column="end_time" property="endTime"/>
        <result column="unit_id" property="unitId"/>
        <result column="unit_name" property="unitName"/>
        <result column="status" property="status"/>
        <result column="dept_id" property="deptId"/>
        <result column="dept_name" property="deptName"/>
        <result column="remark" property="remark"/>
        <result column="create_time" property="createTime"/>
        <result column="update_time" property="updateTime"/>
        <result column="province_tag" property="provinceTag"/>
        <result column="important_tag" property="importantTag"/>
        <result column="important_command_image_tag" property="importantCommandImageTag"/>
        <result column="dept_tag" property="deptTag"/>
        <collection property="dynamicColumnList" select="getDyColumns" column="{id=id,tableName=tableName,pointName=pointName}" ofType="com.ycl.platform.domain.vo.DynamicColumnVO"/>
    </resultMap>
    <resultMap id="dynamicColumnMap" type="com.ycl.platform.domain.vo.DynamicColumnVO">
        <result column="prop_name" property="propName"/>
        <result column="label_value" property="labelValue"/>
        <result column="column_value" property="columnValue"/>
    </resultMap>
    <select id="selectData" resultType="com.ycl.platform.base.BaseSelect">
    </select>
    <select id="page" resultMap="BaseResultMap">
    <select id="page" resultMap="pageMap">
        SELECT
        typ.id,
        typ.point_name,
@@ -43,7 +70,9 @@
        typ.important_tag,
        typ.province_tag,
        typ.important_command_image_tag,
        typ.dept_tag
        typ.dept_tag,
        't_yw_point' as tableName,
        #{query.pointName} as pointName
        FROM
        t_yw_point typ
        LEFT JOIN t_yw_unit tyu ON typ.unit_id = tyu.id AND tyu.deleted = 0
@@ -55,6 +84,19 @@
        </where>
    </select>
    <select id="getDyColumns" resultMap="dynamicColumnMap">
        SELECT
        *
        FROM
        t_dynamic_column_value dcv
        LEFT JOIN t_dynamic_column dc ON dc.id = dcv.dynamic_column_id AND dc.table_name = #{tableName}
        WHERE
        dcv.ref_id = #{id}
        <if test="pointName != null and pointName != ''">
            and dcv.column_value like concat('%', #{keyword}, '%')
        </if>
    </select>
    <select id="dataCenterPage" resultType="com.ycl.platform.domain.vo.PointDetailVO">
        SELECT
               m.*