From b3b17b231e2f2840332ce6eb96f791865fdec6d5 Mon Sep 17 00:00:00 2001 From: zhubaomin <zhubaomin> Date: 星期一, 14 四月 2025 16:38:16 +0800 Subject: [PATCH] 代码优化 --- pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrGroupIntakeMapper.xml | 93 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 93 insertions(+), 0 deletions(-) diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrGroupIntakeMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrGroupIntakeMapper.xml new file mode 100644 index 0000000..e017190 --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrGroupIntakeMapper.xml @@ -0,0 +1,93 @@ +<?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.IrGroupIntakeMapper"> + <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoIr.IrGroupIntake"> + <!--@mbg.generated--> + <!--@Table ir_group_intake--> + <id column="id" jdbcType="BIGINT" property="id" /> + <result column="group_id" jdbcType="BIGINT" property="groupId" /> + <result column="intake_id" jdbcType="BIGINT" property="intakeId" /> + </resultMap> + <sql id="Base_Column_List"> + <!--@mbg.generated--> + id, group_id, intake_id + </sql> + <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> + <!--@mbg.generated--> + select + <include refid="Base_Column_List" /> + from ir_group_intake + where id = #{id,jdbcType=BIGINT} + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> + <!--@mbg.generated--> + delete from ir_group_intake + where id = #{id,jdbcType=BIGINT} + </delete> + <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoIr.IrGroupIntake"> + <!--@mbg.generated--> + insert into ir_group_intake (id, group_id, intake_id + ) + values (#{id,jdbcType=BIGINT}, #{groupId,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT} + ) + </insert> + <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoIr.IrGroupIntake"> + <!--@mbg.generated--> + insert into ir_group_intake + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="id != null"> + id, + </if> + <if test="groupId != null"> + group_id, + </if> + <if test="intakeId != null"> + intake_id, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="id != null"> + #{id,jdbcType=BIGINT}, + </if> + <if test="groupId != null"> + #{groupId,jdbcType=BIGINT}, + </if> + <if test="intakeId != null"> + #{intakeId,jdbcType=BIGINT}, + </if> + </trim> + </insert> + <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoIr.IrGroupIntake"> + <!--@mbg.generated--> + update ir_group_intake + <set> + <if test="groupId != null"> + group_id = #{groupId,jdbcType=BIGINT}, + </if> + <if test="intakeId != null"> + intake_id = #{intakeId,jdbcType=BIGINT}, + </if> + </set> + where id = #{id,jdbcType=BIGINT} + </update> + <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoIr.IrGroupIntake"> + <!--@mbg.generated--> + update ir_group_intake + set group_id = #{groupId,jdbcType=BIGINT}, + intake_id = #{intakeId,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + </update> + + <!--鏍规嵁缁処D鑾峰彇鍙栨按鍙D闆嗗悎--> + <select id="getIntakeIdsByGroupId" resultType="java.lang.Long"> + SELECT + intake_id AS intakeId + FROM ir_group_intake + WHERE group_id = #{groupId} + </select> + + <!--鏍规嵁缁処D鍒犻櫎鍙栨按鍙e叧鑱�--> + <delete id="deleteByGroupId"> + DELETE FROM ir_group_intake WHERE group_id = #{groupId} + </delete> +</mapper> \ No newline at end of file -- Gitblit v1.8.0