| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?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.management.platform.mapper.ExpenseItemMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.management.platform.entity.ExpenseItem">
- <id column="id" property="id" />
- <result column="expense_id" property="expenseId" />
- <result column="project_id" property="projectId" />
- <result column="happen_date" property="happenDate" />
- <result column="invoice_type" property="invoiceType" />
- <result column="invoice_no" property="invoiceNo" />
- <result column="tax_percent" property="taxPercent" />
- <result column="tax_value" property="taxValue" />
- <result column="amount" property="amount" />
- <result column="remark" property="remark" />
- <result column="expense_type" property="expenseType" />
- <result column="pic" property="pic" />
- </resultMap>
- <resultMap id="UserBaseResultMap" type="com.management.platform.entity.vo.ExpenseItemVO">
- <id column="id" property="id" />
- <result column="expense_id" property="expenseId" />
- <result column="project_id" property="projectId" />
- <result column="happen_date" property="happenDate" />
- <result column="invoice_type" property="invoiceType" />
- <result column="invoice_no" property="invoiceNo" />
- <result column="tax_percent" property="taxPercent" />
- <result column="tax_value" property="taxValue" />
- <result column="amount" property="amount" />
- <result column="remark" property="remark" />
- <result column="expense_type" property="expenseType" />
- <result column="pic" property="pic" />
- <result column="username" property="username" />
- <result column="department_name" property="departmentName" />
- </resultMap>
- <!-- 通用查询结果列 -->
- <sql id="Base_Column_List">
- id, expense_id, project_id, happen_date, invoice_type, invoice_no, tax_percent, tax_value, amount, remark, expense_type, pic
- </sql>
- <select id="getUserExpenseDetail" resultMap="UserBaseResultMap">
- select a.id, a.expense_id, a.project_id, a.happen_date, a.invoice_type, a.tax_percent, a.tax_value, a.amount, a.remark, a.expense_type, a.pic,
- user.name as username, department.department_name
- from expense_item a left join expense_sheet b on a.expense_id = b.id
- left join user on user.id = b.owner_id
- left join department on department.department_id = user.department_id
- where a.project_id = #{projectId}
- </select>
- </mapper>
|