<?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.PaidMoneyAddMapper">
|
|
<resultMap id="PaidMoneyAddResult" type="com.ruoyi.system.domain.PaidMoneyAdd">
|
<result property="id" column="id" />
|
<result property="toServiceOrdID" column="ToServiceOrdID" />
|
<result property="toDispatchOrdID" column="ToDispatchOrdID" />
|
<result property="addMoneyType" column="AddMoneyType" />
|
<result property="addMoney" column="AddMoney" />
|
<result property="addMoneyExplain" column="AddMoneyExplain" />
|
<result property="addMoneyTime" column="AddMoneyTime" />
|
<result property="addMoneyOAID" column="AddMoneyOAID" />
|
</resultMap>
|
|
<sql id="selectPaidMoneyAddVo">
|
SELECT id, ToServiceOrdID, ToDispatchOrdID, AddMoneyType, AddMoney,
|
AddMoneyExplain, AddMoneyTime, AddMoneyOAID
|
FROM PaidMoney_Add
|
</sql>
|
|
<select id="selectById" parameterType="Long" resultMap="PaidMoneyAddResult">
|
<include refid="selectPaidMoneyAddVo"/>
|
WHERE id = #{id}
|
</select>
|
|
<select id="selectByOrderIds" resultMap="PaidMoneyAddResult">
|
<include refid="selectPaidMoneyAddVo"/>
|
WHERE ToServiceOrdID = #{toServiceOrdID}
|
AND ToDispatchOrdID = #{toDispatchOrdID}
|
ORDER BY id DESC
|
</select>
|
|
<select id="selectRecentRecords" resultMap="PaidMoneyAddResult">
|
<include refid="selectPaidMoneyAddVo"/>
|
WHERE AddMoneyTime >= DATEADD(HOUR, -#{hours}, GETDATE())
|
ORDER BY id DESC
|
</select>
|
|
<insert id="insert" parameterType="com.ruoyi.system.domain.PaidMoneyAdd" useGeneratedKeys="true" keyProperty="id">
|
INSERT INTO PaidMoney_Add
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="toServiceOrdID != null">ToServiceOrdID,</if>
|
<if test="toDispatchOrdID != null">ToDispatchOrdID,</if>
|
<if test="addMoneyType != null">AddMoneyType,</if>
|
<if test="addMoney != null">AddMoney,</if>
|
<if test="addMoneyExplain != null and addMoneyExplain != ''">AddMoneyExplain,</if>
|
<if test="addMoneyTime != null">AddMoneyTime,</if>
|
<if test="addMoneyOAID != null">AddMoneyOAID,</if>
|
</trim>
|
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
<if test="toServiceOrdID != null">#{toServiceOrdID},</if>
|
<if test="toDispatchOrdID != null">#{toDispatchOrdID},</if>
|
<if test="addMoneyType != null">#{addMoneyType},</if>
|
<if test="addMoney != null">#{addMoney},</if>
|
<if test="addMoneyExplain != null and addMoneyExplain != ''">#{addMoneyExplain},</if>
|
<if test="addMoneyTime != null">#{addMoneyTime},</if>
|
<if test="addMoneyOAID != null">#{addMoneyOAID},</if>
|
</trim>
|
</insert>
|
|
<update id="update" parameterType="com.ruoyi.system.domain.PaidMoneyAdd">
|
UPDATE PaidMoney_Add
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="toServiceOrdID != null">ToServiceOrdID = #{toServiceOrdID},</if>
|
<if test="toDispatchOrdID != null">ToDispatchOrdID = #{toDispatchOrdID},</if>
|
<if test="addMoneyType != null">AddMoneyType = #{addMoneyType},</if>
|
<if test="addMoney != null">AddMoney = #{addMoney},</if>
|
<if test="addMoneyExplain != null">AddMoneyExplain = #{addMoneyExplain},</if>
|
<if test="addMoneyTime != null">AddMoneyTime = #{addMoneyTime},</if>
|
<if test="addMoneyOAID != null">AddMoneyOAID = #{addMoneyOAID},</if>
|
</trim>
|
WHERE id = #{id}
|
</update>
|
|
<delete id="deleteById" parameterType="Long">
|
DELETE FROM PaidMoney_Add WHERE id = #{id}
|
</delete>
|
|
</mapper>
|