wms_serve_xugongteji/ruoyi-system/src/main/resources/mapper/app/AppStandMapper.xml
2025-03-07 09:00:40 +08:00

96 lines
5.0 KiB
XML

<?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.app.mapper.AppStandMapper">
<resultMap type="AppStand" id="AppStandResult">
<result property="standId" column="stand_id" />
<result property="standCode" column="stand_code" />
<result property="standName" column="stand_name" />
<result property="standType" column="stand_type" />
<result property="standArea" column="stand_area" />
<result property="standProperty" column="stand_property" />
<result property="standStatus" column="stand_status" />
<result property="isLock" column="is_lock" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectAppStandVo">
select stand_id,stand_code, stand_name, stand_type, stand_area, stand_property, stand_status, is_lock, remark from app_stand
</sql>
<select id="selectAppStandList" parameterType="AppStand" resultMap="AppStandResult">
<include refid="selectAppStandVo"/>
<where>
<if test="standCode != null and standCode != ''"> and stand_code like concat('%', #{standCode}, '%')</if>
<if test="standName != null and standName != ''"> and stand_name like concat('%', #{standName}, '%')</if>
<if test="standType != null and standType != ''"> and stand_type = #{standType}</if>
<if test="standArea != null and standArea != ''"> and stand_area = #{standArea}</if>
<if test="standProperty != null and standProperty != ''"> and stand_property = #{standProperty}</if>
<if test="standStatus != null "> and stand_status = #{standStatus}</if>
<if test="isLock != null "> and is_lock = #{isLock}</if>
</where>
</select>
<select id="selectAppStandByStandId" parameterType="String" resultMap="AppStandResult">
<include refid="selectAppStandVo"/>
where stand_id = #{standId}
</select>
<select id="selectAppStandByStandCode" parameterType="String" resultMap="AppStandResult">
<include refid="selectAppStandVo"/>
where stand_code = #{standCode}
</select>
<insert id="insertAppStand" parameterType="AppStand">
insert into app_stand
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="standId != null">stand_id,</if>
<if test="standCode != null and standCode != ''">stand_code,</if>
<if test="standName != null and standName != ''">stand_name,</if>
<if test="standType != null and standType != ''">stand_type,</if>
<if test="standArea != null and standArea != ''">stand_area,</if>
<if test="standProperty != null and standProperty != ''">stand_property,</if>
<if test="standStatus != null">stand_status,</if>
<if test="isLock != null">is_lock,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="standId != null">#{standId},</if>
<if test="standCode != null and standCode != ''">#{standCode},</if>
<if test="standName != null and standName != ''">#{standName},</if>
<if test="standType != null and standType != ''">#{standType},</if>
<if test="standArea != null and standArea != ''">#{standArea},</if>
<if test="standProperty != null and standProperty != ''">#{standProperty},</if>
<if test="standStatus != null">#{standStatus},</if>
<if test="isLock != null">#{isLock},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateAppStand" parameterType="AppStand">
update app_stand
<trim prefix="SET" suffixOverrides=",">
<if test="standCode != null and standCode != ''">stand_code = #{standCode},</if>
<if test="standName != null and standName != ''">stand_name = #{standName},</if>
<if test="standType != null and standType != ''">stand_type = #{standType},</if>
<if test="standArea != null and standArea != ''">stand_area = #{standArea},</if>
<if test="standProperty != null and standProperty != ''">stand_property = #{standProperty},</if>
<if test="standStatus != null">stand_status = #{standStatus},</if>
<if test="isLock != null">is_lock = #{isLock},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where stand_id = #{standId}
</update>
<delete id="deleteAppStandByStandId" parameterType="String">
delete from app_stand where stand_id = #{standId}
</delete>
<delete id="deleteAppStandByStandIds" parameterType="String">
delete from app_stand where stand_id in
<foreach item="standId" collection="array" open="(" separator="," close=")">
#{standId}
</foreach>
</delete>
</mapper>