| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- <?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.system.mapper.PropertyMapper">
-
- <resultMap type="Property" id="PropertyResult">
- <id property="id" column="id"/>
- <result property="productId" column="product_id"/>
- <result property="name" column="name"/>
- <result property="count" column="count"/>
- <result property="unitprice" column="unitprice"/>
- <result property="wholesale" column="wholesale"/>
- <result property="installationCost" column="installation_cost"/>
- <result property="opCost" column="op_cost"/>
- <result property="warrantyPeriod" column="warranty_period"/>
- <result property="extendedWarrantyPrice" column="extended_warranty_price"/>
- <result property="expectedServiceLife" column="expected_service_life"/>
- <result property="depreciationRate" column="depreciation_rate"/>
- <result property="brand" column="brand"/>
- <result property="productSpecifications" column="product_specifications"/>
- <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="selectPropertyVo">
- select id, product_id, name, count, unitprice, wholesale, installation_cost, op_cost, warranty_period,
- extended_warranty_price, expected_service_life, depreciation_rate, brand, product_specifications,
- create_by, create_time, update_by, update_time
- from property
- </sql>
-
- <select id="selectPropertyList" parameterType="Property" resultMap="PropertyResult">
- <include refid="selectPropertyVo"/>
- <where>
- <if test="productId != null and productId != ''">
- AND product_id = #{productId}
- </if>
- <if test="name != null and name != ''">
- AND name like concat('%', #{name}, '%')
- </if>
- <if test="brand != null and brand != ''">
- AND brand like concat('%', #{brand}, '%')
- </if>
- <if test="params.beginTime != null and params.beginTime != ''">
- and date_format(create_time,'%Y%m%d') >= date_format(#{params.beginTime},'%Y%m%d')
- </if>
- <if test="params.endTime != null and params.endTime != ''">
- and date_format(create_time,'%Y%m%d') <= date_format(#{params.endTime},'%Y%m%d')
- </if>
- </where>
- </select>
-
- <select id="selectPropertyById" parameterType="Long" resultMap="PropertyResult">
- <include refid="selectPropertyVo"/>
- where id = #{id}
- </select>
-
- <insert id="insertProperty" parameterType="Property">
- insert into property (
- <if test="productId != null and productId != ''">product_id,</if>
- <if test="name != null and name != ''">name,</if>
- <if test="count != null">count,</if>
- <if test="unitprice != null">unitprice,</if>
- <if test="wholesale != null">wholesale,</if>
- <if test="installationCost != null">installation_cost,</if>
- <if test="opCost != null">op_cost,</if>
- <if test="warrantyPeriod != null and warrantyPeriod != ''">warranty_period,</if>
- <if test="extendedWarrantyPrice != null">extended_warranty_price,</if>
- <if test="expectedServiceLife != null and expectedServiceLife != ''">expected_service_life,</if>
- <if test="depreciationRate != null">depreciation_rate,</if>
- <if test="brand != null and brand != ''">brand,</if>
- <if test="productSpecifications != null and productSpecifications != ''">product_specifications,</if>
- <if test="createBy != null and createBy != ''">create_by,</if>
- create_time
- )values(
- <if test="productId != null and productId != ''">#{productId},</if>
- <if test="name != null and name != ''">#{name},</if>
- <if test="count != null">#{count},</if>
- <if test="unitprice != null">#{unitprice},</if>
- <if test="wholesale != null">#{wholesale},</if>
- <if test="installationCost != null">#{installationCost},</if>
- <if test="opCost != null">#{opCost},</if>
- <if test="warrantyPeriod != null and warrantyPeriod != ''">#{warrantyPeriod},</if>
- <if test="extendedWarrantyPrice != null">#{extendedWarrantyPrice},</if>
- <if test="expectedServiceLife != null and expectedServiceLife != ''">#{expectedServiceLife},</if>
- <if test="depreciationRate != null">#{depreciationRate},</if>
- <if test="brand != null and brand != ''">#{brand},</if>
- <if test="productSpecifications != null and productSpecifications != ''">#{productSpecifications},</if>
- <if test="createBy != null and createBy != ''">#{createBy},</if>
- sysdate()
- )
- </insert>
-
- <update id="updateProperty" parameterType="Property">
- update property
- <set>
- <if test="productId != null and productId != ''">product_id = #{productId},</if>
- <if test="name != null and name != ''">name = #{name},</if>
- <if test="count != null">count = #{count},</if>
- <if test="unitprice != null">unitprice = #{unitprice},</if>
- <if test="wholesale != null">wholesale = #{wholesale},</if>
- <if test="installationCost != null">installation_cost = #{installationCost},</if>
- <if test="opCost != null">op_cost = #{opCost},</if>
- <if test="warrantyPeriod != null and warrantyPeriod != ''">warranty_period = #{warrantyPeriod},</if>
- <if test="extendedWarrantyPrice != null">extended_warranty_price = #{extendedWarrantyPrice},</if>
- <if test="expectedServiceLife != null and expectedServiceLife != ''">expected_service_life = #{expectedServiceLife},</if>
- <if test="depreciationRate != null">depreciation_rate = #{depreciationRate},</if>
- <if test="brand != null and brand != ''">brand = #{brand},</if>
- <if test="productSpecifications != null and productSpecifications != ''">product_specifications = #{productSpecifications},</if>
- <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
- update_time = sysdate()
- </set>
- where id = #{id}
- </update>
-
- <delete id="deletePropertyById" parameterType="Long">
- delete from property where id = #{id}
- </delete>
-
- <delete id="deletePropertyByIds" parameterType="Long">
- delete from property where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
-
- </mapper>
|