2024-03-11 12:59:39 +08:00
|
|
|
<?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.ruoyi.sapAccount.mapper.SapAccountMapper">
|
2024-03-11 16:28:36 +08:00
|
|
|
|
2024-03-11 12:59:39 +08:00
|
|
|
<resultMap type="SapAccount" id="SapAccountResult">
|
|
|
|
<result property="id" column="id" />
|
|
|
|
<result property="sapBm" column="sap_bm" />
|
|
|
|
<result property="sapName" column="sap_name" />
|
|
|
|
<result property="sapArea" column="sap_area" />
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="selectSapAccountVo">
|
2024-03-11 16:28:36 +08:00
|
|
|
select id, sap_bm, sap_name, sap_area from sap_account
|
2024-03-11 12:59:39 +08:00
|
|
|
</sql>
|
|
|
|
|
|
|
|
<select id="selectSapAccountList" parameterType="SapAccount" resultMap="SapAccountResult">
|
|
|
|
<include refid="selectSapAccountVo"/>
|
2024-03-11 16:28:36 +08:00
|
|
|
<where>
|
2024-03-11 12:59:39 +08:00
|
|
|
<if test="sapBm != null and sapBm != ''"> and sap_bm = #{sapBm}</if>
|
|
|
|
<if test="sapName != null and sapName != ''"> and sap_name like concat('%', #{sapName}, '%')</if>
|
|
|
|
<if test="sapArea != null and sapArea != ''"> and sap_area = #{sapArea}</if>
|
|
|
|
</where>
|
|
|
|
</select>
|
2024-03-11 16:28:36 +08:00
|
|
|
|
2024-03-11 12:59:39 +08:00
|
|
|
<select id="selectSapAccountById" parameterType="Long" resultMap="SapAccountResult">
|
|
|
|
<include refid="selectSapAccountVo"/>
|
|
|
|
where id = #{id}
|
|
|
|
</select>
|
2024-03-11 16:28:36 +08:00
|
|
|
|
2024-03-11 12:59:39 +08:00
|
|
|
<insert id="insertSapAccount" parameterType="SapAccount" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
insert into sap_account
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="sapBm != null and sapBm != ''">sap_bm,</if>
|
|
|
|
<if test="sapName != null and sapName != ''">sap_name,</if>
|
|
|
|
<if test="sapArea != null and sapArea != ''">sap_area,</if>
|
|
|
|
</trim>
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="sapBm != null and sapBm != ''">#{sapBm},</if>
|
|
|
|
<if test="sapName != null and sapName != ''">#{sapName},</if>
|
|
|
|
<if test="sapArea != null and sapArea != ''">#{sapArea},</if>
|
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<update id="updateSapAccount" parameterType="SapAccount">
|
|
|
|
update sap_account
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
|
|
|
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
|
|
|
|
<if test="sapBm != null and sapBm != ''">sap_bm = #{sapBm},</if>
|
|
|
|
<if test="sapName != null and sapName != ''">sap_name = #{sapName},</if>
|
|
|
|
<if test="sapArea != null and sapArea != ''">sap_area = #{sapArea},</if>
|
|
|
|
</trim>
|
|
|
|
where id = #{id}
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<delete id="deleteSapAccountById" parameterType="Long">
|
|
|
|
delete from sap_account where id = #{id}
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
<delete id="deleteSapAccountByIds" parameterType="String">
|
2024-03-11 16:28:36 +08:00
|
|
|
delete from sap_account where id in
|
2024-03-11 12:59:39 +08:00
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
#{id}
|
|
|
|
</foreach>
|
|
|
|
</delete>
|
2024-03-11 16:28:36 +08:00
|
|
|
</mapper>
|