JNBusinessTest/ruoyi-system/target/classes/mapper/expenses/ExpensesMapper.xml

200 lines
16 KiB
XML
Raw Normal View History

2024-08-01 17:23:46 +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.expenses.mapper.ExpensesMapper">
<resultMap type="Expenses" id="ExpensesResult">
<result property="expId" column="exp_id" />
<result property="expCode" column="exp_code" />
<result property="expPqCode" column="exp_pq_code" />
<result property="expBidCode" column="exp_bid_code" />
<result property="expExpenditureMode" column="exp_expenditure_mode" />
<result property="expCustomerBm" column="exp_customer_bm" />
<result property="expCustomerName" column="exp_customer_name" />
<result property="expExpenditurePeople" column="exp_expenditure_people" />
<result property="expProject" column="exp_project" />
<result property="expReturnDate" column="exp_return_date" />
<result property="expExpenditureType" column="exp_expenditure_type" />
<result property="expExpenditureAmount" column="exp_expenditure_amount" />
<result property="expBidArea" column="exp_bid_area" />
<result property="expExpenditureDate" column="exp_expenditure_date" />
<result property="expExpenditureAmountUppercase" column="exp_expenditure_amount_uppercase" />
<result property="expStaffTureorfales" column="exp_staff_tureorfales" />
<result property="expBackOffice" column="exp_back_office" />
<result property="expSalesmanCode" column="exp_salesman_code" />
<result property="expSalesmanBm" column="exp_salesman_bm" />
<result property="expSalesmanName" column="exp_salesman_name" />
<result property="expSalesmanDeptId" column="exp_salesman_dept_id" />
<result property="expSalesmanDeptName" column="exp_salesman_dept_name" />
<result property="expDispatchStatus" column="exp_dispatch_status" />
<result property="expAccountName" column="exp_account_name" />
<result property="expAccountNumber" column="exp_account_number" />
<result property="expDepositBank" column="exp_deposit_bank" />
<result property="expLineNumberAndOthres" column="exp_line_number_and_othres" />
<result property="expRequestRemark" column="exp_request_remark" />
<result property="expReturnRemark" column="exp_return_remark" />
<result property="expApprovalStatus" column="exp_approval_status" />
<result property="expOaApprovalStatus" column="exp_oa_approval_status" />
<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="selectExpensesVo">
select exp_id, exp_code, exp_pq_code, exp_bid_code, exp_expenditure_mode, exp_customer_bm, exp_customer_name, exp_expenditure_people, exp_project, exp_return_date, exp_expenditure_type, exp_expenditure_amount, exp_bid_area, exp_expenditure_date, exp_expenditure_amount_uppercase, exp_staff_tureorfales, exp_back_office, exp_salesman_code, exp_salesman_bm, exp_salesman_name, exp_salesman_dept_id, exp_salesman_dept_name, exp_dispatch_status, exp_account_name, exp_account_number, exp_deposit_bank, exp_line_number_and_othres, exp_request_remark, exp_return_remark, exp_approval_status, exp_oa_approval_status, create_by, create_time, update_by, update_time from expenses
</sql>
<select id="selectExpensesList" parameterType="Expenses" resultMap="ExpensesResult">
<include refid="selectExpensesVo"/>
<where>
<if test="expCode != null and expCode != ''"> and exp_code like concat('%', #{expCode}, '%')</if>
<if test="expExpenditureMode != null and expExpenditureMode != ''"> and exp_expenditure_mode = #{expExpenditureMode}</if>
<if test="expCustomerName != null and expCustomerName != ''"> and exp_customer_name like concat('%', #{expCustomerName}, '%')</if>
<if test="expProject != null and expProject != ''"> and exp_project like concat('%', #{expProject}, '%')</if>
<if test="expExpenditureType != null and expExpenditureType != ''"> and exp_expenditure_type = #{expExpenditureType}</if>
<if test="expExpenditureAmount != null "> and exp_expenditure_amount like concat('%', #{expExpenditureAmount}, '%')</if>
<if test="params.beginExpExpenditureDate != null and params.beginExpExpenditureDate != '' and params.endExpExpenditureDate != null and params.endExpExpenditureDate != ''"> and exp_expenditure_date between #{params.beginExpExpenditureDate} and #{params.endExpExpenditureDate}</if>
<if test="expSalesmanName != null and expSalesmanName != ''"> and exp_salesman_name like concat('%', #{expSalesmanName}, '%')</if>
<if test="expRequestRemark != null and expRequestRemark != ''"> and exp_request_remark like concat('%', #{expRequestRemark}, '%')</if>
<if test="expApprovalStatus != null and expApprovalStatus != ''"> and exp_approval_status = #{expApprovalStatus}</if>
</where>
</select>
<select id="selectExpensesByExpId" parameterType="String" resultMap="ExpensesResult">
<include refid="selectExpensesVo"/>
where exp_id = #{expId}
</select>
<insert id="insertExpenses" parameterType="Expenses">
insert into expenses
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="expId != null">exp_id,</if>
<if test="expCode != null">exp_code,</if>
<if test="expPqCode != null">exp_pq_code,</if>
<if test="expBidCode != null">exp_bid_code,</if>
<if test="expExpenditureMode != null and expExpenditureMode != ''">exp_expenditure_mode,</if>
<if test="expCustomerBm != null">exp_customer_bm,</if>
<if test="expCustomerName != null and expCustomerName != ''">exp_customer_name,</if>
<if test="expExpenditurePeople != null and expExpenditurePeople != ''">exp_expenditure_people,</if>
<if test="expProject != null and expProject != ''">exp_project,</if>
<if test="expReturnDate != null and expReturnDate != ''">exp_return_date,</if>
<if test="expExpenditureType != null and expExpenditureType != ''">exp_expenditure_type,</if>
<if test="expExpenditureAmount != null">exp_expenditure_amount,</if>
<if test="expBidArea != null">exp_bid_area,</if>
<if test="expExpenditureDate != null and expExpenditureDate != ''">exp_expenditure_date,</if>
<if test="expExpenditureAmountUppercase != null">exp_expenditure_amount_uppercase,</if>
<if test="expStaffTureorfales != null and expStaffTureorfales != ''">exp_staff_tureorfales,</if>
<if test="expBackOffice != null and expBackOffice != ''">exp_back_office,</if>
<if test="expSalesmanCode != null">exp_salesman_code,</if>
<if test="expSalesmanBm != null">exp_salesman_bm,</if>
<if test="expSalesmanName != null and expSalesmanName != ''">exp_salesman_name,</if>
<if test="expSalesmanDeptId != null">exp_salesman_dept_id,</if>
<if test="expSalesmanDeptName != null">exp_salesman_dept_name,</if>
<if test="expDispatchStatus != null">exp_dispatch_status,</if>
<if test="expAccountName != null and expAccountName != ''">exp_account_name,</if>
<if test="expAccountNumber != null and expAccountNumber != ''">exp_account_number,</if>
<if test="expDepositBank != null and expDepositBank != ''">exp_deposit_bank,</if>
<if test="expLineNumberAndOthres != null">exp_line_number_and_othres,</if>
<if test="expRequestRemark != null">exp_request_remark,</if>
<if test="expReturnRemark != null">exp_return_remark,</if>
<if test="expApprovalStatus != null">exp_approval_status,</if>
<if test="expOaApprovalStatus != null">exp_oa_approval_status,</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="expId != null">#{expId},</if>
<if test="expCode != null">#{expCode},</if>
<if test="expPqCode != null">#{expPqCode},</if>
<if test="expBidCode != null">#{expBidCode},</if>
<if test="expExpenditureMode != null and expExpenditureMode != ''">#{expExpenditureMode},</if>
<if test="expCustomerBm != null">#{expCustomerBm},</if>
<if test="expCustomerName != null and expCustomerName != ''">#{expCustomerName},</if>
<if test="expExpenditurePeople != null and expExpenditurePeople != ''">#{expExpenditurePeople},</if>
<if test="expProject != null and expProject != ''">#{expProject},</if>
<if test="expReturnDate != null and expReturnDate != ''">#{expReturnDate},</if>
<if test="expExpenditureType != null and expExpenditureType != ''">#{expExpenditureType},</if>
<if test="expExpenditureAmount != null">#{expExpenditureAmount},</if>
<if test="expBidArea != null">#{expBidArea},</if>
<if test="expExpenditureDate != null and expExpenditureDate != ''">#{expExpenditureDate},</if>
<if test="expExpenditureAmountUppercase != null">#{expExpenditureAmountUppercase},</if>
<if test="expStaffTureorfales != null and expStaffTureorfales != ''">#{expStaffTureorfales},</if>
<if test="expBackOffice != null and expBackOffice != ''">#{expBackOffice},</if>
<if test="expSalesmanCode != null">#{expSalesmanCode},</if>
<if test="expSalesmanBm != null">#{expSalesmanBm},</if>
<if test="expSalesmanName != null and expSalesmanName != ''">#{expSalesmanName},</if>
<if test="expSalesmanDeptId != null">#{expSalesmanDeptId},</if>
<if test="expSalesmanDeptName != null">#{expSalesmanDeptName},</if>
<if test="expDispatchStatus != null">#{expDispatchStatus},</if>
<if test="expAccountName != null and expAccountName != ''">#{expAccountName},</if>
<if test="expAccountNumber != null and expAccountNumber != ''">#{expAccountNumber},</if>
<if test="expDepositBank != null and expDepositBank != ''">#{expDepositBank},</if>
<if test="expLineNumberAndOthres != null">#{expLineNumberAndOthres},</if>
<if test="expRequestRemark != null">#{expRequestRemark},</if>
<if test="expReturnRemark != null">#{expReturnRemark},</if>
<if test="expApprovalStatus != null">#{expApprovalStatus},</if>
<if test="expOaApprovalStatus != null">#{expOaApprovalStatus},</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="updateExpenses" parameterType="Expenses">
update expenses
<trim prefix="SET" suffixOverrides=",">
<if test="expCode != null">exp_code = #{expCode},</if>
<if test="expPqCode != null">exp_pq_code = #{expPqCode},</if>
<if test="expBidCode != null">exp_bid_code = #{expBidCode},</if>
<if test="expExpenditureMode != null and expExpenditureMode != ''">exp_expenditure_mode = #{expExpenditureMode},</if>
<if test="expCustomerBm != null">exp_customer_bm = #{expCustomerBm},</if>
<if test="expCustomerName != null and expCustomerName != ''">exp_customer_name = #{expCustomerName},</if>
<if test="expExpenditurePeople != null and expExpenditurePeople != ''">exp_expenditure_people = #{expExpenditurePeople},</if>
<if test="expProject != null and expProject != ''">exp_project = #{expProject},</if>
<if test="expReturnDate != null and expReturnDate != ''">exp_return_date = #{expReturnDate},</if>
<if test="expExpenditureType != null and expExpenditureType != ''">exp_expenditure_type = #{expExpenditureType},</if>
<if test="expExpenditureAmount != null">exp_expenditure_amount = #{expExpenditureAmount},</if>
<if test="expBidArea != null">exp_bid_area = #{expBidArea},</if>
<if test="expExpenditureDate != null and expExpenditureDate != ''">exp_expenditure_date = #{expExpenditureDate},</if>
<if test="expExpenditureAmountUppercase != null">exp_expenditure_amount_uppercase = #{expExpenditureAmountUppercase},</if>
<if test="expStaffTureorfales != null and expStaffTureorfales != ''">exp_staff_tureorfales = #{expStaffTureorfales},</if>
<if test="expBackOffice != null and expBackOffice != ''">exp_back_office = #{expBackOffice},</if>
<if test="expSalesmanCode != null">exp_salesman_code = #{expSalesmanCode},</if>
<if test="expSalesmanBm != null">exp_salesman_bm = #{expSalesmanBm},</if>
<if test="expSalesmanName != null and expSalesmanName != ''">exp_salesman_name = #{expSalesmanName},</if>
<if test="expSalesmanDeptId != null">exp_salesman_dept_id = #{expSalesmanDeptId},</if>
<if test="expSalesmanDeptName != null">exp_salesman_dept_name = #{expSalesmanDeptName},</if>
<if test="expDispatchStatus != null">exp_dispatch_status = #{expDispatchStatus},</if>
<if test="expAccountName != null and expAccountName != ''">exp_account_name = #{expAccountName},</if>
<if test="expAccountNumber != null and expAccountNumber != ''">exp_account_number = #{expAccountNumber},</if>
<if test="expDepositBank != null and expDepositBank != ''">exp_deposit_bank = #{expDepositBank},</if>
<if test="expLineNumberAndOthres != null">exp_line_number_and_othres = #{expLineNumberAndOthres},</if>
<if test="expRequestRemark != null">exp_request_remark = #{expRequestRemark},</if>
<if test="expReturnRemark != null">exp_return_remark = #{expReturnRemark},</if>
<if test="expApprovalStatus != null">exp_approval_status = #{expApprovalStatus},</if>
<if test="expOaApprovalStatus != null">exp_oa_approval_status = #{expOaApprovalStatus},</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 exp_id = #{expId}
</update>
<delete id="deleteExpensesByExpId" parameterType="String">
delete from expenses where exp_id = #{expId}
</delete>
<delete id="deleteExpensesByExpIds" parameterType="String">
delete from expenses where exp_id in
<foreach item="expId" collection="array" open="(" separator="," close=")">
#{expId}
</foreach>
</delete>
</mapper>