|
@@ -21,17 +21,19 @@
|
|
|
<result column="code" property="code" jdbcType="VARCHAR" />
|
|
|
<result column="amount_invoice" property="amountInvoice" jdbcType="DECIMAL" />
|
|
|
<result column="billing_date" property="billingDate" jdbcType="TIMESTAMP" />
|
|
|
- <result column="number_periods" property="numberPeriods" jdbcType="INTEGER" />
|
|
|
+ <result column="periods" property="periods" jdbcType="VARCHAR" />
|
|
|
+ <result column="cost_name" property="CostName" jdbcType="VARCHAR" />
|
|
|
+ <result column="cost_desc" property="CostDesc" jdbcType="VARCHAR" />
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="Base_Column_List" >
|
|
|
id, contracts_id, type, summary, plan_money, work_money, plan_date, work_date, cashier_user,
|
|
|
is_ticket, is_collection, remarks, status, note_img_url, bank_img_url, create_date, code, amount_invoice, billing_date,
|
|
|
- number_periods
|
|
|
+ periods, cost_name, cost_desc
|
|
|
</sql>
|
|
|
|
|
|
- <select id="findByCondition" parameterType="cn.com.ty.lift.business.contract.dao.entity.model.request.PaymentRequest"
|
|
|
- resultType="cn.com.ty.lift.business.contract.dao.entity.model.response.PaymentResponse">
|
|
|
+ <select id="findProjectByCondition" parameterType="cn.com.ty.lift.business.contract.dao.entity.model.request.PaymentRequest"
|
|
|
+ resultType="cn.com.ty.lift.business.contract.dao.entity.model.response.PaymentListResponse">
|
|
|
SELECT
|
|
|
p.id AS projectId,
|
|
|
c.id AS contractId,
|
|
@@ -55,7 +57,32 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
- <select id="queryContractDetailById" parameterType="cn.com.ty.lift.business.contract.dao.entity.model.request.PaymentRequest"
|
|
|
+ <select id="findCapitalByCondition" parameterType="cn.com.ty.lift.business.contract.dao.entity.model.request.PaymentRequest"
|
|
|
+ resultType="cn.com.ty.lift.business.contract.dao.entity.model.response.PaymentListResponse">
|
|
|
+ SELECT
|
|
|
+ cr.id AS projectId,
|
|
|
+ c.id AS contractId,
|
|
|
+ c.code AS contractCode,
|
|
|
+ cr.project_name AS projectName,
|
|
|
+ pa.code AS paymentCode,
|
|
|
+ pa.plan_money AS planMoney,
|
|
|
+ pa.work_money AS workMoney,
|
|
|
+ pa.plan_date AS planDate,
|
|
|
+ pa.work_date AS workDate,
|
|
|
+ pa.cashier_user AS cashierUser
|
|
|
+ FROM contracts c
|
|
|
+ LEFT JOIN payment pa ON c.id = pa.contracts_id
|
|
|
+ LEFT JOIN capital_repair cr ON c.project_id = cr.id
|
|
|
+ WHERE c.mt_company_id = #{request.mtCompanyId,jdbcType=BIGINT}
|
|
|
+ <if test="request.projectName!=null and request.projectName!=''">
|
|
|
+ AND cr.project_name LIKE CONCAT('%',#{request.projectName,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ <if test="request.paymentType!=null and request.paymentType!=''">
|
|
|
+ AND pa.type = #{request.paymentType,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="queryProjectDetailById" parameterType="cn.com.ty.lift.business.contract.dao.entity.model.request.PaymentRequest"
|
|
|
resultType="cn.com.ty.lift.business.contract.dao.entity.model.response.PaymentDetailResponse">
|
|
|
SELECT
|
|
|
p.project_name AS projectName,
|
|
@@ -79,4 +106,28 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
+ <select id="queryCapitalDetailById" parameterType="cn.com.ty.lift.business.contract.dao.entity.model.request.PaymentRequest"
|
|
|
+ resultType="cn.com.ty.lift.business.contract.dao.entity.model.response.PaymentDetailResponse">
|
|
|
+ SELECT
|
|
|
+ cr.project_name AS projectName,
|
|
|
+ cr.project_address AS projectAddress,
|
|
|
+ c.code AS contractCode,
|
|
|
+ c.source AS contractSource,
|
|
|
+ c.type AS contractType,
|
|
|
+ c.lift_num AS liftNum,
|
|
|
+ c.star_date AS starDate,
|
|
|
+ c.end_date AS endDate,
|
|
|
+ c.pay_mode AS payMode,
|
|
|
+ c.moneys AS moneys,
|
|
|
+ c.given_date AS givenDate,
|
|
|
+ c.given_user AS givenUser,
|
|
|
+ c.remarks AS remarks
|
|
|
+ FROM contracts c
|
|
|
+ LEFT JOIN capital_repair cr ON c.project_id = cr.id
|
|
|
+ WHERE c.mt_company_id = #{request.mtCompanyId,jdbcType=BIGINT}
|
|
|
+ <if test="request.id!=null and request.id!=''">
|
|
|
+ AND c.id = #{request.id,jdbcType=BIGINT}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|