| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832 |
- <?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.goafanti.common.dao.TChangeTaskMapper">
- <resultMap type="com.goafanti.common.model.TChangeTask" id="TChangeTaskMap">
- <result property="id" column="id" jdbcType="INTEGER"/>
- <result property="tid" column="tid" jdbcType="INTEGER"/>
- <result property="cid" column="cid" jdbcType="INTEGER"/>
- <result property="orderNo" column="order_no" jdbcType="VARCHAR"/>
- <result property="main" column="main" jdbcType="INTEGER"/>
- <result property="commodityId" column="commodity_id" jdbcType="VARCHAR"/>
- <result property="commodityName" column="commodity_name" jdbcType="VARCHAR"/>
- <result property="commodityQuantity" column="commodity_quantity" jdbcType="INTEGER"/>
- <result property="commodityPrice" column="commodity_price" jdbcType="VARCHAR"/>
- <result property="taskComment" column="task_comment" jdbcType="VARCHAR"/>
- <result property="type" column="type" jdbcType="INTEGER"/>
- <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
- <result property="splitStatus" column="split_status" jdbcType="INTEGER"/>
- <result property="splitSuper" column="split_super" jdbcType="INTEGER"/>
- <result property="receiverName" column="receiver_name" jdbcType="VARCHAR"/>
- <result property="officialCost" column="official_cost" jdbcType="INTEGER"/>
- <result property="costReduction" column="cost_reduction" jdbcType="INTEGER"/>
- <result property="serviceLife" column="service_life" jdbcType="VARCHAR"/>
- <result property="serviceYear" column="service_year" jdbcType="VARCHAR"/>
- <result property="yearSum" column="year_sum" jdbcType="INTEGER"/>
- <result property="contractTerm" column="contract_term" jdbcType="VARCHAR"/>
- <result property="declarationBatch" column="declaration_batch" jdbcType="INTEGER"/>
- <result property="patentType" column="patent_type" jdbcType="INTEGER"/>
- <result property="changeSplitSuper" column="change_split_super" jdbcType="INTEGER"/>
- <result property="lastYear" column="last_year" jdbcType="VARCHAR"/>
- <result property="lastYearCapital" column="last_year_capital" jdbcType="VARCHAR"/>
- <result property="lastYearIncome" column="last_year_income" jdbcType="VARCHAR"/>
- <result property="htMember" column="ht_member" jdbcType="INTEGER"/>
- <result property="additionalDeduction" column="additional_deduction" jdbcType="INTEGER"/>
- <result property="rdAwardsubsidy" column="rd_awardsubsidy" jdbcType="INTEGER"/>
- <result property="technologyProjectType" column="technology_project_Type" jdbcType="INTEGER"/>
- <result property="ordinaryRisk" column="ordinary_risk" jdbcType="INTEGER"/>
- <result property="days" column="days" jdbcType="INTEGER"/>
- <result property="scheme" column="scheme" jdbcType="INTEGER"/>
- </resultMap>
- <sql id="TChangeTaskAllSql">
- id, tid, cid, order_no, main, commodity_id, commodity_name, commodity_quantity, commodity_price, task_comment, type, create_time, split_status, split_super, receiver_name, official_cost, cost_reduction, service_life, service_year, year_sum, contract_term, declaration_batch, patent_type, change_split_super, last_year, last_year_capital, last_year_income, ht_member, additional_deduction, rd_awardsubsidy, technology_project_Type, ordinary_risk, days, scheme
- </sql>
- <!--查询单个-->
- <select id="selectById" resultMap="TChangeTaskMap">
- select
- <include refid="TChangeTaskAllSql"/>
- from t_change_task
- where id = #{id}
- </select>
- <!--新增所有列-->
- <insert id="insert" keyProperty="id" useGeneratedKeys="true">
- insert into t_change_task(tid, cid, order_no, main, commodity_id, commodity_name, commodity_quantity,
- commodity_price, task_comment, type, create_time, split_status, split_super,
- receiver_name, official_cost, cost_reduction, service_life, service_year, year_sum,
- contract_term, declaration_batch, patent_type, change_split_super, last_year,
- last_year_capital, last_year_income, ht_member, additional_deduction, rd_awardsubsidy,
- technology_project_Type, ordinary_risk, days, scheme)
- values (#{tid}, #{cid}, #{orderNo}, #{main}, #{commodityId}, #{commodityName}, #{commodityQuantity},
- #{commodityPrice}, #{taskComment}, #{type}, #{createTime}, #{splitStatus}, #{splitSuper},
- #{receiverName}, #{officialCost}, #{costReduction}, #{serviceLife}, #{serviceYear}, #{yearSum},
- #{contractTerm}, #{declarationBatch}, #{patentType}, #{changeSplitSuper}, #{lastYear},
- #{lastYearCapital}, #{lastYearIncome}, #{htMember}, #{additionalDeduction}, #{rdAwardsubsidy},
- #{technologyProjectType}, #{ordinaryRisk}, #{days}, #{scheme})
- </insert>
- <insert id="insertBatch">
- insert into t_change_task(tid, cid, order_no, main, commodity_id, commodity_name, commodity_quantity,
- commodity_price, task_comment, type, create_time, split_status, split_super, receiver_name, official_cost,
- cost_reduction, service_life, service_year, year_sum, contract_term, declaration_batch, patent_type,
- change_split_super, last_year, last_year_capital, last_year_income, ht_member, additional_deduction,
- rd_awardsubsidy, technology_project_Type, ordinary_risk, days, scheme)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.tid}, #{entity.cid}, #{entity.orderNo}, #{entity.main}, #{entity.commodityId},
- #{entity.commodityName}, #{entity.commodityQuantity}, #{entity.commodityPrice}, #{entity.taskComment},
- #{entity.type}, #{entity.createTime}, #{entity.splitStatus}, #{entity.splitSuper}, #{entity.receiverName},
- #{entity.officialCost}, #{entity.costReduction}, #{entity.serviceLife}, #{entity.serviceYear},
- #{entity.yearSum}, #{entity.contractTerm}, #{entity.declarationBatch}, #{entity.patentType},
- #{entity.changeSplitSuper}, #{entity.lastYear}, #{entity.lastYearCapital}, #{entity.lastYearIncome},
- #{entity.htMember}, #{entity.additionalDeduction}, #{entity.rdAwardsubsidy},
- #{entity.technologyProjectType}, #{entity.ordinaryRisk}, #{entity.days}, #{entity.scheme})
- </foreach>
- </insert>
- <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
- insert into t_change_task(tid, cid, order_no, main, commodity_id, commodity_name, commodity_quantity,
- commodity_price, task_comment, type, create_time, split_status, split_super, receiver_name, official_cost,
- cost_reduction, service_life, service_year, year_sum, contract_term, declaration_batch, patent_type,
- change_split_super, last_year, last_year_capital, last_year_income, ht_member, additional_deduction,
- rd_awardsubsidy, technology_project_Type, ordinary_risk, days, scheme)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.tid}, #{entity.cid}, #{entity.orderNo}, #{entity.main}, #{entity.commodityId},
- #{entity.commodityName}, #{entity.commodityQuantity}, #{entity.commodityPrice}, #{entity.taskComment},
- #{entity.type}, #{entity.createTime}, #{entity.splitStatus}, #{entity.splitSuper}, #{entity.receiverName},
- #{entity.officialCost}, #{entity.costReduction}, #{entity.serviceLife}, #{entity.serviceYear},
- #{entity.yearSum}, #{entity.contractTerm}, #{entity.declarationBatch}, #{entity.patentType},
- #{entity.changeSplitSuper}, #{entity.lastYear}, #{entity.lastYearCapital}, #{entity.lastYearIncome},
- #{entity.htMember}, #{entity.additionalDeduction}, #{entity.rdAwardsubsidy},
- #{entity.technologyProjectType}, #{entity.ordinaryRisk}, #{entity.days}, #{entity.scheme})
- </foreach>
- on duplicate key update
- tid = values(tid),
- cid = values(cid),
- order_no = values(order_no),
- main = values(main),
- commodity_id = values(commodity_id),
- commodity_name = values(commodity_name),
- commodity_quantity = values(commodity_quantity),
- commodity_price = values(commodity_price),
- task_comment = values(task_comment),
- type = values(type),
- create_time = values(create_time),
- split_status = values(split_status),
- split_super = values(split_super),
- receiver_name = values(receiver_name),
- official_cost = values(official_cost),
- cost_reduction = values(cost_reduction),
- service_life = values(service_life),
- service_year = values(service_year),
- year_sum = values(year_sum),
- contract_term = values(contract_term),
- declaration_batch = values(declaration_batch),
- patent_type = values(patent_type),
- change_split_super = values(change_split_super),
- last_year = values(last_year),
- last_year_capital = values(last_year_capital),
- last_year_income = values(last_year_income),
- ht_member = values(ht_member),
- additional_deduction = values(additional_deduction),
- rd_awardsubsidy = values(rd_awardsubsidy),
- technology_project_Type = values(technology_project_Type),
- ordinary_risk = values(ordinary_risk),
- days = values(days),
- scheme = values(scheme)
- </insert>
- <!--通过主键修改数据-->
- <update id="update">
- update t_change_task
- <set>
- <if test="tid != null">
- tid = #{tid},
- </if>
- <if test="cid != null">
- cid = #{cid},
- </if>
- <if test="orderNo != null and orderNo != ''">
- order_no = #{orderNo},
- </if>
- <if test="main != null">
- main = #{main},
- </if>
- <if test="commodityId != null and commodityId != ''">
- commodity_id = #{commodityId},
- </if>
- <if test="commodityName != null and commodityName != ''">
- commodity_name = #{commodityName},
- </if>
- <if test="commodityQuantity != null">
- commodity_quantity = #{commodityQuantity},
- </if>
- <if test="commodityPrice != null">
- commodity_price = #{commodityPrice},
- </if>
- <if test="taskComment != null and taskComment != ''">
- task_comment = #{taskComment},
- </if>
- <if test="type != null">
- type = #{type},
- </if>
- <if test="createTime != null">
- create_time = #{createTime},
- </if>
- <if test="splitStatus != null">
- split_status = #{splitStatus},
- </if>
- <if test="splitSuper != null">
- split_super = #{splitSuper},
- </if>
- <if test="receiverName != null and receiverName != ''">
- receiver_name = #{receiverName},
- </if>
- <if test="officialCost != null">
- official_cost = #{officialCost},
- </if>
- <if test="costReduction != null">
- cost_reduction = #{costReduction},
- </if>
- <if test="serviceLife != null and serviceLife != ''">
- service_life = #{serviceLife},
- </if>
- <if test="serviceYear != null and serviceYear != ''">
- service_year = #{serviceYear},
- </if>
- <if test="yearSum != null">
- year_sum = #{yearSum},
- </if>
- <if test="contractTerm != null and contractTerm != ''">
- contract_term = #{contractTerm},
- </if>
- <if test="declarationBatch != null">
- declaration_batch = #{declarationBatch},
- </if>
- <if test="patentType != null">
- patent_type = #{patentType},
- </if>
- <if test="changeSplitSuper != null">
- change_split_super = #{changeSplitSuper},
- </if>
- <if test="lastYear != null and lastYear != ''">
- last_year = #{lastYear},
- </if>
- <if test="lastYearCapital != null">
- last_year_capital = #{lastYearCapital},
- </if>
- <if test="lastYearIncome != null">
- last_year_income = #{lastYearIncome},
- </if>
- <if test="htMember != null">
- ht_member = #{htMember},
- </if>
- <if test="additionalDeduction != null">
- additional_deduction = #{additionalDeduction},
- </if>
- <if test="rdAwardsubsidy != null">
- rd_awardsubsidy = #{rdAwardsubsidy},
- </if>
- <if test="technologyProjectType != null">
- technology_project_Type = #{technologyProjectType},
- </if>
- <if test="ordinaryRisk != null">
- ordinary_risk = #{ordinaryRisk},
- </if>
- <if test="days != null">
- days = #{days},
- </if>
- <if test="scheme != null">
- scheme = #{scheme},
- </if>
- </set>
- where id = #{id}
- </update>
- <!--查询指定行数据-->
- <select id="findTChangeTaskList" resultMap="TChangeTaskMap">
- select
- <include refid="TChangeTaskAllSql"/>
- from t_change_task
- <where>
- <if test="id != null">
- and id = #{id}
- </if>
- <if test="tid != null">
- and tid = #{tid}
- </if>
- <if test="cid != null">
- and cid = #{cid}
- </if>
- <if test="orderNo != null and orderNo != ''">
- and order_no = #{orderNo}
- </if>
- <if test="main != null">
- and main = #{main}
- </if>
- <if test="commodityId != null and commodityId != ''">
- and commodity_id = #{commodityId}
- </if>
- <if test="commodityName != null and commodityName != ''">
- and commodity_name = #{commodityName}
- </if>
- <if test="commodityQuantity != null">
- and commodity_quantity = #{commodityQuantity}
- </if>
- <if test="commodityPrice != null">
- and commodity_price = #{commodityPrice}
- </if>
- <if test="taskComment != null and taskComment != ''">
- and task_comment = #{taskComment}
- </if>
- <if test="type != null">
- and type = #{type}
- </if>
- <if test="createTime != null">
- and create_time = #{createTime}
- </if>
- <if test="splitStatus != null">
- and split_status = #{splitStatus}
- </if>
- <if test="splitSuper != null">
- and split_super = #{splitSuper}
- </if>
- <if test="receiverName != null and receiverName != ''">
- and receiver_name = #{receiverName}
- </if>
- <if test="officialCost != null">
- and official_cost = #{officialCost}
- </if>
- <if test="costReduction != null">
- and cost_reduction = #{costReduction}
- </if>
- <if test="serviceLife != null and serviceLife != ''">
- and service_life = #{serviceLife}
- </if>
- <if test="serviceYear != null and serviceYear != ''">
- and service_year = #{serviceYear}
- </if>
- <if test="yearSum != null">
- and year_sum = #{yearSum}
- </if>
- <if test="contractTerm != null and contractTerm != ''">
- and contract_term = #{contractTerm}
- </if>
- <if test="declarationBatch != null">
- and declaration_batch = #{declarationBatch}
- </if>
- <if test="patentType != null">
- and patent_type = #{patentType}
- </if>
- <if test="changeSplitSuper != null">
- and change_split_super = #{changeSplitSuper}
- </if>
- <if test="lastYear != null and lastYear != ''">
- and last_year = #{lastYear}
- </if>
- <if test="lastYearCapital != null">
- and last_year_capital = #{lastYearCapital}
- </if>
- <if test="lastYearIncome != null">
- and last_year_income = #{lastYearIncome}
- </if>
- <if test="htMember != null">
- and ht_member = #{htMember}
- </if>
- <if test="additionalDeduction != null">
- and additional_deduction = #{additionalDeduction}
- </if>
- <if test="rdAwardsubsidy != null">
- and rd_awardsubsidy = #{rdAwardsubsidy}
- </if>
- <if test="technologyProjectType != null">
- and technology_project_Type = #{technologyProjectType}
- </if>
- <if test="ordinaryRisk != null">
- and ordinary_risk = #{ordinaryRisk}
- </if>
- <if test="days != null">
- and days = #{days}
- </if>
- <if test="scheme != null">
- and scheme = #{scheme}
- </if>
- </where>
- <if test="page_sql != null">
- ${page_sql}
- </if>
- </select>
- <!--统计总行数-->
- <select id="findTChangeTaskCount" resultType="java.lang.Integer">
- select count(1)
- from t_change_task
- <where>
- <if test="id != null">
- and id = #{id}
- </if>
- <if test="tid != null">
- and tid = #{tid}
- </if>
- <if test="cid != null">
- and cid = #{cid}
- </if>
- <if test="orderNo != null and orderNo != ''">
- and order_no = #{orderNo}
- </if>
- <if test="main != null">
- and main = #{main}
- </if>
- <if test="commodityId != null and commodityId != ''">
- and commodity_id = #{commodityId}
- </if>
- <if test="commodityName != null and commodityName != ''">
- and commodity_name = #{commodityName}
- </if>
- <if test="commodityQuantity != null">
- and commodity_quantity = #{commodityQuantity}
- </if>
- <if test="commodityPrice != null">
- and commodity_price = #{commodityPrice}
- </if>
- <if test="taskComment != null and taskComment != ''">
- and task_comment = #{taskComment}
- </if>
- <if test="type != null">
- and type = #{type}
- </if>
- <if test="createTime != null">
- and create_time = #{createTime}
- </if>
- <if test="splitStatus != null">
- and split_status = #{splitStatus}
- </if>
- <if test="splitSuper != null">
- and split_super = #{splitSuper}
- </if>
- <if test="receiverName != null and receiverName != ''">
- and receiver_name = #{receiverName}
- </if>
- <if test="officialCost != null">
- and official_cost = #{officialCost}
- </if>
- <if test="costReduction != null">
- and cost_reduction = #{costReduction}
- </if>
- <if test="serviceLife != null and serviceLife != ''">
- and service_life = #{serviceLife}
- </if>
- <if test="serviceYear != null and serviceYear != ''">
- and service_year = #{serviceYear}
- </if>
- <if test="yearSum != null">
- and year_sum = #{yearSum}
- </if>
- <if test="contractTerm != null and contractTerm != ''">
- and contract_term = #{contractTerm}
- </if>
- <if test="declarationBatch != null">
- and declaration_batch = #{declarationBatch}
- </if>
- <if test="patentType != null">
- and patent_type = #{patentType}
- </if>
- <if test="changeSplitSuper != null">
- and change_split_super = #{changeSplitSuper}
- </if>
- <if test="lastYear != null and lastYear != ''">
- and last_year = #{lastYear}
- </if>
- <if test="lastYearCapital != null">
- and last_year_capital = #{lastYearCapital}
- </if>
- <if test="lastYearIncome != null">
- and last_year_income = #{lastYearIncome}
- </if>
- <if test="htMember != null">
- and ht_member = #{htMember}
- </if>
- <if test="additionalDeduction != null">
- and additional_deduction = #{additionalDeduction}
- </if>
- <if test="rdAwardsubsidy != null">
- and rd_awardsubsidy = #{rdAwardsubsidy}
- </if>
- <if test="technologyProjectType != null">
- and technology_project_Type = #{technologyProjectType}
- </if>
- <if test="ordinaryRisk != null">
- and ordinary_risk = #{ordinaryRisk}
- </if>
- <if test="days != null">
- and days = #{days}
- </if>
- <if test="scheme != null">
- and scheme = #{scheme}
- </if>
- </where>
- </select>
- <!--通过主键删除-->
- <delete id="deleteById">
- delete from t_change_task where id = #{id}
- </delete>
- <insert id="insertSelective" keyProperty="id" useGeneratedKeys="true">
- insert into t_change_task
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="tid != null">
- tid ,
- </if>
- <if test="cid != null">
- cid ,
- </if>
- <if test="orderNo != null and orderNo != ''">
- order_no ,
- </if>
- <if test="main != null">
- main ,
- </if>
- <if test="commodityId != null and commodityId != ''">
- commodity_id ,
- </if>
- <if test="commodityName != null and commodityName != ''">
- commodity_name,
- </if>
- <if test="commodityQuantity != null">
- commodity_quantity ,
- </if>
- <if test="commodityPrice != null">
- commodity_price,
- </if>
- <if test="taskComment != null and taskComment != ''">
- task_comment ,
- </if>
- <if test="type != null">
- type,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="splitStatus != null">
- split_status,
- </if>
- <if test="splitSuper != null">
- split_super ,
- </if>
- <if test="receiverName != null and receiverName != ''">
- receiver_name ,
- </if>
- <if test="officialCost != null">
- official_cost,
- </if>
- <if test="costReduction != null">
- cost_reduction ,
- </if>
- <if test="serviceLife != null and serviceLife != ''">
- service_life ,
- </if>
- <if test="serviceYear != null and serviceYear != ''">
- service_year ,
- </if>
- <if test="yearSum != null">
- year_sum ,
- </if>
- <if test="contractTerm != null and contractTerm != ''">
- contract_term,
- </if>
- <if test="declarationBatch != null">
- declaration_batch ,
- </if>
- <if test="patentType != null">
- patent_type,
- </if>
- <if test="changeSplitSuper != null">
- change_split_super ,
- </if>
- <if test="lastYear != null and lastYear != ''">
- last_year ,
- </if>
- <if test="lastYearCapital != null">
- last_year_capital ,
- </if>
- <if test="lastYearIncome != null">
- last_year_income ,
- </if>
- <if test="htMember != null">
- ht_member ,
- </if>
- <if test="additionalDeduction != null">
- additional_deduction ,
- </if>
- <if test="rdAwardsubsidy != null">
- rd_awardsubsidy ,
- </if>
- <if test="justForms != null">
- just_forms ,
- </if>
- <if test="technologyProjectType != null">
- technology_project_Type ,
- </if>
- <if test="ordinaryRisk != null">
- ordinary_risk ,
- </if>
- <if test="days != null">
- days ,
- </if>
- <if test="scheme != null">
- scheme ,
- </if>
- <if test="unilateralService != null">
- unilateral_service ,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="tid != null">
- #{tid},
- </if>
- <if test="cid != null">
- #{cid},
- </if>
- <if test="orderNo != null and orderNo != ''">
- #{orderNo},
- </if>
- <if test="main != null">
- #{main},
- </if>
- <if test="commodityId != null and commodityId != ''">
- #{commodityId},
- </if>
- <if test="commodityName != null and commodityName != ''">
- #{commodityName},
- </if>
- <if test="commodityQuantity != null">
- #{commodityQuantity},
- </if>
- <if test="commodityPrice != null">
- #{commodityPrice},
- </if>
- <if test="taskComment != null and taskComment != ''">
- #{taskComment},
- </if>
- <if test="type != null">
- #{type},
- </if>
- <if test="createTime != null">
- #{createTime},
- </if>
- <if test="splitStatus != null">
- #{splitStatus},
- </if>
- <if test="splitSuper != null">
- #{splitSuper},
- </if>
- <if test="receiverName != null and receiverName != ''">
- #{receiverName},
- </if>
- <if test="officialCost != null">
- #{officialCost},
- </if>
- <if test="costReduction != null">
- #{costReduction},
- </if>
- <if test="serviceLife != null and serviceLife != ''">
- #{serviceLife},
- </if>
- <if test="serviceYear != null and serviceYear != ''">
- #{serviceYear},
- </if>
- <if test="yearSum != null">
- #{yearSum},
- </if>
- <if test="contractTerm != null and contractTerm != ''">
- #{contractTerm},
- </if>
- <if test="declarationBatch != null">
- #{declarationBatch},
- </if>
- <if test="patentType != null">
- #{patentType},
- </if>
- <if test="changeSplitSuper != null">
- #{changeSplitSuper},
- </if>
- <if test="lastYear != null and lastYear != ''">
- #{lastYear},
- </if>
- <if test="lastYearCapital != null">
- #{lastYearCapital},
- </if>
- <if test="lastYearIncome != null">
- #{lastYearIncome},
- </if>
- <if test="htMember != null">
- #{htMember},
- </if>
- <if test="additionalDeduction != null">
- #{additionalDeduction},
- </if>
- <if test="rdAwardsubsidy != null">
- #{rdAwardsubsidy},
- </if>
- <if test="justForms != null">
- #{justForms},
- </if>
- <if test="technologyProjectType != null">
- #{technologyProjectType},
- </if>
- <if test="ordinaryRisk != null">
- #{ordinaryRisk},
- </if>
- <if test="days != null">
- #{days},
- </if>
- <if test="scheme != null">
- #{scheme},
- </if>
- <if test="unilateralService != null">
- #{unilateralService},
- </if>
- </trim>
- </insert>
- <select id="selectByCid" resultType="com.goafanti.order.bo.TChangeTaskOut">
- select a.id,a.order_no as orderNo,a.main, c.cname,c.sort cSort,a.commodity_name as commodityName,a.official_cost officialCost,
- a.official_cost officialCost, a.commodity_quantity as commodityQuantity,i.price,a.commodity_id as commodityId,a.type,a.tid,
- a.receiver_name receiverName, a.task_comment as taskComment ,a.commodity_price as commodityPrice,a.split_status splitStatus,
- a.split_super splitSuper, a.service_life serviceLife ,a.service_year serviceYear,a.year_sum yearSum,i.patent_transfer patentTransfer,
- i.type taskType, a.declaration_batch declarationBatch,a.patent_type patentType,a.contract_term contractTerm,a.cost_reduction costReduction,
- a.change_split_super changeSplitSuper,a.last_year lastYear,a.last_year_income lastYearIncome,a.last_year_capital lastYearCapital,i.project_type as projectType,
- a.ht_member htMember,a.additional_deduction additionalDeduction,a.rd_awardsubsidy rdAwardsubsidy,
- a.technology_project_Type technologyProjectType,a.ordinary_risk ordinaryRisk,a.days,a.scheme
- from t_change_task a left join business_project i on a.commodity_id=i.id
- left join business_category c on i.cid=c.id
- where 1=1
- <if test="splitStatus !=null and splitStatus !=3">
- and a.split_status= #{splitStatus}
- </if>
- <if test="splitStatus ==3">
- and a.split_status in (0,1)
- </if>
- and a.cid= #{id} order by a.id
- </select>
- <update id="updateByTid">
- update t_change_task
- <set>
- <if test="type != null">
- type= #{type},
- </if>
- <if test="member ==1">
- service_life=null,year_sum=null,
- </if>
- </set>
- where 1=1
- <if test="tid !=null">
- and tid= #{tid}
- </if>
- <if test="cid !=null">
- and cid= #{cid}
- </if>
- <if test="sid !=null">
- and split_super= #{sid}
- </if>
- </update>
- <update id="deleteByTid">
- delete from t_change_task where tid= #{tid};
- </update>
- <delete id="deleteByChangeSplitSuper">
- delete from t_change_task where change_split_super= #{tid};
- </delete>
- <update id="updateMemberByTid">
- update t_change_task
- <set>
- <if test="type != null">
- type= #{type},
- </if>
- <if test="serviceLife != null">
- service_life= #{serviceLife},
- </if>
- <if test="serviceYear != null">
- service_year= #{serviceYear},
- </if>
- <if test="yearSum != null">
- year_sum= #{yearSum},
- </if>
- <if test="contractTerm != null">
- contract_term= #{contractTerm},
- </if>
- </set>
- where 1=1
- <if test="cid !=null">
- and cid= #{cid}
- </if>
- <if test="sid !=null">
- and split_super= #{sid}
- </if>
- </update>
- <update id="updateTypeBatch">
- update t_change_task set type= #{type}
- where id in
- <foreach close=")" collection="list" item="id" open="(" separator=",">
- #{id}
- </foreach>
- </update>
- <select id="selectBySuper" resultType="com.goafanti.order.bo.TChangeTaskOut">
- select a.id,a.order_no as orderNo,a.main, c.cname,c.sort cSort,a.commodity_name as commodityName,
- a.commodity_quantity as commodityQuantity,i.price,a.commodity_id as commodityId,a.type,a.tid,a.receiver_name receiverName,
- a.task_comment as taskComment ,a.commodity_price as commodityPrice,a.split_status splitStatus,a.split_super splitSuper,
- a.service_life serviceLife ,a.service_year serviceYear,a.year_sum yearSum, a.declaration_batch declarationBatch,
- a.patent_type patentType,a.contract_term contractTerm,a.change_split_super changeSplitSuper,
- a.ht_member htMember,a.additional_deduction additionalDeduction,a.rd_awardsubsidy rdAwardsubsidy
- from t_change_task a left join business_project i on a.commodity_id=i.id
- left join business_category c on i.cid=c.id
- where a.split_status=2 and a.cid= #{cid}
- <if test="splitSuper !=null">
- and a.split_super= #{splitSuper}
- </if>
- <if test="changeSplitSuper !=null" >
- and a.change_split_super= #{changeSplitSuper}
- </if>
- order by a.id
- </select>
- <select id="selectBytid" resultType="com.goafanti.common.model.TChangeTask">
- select tct.id,tct.tid,tct.cid,tct.order_no orderNo
- from t_change_task tct left join new_order_change noc on tct.cid =noc.id
- where noc.process_state < 4 and noc.status in (0,1,2)
- and tct.tid= #{tid}
- </select>
- <update id="updateSuperServiceYear" parameterType="com.goafanti.common.model.TChangeTask">
- update t_change_task a,(select a.split_super,GROUP_CONCAT(a.service_year) counts
- from t_change_task a where a.split_status =2 and a.type in (0,1,2)
- and a.split_super=#{splitSuper} and a.cid= #{cid} group by a.split_super)x
- set a.service_year =x.counts
- where a.tid =x.split_super and a.cid= #{cid};
- </update>
- <update id="updateChangeSuperServiceYear" parameterType="com.goafanti.common.model.TChangeTask">
- update t_change_task a,(select a.change_split_super,GROUP_CONCAT(a.service_year) counts
- from t_change_task a where a.split_status =2 and a.type in (0,1,2)
- and a.change_split_super = #{changeSplitSuper} group by a.change_split_super)x
- set a.service_year =x.counts
- where a.id =x.change_split_super
- </update>
- </mapper>
|