|
@@ -0,0 +1,128 @@
|
|
|
+<?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.anpin.mapper.TAssetsMapper">
|
|
|
+
|
|
|
+ <resultMap type="TAssets" id="TAssetsResult">
|
|
|
+ <result property="fId" column="f_id"/>
|
|
|
+ <result property="fDept" column="f_dept"/>
|
|
|
+ <result property="fName" column="f_name"/>
|
|
|
+ <result property="fSpec" column="f_spec"/>
|
|
|
+ <result property="fUnit" column="f_unit"/>
|
|
|
+ <result property="fNumber" column="f_number"/>
|
|
|
+ <result property="fAmount" column="f_amount"/>
|
|
|
+ <result property="fImage" column="f_image"/>
|
|
|
+ <result property="remark" column="remark"/>
|
|
|
+ <result property="fCode" column="f_code"/>
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="updateBy" column="update_by"/>
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectTAssetsVo">
|
|
|
+ select f_id,
|
|
|
+ f_dept,
|
|
|
+ f_name,
|
|
|
+ f_spec,
|
|
|
+ f_unit,
|
|
|
+ f_number,
|
|
|
+ f_amount,
|
|
|
+ f_image,
|
|
|
+ remark,
|
|
|
+ f_code,
|
|
|
+ create_by,
|
|
|
+ create_time,
|
|
|
+ update_by,
|
|
|
+ update_time
|
|
|
+ from t_assets
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectTAssetsList" parameterType="TAssets" resultMap="TAssetsResult">
|
|
|
+ <include refid="selectTAssetsVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="fDept != null and fDept != ''">and f_dept = #{fDept}</if>
|
|
|
+ <if test="fName != null and fName != ''">and f_name like concat('%', #{fName}, '%')</if>
|
|
|
+ <if test="fSpec != null and fSpec != ''">and f_spec = #{fSpec}</if>
|
|
|
+ <if test="fUnit != null and fUnit != ''">and f_unit = #{fUnit}</if>
|
|
|
+ <if test="fNumber != null ">and f_number = #{fNumber}</if>
|
|
|
+ <if test="fAmount != null ">and f_amount = #{fAmount}</if>
|
|
|
+ <if test="fImage != null and fImage != ''">and f_image = #{fImage}</if>
|
|
|
+ <if test="fCode != null and fCode != ''">and f_code = #{fCode}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectTAssetsById" parameterType="Long" resultMap="TAssetsResult">
|
|
|
+ <include refid="selectTAssetsVo"/>
|
|
|
+ where f_id = #{fId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertTAssets" parameterType="TAssets" useGeneratedKeys="true" keyProperty="fId">
|
|
|
+ insert into t_assets
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="fDept != null">f_dept,</if>
|
|
|
+ <if test="fName != null">f_name,</if>
|
|
|
+ <if test="fSpec != null">f_spec,</if>
|
|
|
+ <if test="fUnit != null">f_unit,</if>
|
|
|
+ <if test="fNumber != null">f_number,</if>
|
|
|
+ <if test="fAmount != null">f_amount,</if>
|
|
|
+ <if test="fImage != null">f_image,</if>
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
+ <if test="fCode != null">f_code,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="fDept != null">#{fDept},</if>
|
|
|
+ <if test="fName != null">#{fName},</if>
|
|
|
+ <if test="fSpec != null">#{fSpec},</if>
|
|
|
+ <if test="fUnit != null">#{fUnit},</if>
|
|
|
+ <if test="fNumber != null">#{fNumber},</if>
|
|
|
+ <if test="fAmount != null">#{fAmount},</if>
|
|
|
+ <if test="fImage != null">#{fImage},</if>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ <if test="fCode != null">#{fCode},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateTAssets" parameterType="TAssets">
|
|
|
+ update t_assets
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="fDept != null">f_dept = #{fDept},</if>
|
|
|
+ <if test="fName != null">f_name = #{fName},</if>
|
|
|
+ <if test="fSpec != null">f_spec = #{fSpec},</if>
|
|
|
+ <if test="fUnit != null">f_unit = #{fUnit},</if>
|
|
|
+ <if test="fNumber != null">f_number = #{fNumber},</if>
|
|
|
+ <if test="fAmount != null">f_amount = #{fAmount},</if>
|
|
|
+ <if test="fImage != null">f_image = #{fImage},</if>
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
+ <if test="fCode != null">f_code = #{fCode},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ </trim>
|
|
|
+ where f_id = #{fId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteTAssetsById" parameterType="Long">
|
|
|
+ delete
|
|
|
+ from t_assets
|
|
|
+ where f_id = #{fId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteTAssetsByIds" parameterType="String">
|
|
|
+ delete from t_assets where f_id in
|
|
|
+ <foreach item="fId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{fId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|