12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?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="cn.ezhizao.project.business.order.mapper.BizArchiveInputDetailMapper">
- <resultMap type="cn.ezhizao.project.business.order.domain.BizArchiveInputDetail" id="BizArchiveInputDetailResult">
- <id column="id" property="id"/>
- <association property="arrived" column="id" select="getArrived" javaType="java.math.BigDecimal" />
- </resultMap>
- <select id="getArrived" resultType="java.math.BigDecimal">
- SELECT sum(t1.arrive_amount) from biz_collection_detail t1
- left join biz_collection t2 on t2.id = t1.collection_id
- where t1.deleted = 0 and t1.contract_detail_id = #{id} and t2.status = 1
- </select>
- <select id="getList" parameterType="BizArchiveInputDetail" resultMap="BizArchiveInputDetailResult">
- SELECT t1.*, t2.name as task_type_name, t2.pay_address,t3.dict_label as regionName
- FROM biz_archive_input_detail t1
- left join biz_task_type t2 on t2.id = t1.task_type_id
- left join sys_dict_data t3 on t1.belong_region = t3.dict_code
- <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
- t1.deleted = 0
- <if test="id != null "> AND t1.id = #{id}</if>
- <if test="companyId != null "> AND t1.company_id = #{companyId}</if>
- <if test="contractId != null "> AND t1.contract_id = #{contractId}</if>
- <if test="serviceNum != null "> AND t1.service_num = #{serviceNum}</if>
- <if test="price != null "> AND t1.price = #{price}</if>
- <if test="amount != null "> AND t1.amount = #{amount}</if>
- </trim>
- </select>
- <delete id="physicalDelete">
- DELETE FROM biz_archive_input_detail
- <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
- <if test="id != null">
- id = #{id} AND
- </if>
- <if test="contractId != null ">
- contract_id = #{contractId} AND
- </if>
- <if test="companyId != null ">
- company_id = #{companyId} AND
- </if>
- <!-- 删除条件为其他外键可以在这里加 -->
- </trim>
- </delete>
- </mapper>
|