From 7634d7ff15b1fa84ea84a51a1ba6e45b11a4aa21 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期日, 27 四月 2025 11:17:34 +0800 Subject: [PATCH] SSO登录逻辑再修改 --- pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrIrrigateUnitMapper.xml | 198 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 198 insertions(+), 0 deletions(-) diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrIrrigateUnitMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrIrrigateUnitMapper.xml new file mode 100644 index 0000000..c5d4759 --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrIrrigateUnitMapper.xml @@ -0,0 +1,198 @@ +<?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.daoIr.IrIrrigateUnitMapper"> + <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoIr.IrIrrigateUnit"> + <!--@mbg.generated--> + <!--@Table ir_irrigate_unit--> + <id column="id" jdbcType="BIGINT" property="id" /> + <result column="project_id" jdbcType="BIGINT" property="projectId" /> + <result column="intake_id" jdbcType="BIGINT" property="intakeId" /> + <result column="area" jdbcType="FLOAT" property="area" /> + <result column="remarks" jdbcType="VARCHAR" property="remarks" /> + <result column="operator" jdbcType="BIGINT" property="operator" /> + <result column="operate_time" jdbcType="TIMESTAMP" property="operateDt" /> + <result column="deleted" jdbcType="TINYINT" property="deleted" /> + </resultMap> + <sql id="Base_Column_List"> + <!--@mbg.generated--> + id, project_id,intake_id, area, remarks, `operator`, + operate_time, deleted + </sql> + + <!--娣诲姞--> + <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoIr.IrIrrigateUnit"> + <!--@mbg.generated--> + insert into ir_irrigate_unit + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="id != null"> + id, + </if> + <if test="projectId != null"> + project_id, + </if> + <if test="intakeId != null"> + intake_id, + </if> + <if test="area != null"> + area, + </if> + <if test="remarks != null"> + remarks, + </if> + <if test="operator != null"> + `operator`, + </if> + <if test="operateDt != null"> + operate_time, + </if> + <if test="deleted != null"> + deleted, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="id != null"> + #{id,jdbcType=BIGINT}, + </if> + <if test="projectId != null"> + #{projectId,jdbcType=BIGINT}, + </if> + <if test="intakeId != null"> + #{intakeId,jdbcType=BIGINT}, + </if> + <if test="area != null"> + #{area,jdbcType=FLOAT}, + </if> + <if test="remarks != null"> + #{remarks,jdbcType=VARCHAR}, + </if> + <if test="operator != null"> + #{operator,jdbcType=BIGINT}, + </if> + <if test="operateDt != null"> + #{operateDt,jdbcType=TIMESTAMP}, + </if> + <if test="deleted != null"> + #{deleted,jdbcType=TINYINT}, + </if> + </trim> + </insert> + + <!--閫昏緫鍒犻櫎--> + <delete id="deleteLogicById" parameterType="java.lang.Long"> + <!--@mbg.generated--> + update ir_irrigate_unit + set deleted = 1 + where id = #{id,jdbcType=BIGINT} + </delete> + <!--淇敼涓�涓亴婧夊崟鍏�--> + <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoIr.IrIrrigateUnit"> + update ir_irrigate_unit + <set> + <if test="projectId != null"> + project_id = #{projectId,jdbcType=BIGINT}, + </if> + <if test="intakeId != null"> + intake_id = #{intakeId,jdbcType=BIGINT}, + </if> + <if test="area != null"> + area = #{area,jdbcType=FLOAT}, + </if> + <if test="remarks != null"> + remarks = #{remarks,jdbcType=VARCHAR}, + </if> + <if test="operator != null"> + operator = #{operator,jdbcType=BIGINT}, + </if> + <if test="operateDt != null"> + operate_time = #{operateDt,jdbcType=TIMESTAMP}, + </if> + <if test="deleted != null"> + deleted = #{deleted,jdbcType=TINYINT}, + </if> + </set> + where id = #{id,jdbcType=BIGINT} + </update> + <!--鏌ヤ竴涓亴婧夊崟鍏�--> + <select id="selectById" resultType="com.dy.pipIrrGlobal.voIr.VoUnitOne"> + select + CAST(pro.id AS char)AS projectId, + pro.project_name AS projectName, + CAST(intake.id AS char)AS intakeId, + intake.name AS intakeName, + CAST(uni.id AS char)AS id, + CAST(uni.operator AS char)AS operator, + cli.name AS operatorName, + gru.group_code AS groupCode, + uni.area, + uni.remarks, + uni.operate_time AS operateDt + from ir_irrigate_unit uni + left join pr_intake intake on intake.id = uni.intake_id + left join ir_project pro on pro.id = uni.project_id + left join se_client cli on cli.id = uni.operator + left join ir_group_unit gu on gu.unit_id = uni.id + left join ir_irrigate_group gru on gru.id = gu.group_id + where uni.id = #{id,jdbcType=BIGINT} and uni.deleted = 0 + </select> + <!--鍒嗛〉鏌ョ亴婧夊崟鍏�--> + <select id="getUnits" resultType="com.dy.pipIrrGlobal.voIr.VoUnit"> + SELECT + CAST(pro.id AS char)AS projectId, + pro.project_name AS projectName, + CAST(intake.id AS char)AS intakeId, + intake.name AS intakeName, + CAST(uni.id AS char)AS unitId, + CAST(uni.operator AS char)AS operator, + cli.name AS operatorName, + gru.group_code AS groupCode, + uni.area, + uni.remarks, + uni.operate_time AS operateDt + FROM ir_irrigate_unit uni + left join pr_intake intake on intake.id = uni.intake_id + left join ir_project pro on pro.id = uni.project_id + left join se_client cli on cli.id = uni.operator + left join ir_group_unit gu on gu.unit_id = uni.id + left join ir_irrigate_group gru on gru.id = gu.group_id + <where> + uni.deleted = 0 + <if test="projectName != null and projectName != ''"> + AND pro.project_name LIKE CONCAT('%', #{projectName}, '%') + </if> + <if test = "groupCode != null and groupCode != ''"> + AND gru.group_code = #{groupCode} + </if> + </where> + ORDER BY uni.operate_time DESC + <if test="pageCurr != null and pageSize != null"> + LIMIT ${(pageCurr-1)*pageSize}, ${pageSize} + </if> + </select> + <!--鍒嗛〉鏌ョ亴婧夊崟鍏冭褰曟暟--> + <select id="getRecordCount" resultType="java.lang.Long"> + SELECT COUNT(*) AS recordCount + FROM ir_irrigate_unit uni + left join pr_intake intake on intake.id = uni.intake_id + left join ir_project pro on pro.id = uni.project_id + left join se_client cli on cli.id = uni.operator + left join ir_group_unit gu on gu.unit_id = uni.id + left join ir_irrigate_group gru on gru.id = gu.group_id + <where> + uni.deleted = 0 + <if test="projectName != null and projectName != ''"> + AND pro.project_name LIKE CONCAT('%', #{projectName}, '%') + </if> + <if test = "groupCode != null and groupCode != ''"> + AND gru.group_code = #{groupCode} + </if> + </where> + </select> + + <!--鏍规嵁鐏屾簤鍗曞厓ID鑾峰彇鍙栨按鍙D--> + <select id="getIntakeIdByUnitId" resultType="java.lang.Long"> + SELECT + intake_id AS intakeId + FROM ir_irrigate_unit + WHERE deleted = 0 AND id = #{unitId} + </select> +</mapper> \ No newline at end of file -- Gitblit v1.8.0