| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378 |
- <?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 id="BaseResultMap" type="com.goafanti.common.model.TChangeTask">
- <id column="id" jdbcType="INTEGER" property="id" />
- <result column="tid" jdbcType="INTEGER" property="tid" />
- <result column="cid" jdbcType="INTEGER" property="cid" />
- <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
- <result column="main" jdbcType="INTEGER" property="main" />
- <result column="commodity_id" jdbcType="VARCHAR" property="commodityId" />
- <result column="commodity_name" jdbcType="VARCHAR" property="commodityName" />
- <result column="commodity_quantity" jdbcType="INTEGER" property="commodityQuantity" />
- <result column="commodity_price" jdbcType="DECIMAL" property="commodityPrice" />
- <result column="task_comment" jdbcType="VARCHAR" property="taskComment" />
- <result column="type" jdbcType="INTEGER" property="type" />
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
- <result column="split_status" jdbcType="INTEGER" property="splitStatus" />
- <result column="split_super" jdbcType="INTEGER" property="splitSuper" />
- <result column="receiver_name" jdbcType="VARCHAR" property="receiverName" />
- <result column="official_cost" jdbcType="INTEGER" property="officialCost" />
- <result column="cost_reduction" jdbcType="INTEGER" property="costReduction" />
- <result column="service_life" jdbcType="VARCHAR" property="serviceLife" />
- <result column="service_year" jdbcType="VARCHAR" property="serviceYear" />
- <result column="year_sum" jdbcType="INTEGER" property="yearSum" />
- <result column="contract_term" jdbcType="VARCHAR" property="contractTerm" />
- <result column="declaration_batch" jdbcType="INTEGER" property="declarationBatch" />
- <result column="patent_type" jdbcType="INTEGER" property="patentType" />
- </resultMap>
- <sql id="Base_Column_List">
- 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
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from t_change_task
- where id = #{id,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
- delete from t_change_task
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <insert id="insert" parameterType="com.goafanti.common.model.TChangeTask">
- insert into t_change_task (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)
- values (#{id,jdbcType=INTEGER}, #{tid,jdbcType=INTEGER}, #{cid,jdbcType=INTEGER},
- #{orderNo,jdbcType=VARCHAR}, #{main,jdbcType=INTEGER}, #{commodityId,jdbcType=VARCHAR},
- #{commodityName,jdbcType=VARCHAR}, #{commodityQuantity,jdbcType=INTEGER}, #{commodityPrice,jdbcType=DECIMAL},
- #{taskComment,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
- #{splitStatus,jdbcType=INTEGER}, #{splitSuper,jdbcType=INTEGER}, #{receiverName,jdbcType=VARCHAR},
- #{officialCost,jdbcType=INTEGER}, #{costReduction,jdbcType=INTEGER}, #{serviceLife,jdbcType=VARCHAR},
- #{serviceYear,jdbcType=VARCHAR}, #{yearSum,jdbcType=INTEGER}, #{contractTerm,jdbcType=VARCHAR},
- #{declarationBatch,jdbcType=INTEGER}, #{patentType,jdbcType=INTEGER})
- </insert>
- <insert id="insertSelective" parameterType="com.goafanti.common.model.TChangeTask">
- insert into t_change_task
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="tid != null">
- tid,
- </if>
- <if test="cid != null">
- cid,
- </if>
- <if test="orderNo != null">
- order_no,
- </if>
- <if test="main != null">
- main,
- </if>
- <if test="commodityId != null">
- commodity_id,
- </if>
- <if test="commodityName != null">
- commodity_name,
- </if>
- <if test="commodityQuantity != null">
- commodity_quantity,
- </if>
- <if test="commodityPrice != null">
- commodity_price,
- </if>
- <if test="taskComment != null">
- 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">
- receiver_name,
- </if>
- <if test="officialCost != null">
- official_cost,
- </if>
- <if test="costReduction != null">
- cost_reduction,
- </if>
- <if test="serviceLife != null">
- service_life,
- </if>
- <if test="serviceYear != null">
- service_year,
- </if>
- <if test="yearSum != null">
- year_sum,
- </if>
- <if test="contractTerm != null">
- contract_term,
- </if>
- <if test="declarationBatch != null">
- declaration_batch,
- </if>
- <if test="patentType != null">
- patent_type,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=INTEGER},
- </if>
- <if test="tid != null">
- #{tid,jdbcType=INTEGER},
- </if>
- <if test="cid != null">
- #{cid,jdbcType=INTEGER},
- </if>
- <if test="orderNo != null">
- #{orderNo,jdbcType=VARCHAR},
- </if>
- <if test="main != null">
- #{main,jdbcType=INTEGER},
- </if>
- <if test="commodityId != null">
- #{commodityId,jdbcType=VARCHAR},
- </if>
- <if test="commodityName != null">
- #{commodityName,jdbcType=VARCHAR},
- </if>
- <if test="commodityQuantity != null">
- #{commodityQuantity,jdbcType=INTEGER},
- </if>
- <if test="commodityPrice != null">
- #{commodityPrice,jdbcType=DECIMAL},
- </if>
- <if test="taskComment != null">
- #{taskComment,jdbcType=VARCHAR},
- </if>
- <if test="type != null">
- #{type,jdbcType=INTEGER},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="splitStatus != null">
- #{splitStatus,jdbcType=INTEGER},
- </if>
- <if test="splitSuper != null">
- #{splitSuper,jdbcType=INTEGER},
- </if>
- <if test="receiverName != null">
- #{receiverName,jdbcType=VARCHAR},
- </if>
- <if test="officialCost != null">
- #{officialCost,jdbcType=INTEGER},
- </if>
- <if test="costReduction != null">
- #{costReduction,jdbcType=INTEGER},
- </if>
- <if test="serviceLife != null">
- #{serviceLife,jdbcType=VARCHAR},
- </if>
- <if test="serviceYear != null">
- #{serviceYear,jdbcType=VARCHAR},
- </if>
- <if test="yearSum != null">
- #{yearSum,jdbcType=INTEGER},
- </if>
- <if test="contractTerm != null">
- #{contractTerm,jdbcType=VARCHAR},
- </if>
- <if test="declarationBatch != null">
- #{declarationBatch,jdbcType=INTEGER},
- </if>
- <if test="patentType != null">
- #{patentType,jdbcType=INTEGER},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TChangeTask">
- update t_change_task
- <set>
- <if test="tid != null">
- tid = #{tid,jdbcType=INTEGER},
- </if>
- <if test="cid != null">
- cid = #{cid,jdbcType=INTEGER},
- </if>
- <if test="orderNo != null">
- order_no = #{orderNo,jdbcType=VARCHAR},
- </if>
- <if test="main != null">
- main = #{main,jdbcType=INTEGER},
- </if>
- <if test="commodityId != null">
- commodity_id = #{commodityId,jdbcType=VARCHAR},
- </if>
- <if test="commodityName != null">
- commodity_name = #{commodityName,jdbcType=VARCHAR},
- </if>
- <if test="commodityQuantity != null">
- commodity_quantity = #{commodityQuantity,jdbcType=INTEGER},
- </if>
- <if test="commodityPrice != null">
- commodity_price = #{commodityPrice,jdbcType=DECIMAL},
- </if>
- <if test="taskComment != null">
- task_comment = #{taskComment,jdbcType=VARCHAR},
- </if>
- <if test="type != null">
- `type` = #{type,jdbcType=INTEGER},
- </if>
- <if test="createTime != null">
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="splitStatus != null">
- split_status = #{splitStatus,jdbcType=INTEGER},
- </if>
- <if test="splitSuper != null">
- split_super = #{splitSuper,jdbcType=INTEGER},
- </if>
- <if test="receiverName != null">
- receiver_name = #{receiverName,jdbcType=VARCHAR},
- </if>
- <if test="officialCost != null">
- official_cost = #{officialCost,jdbcType=INTEGER},
- </if>
- <if test="costReduction != null">
- cost_reduction = #{costReduction,jdbcType=INTEGER},
- </if>
- <if test="serviceLife != null">
- service_life = #{serviceLife,jdbcType=VARCHAR},
- </if>
- <if test="serviceYear != null">
- service_year = #{serviceYear,jdbcType=VARCHAR},
- </if>
- <if test="yearSum != null">
- year_sum = #{yearSum,jdbcType=INTEGER},
- </if>
- <if test="contractTerm != null">
- contract_term = #{contractTerm,jdbcType=VARCHAR},
- </if>
- <if test="declarationBatch != null">
- declaration_batch = #{declarationBatch,jdbcType=INTEGER},
- </if>
- <if test="patentType != null">
- patent_type = #{patentType,jdbcType=INTEGER},
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TChangeTask">
- update t_change_task
- set tid = #{tid,jdbcType=INTEGER},
- cid = #{cid,jdbcType=INTEGER},
- order_no = #{orderNo,jdbcType=VARCHAR},
- main = #{main,jdbcType=INTEGER},
- commodity_id = #{commodityId,jdbcType=VARCHAR},
- commodity_name = #{commodityName,jdbcType=VARCHAR},
- commodity_quantity = #{commodityQuantity,jdbcType=INTEGER},
- commodity_price = #{commodityPrice,jdbcType=DECIMAL},
- task_comment = #{taskComment,jdbcType=VARCHAR},
- `type` = #{type,jdbcType=INTEGER},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- split_status = #{splitStatus,jdbcType=INTEGER},
- split_super = #{splitSuper,jdbcType=INTEGER},
- receiver_name = #{receiverName,jdbcType=VARCHAR},
- official_cost = #{officialCost,jdbcType=INTEGER},
- cost_reduction = #{costReduction,jdbcType=INTEGER},
- service_life = #{serviceLife,jdbcType=VARCHAR},
- service_year = #{serviceYear,jdbcType=VARCHAR},
- year_sum = #{yearSum,jdbcType=INTEGER},
- contract_term = #{contractTerm,jdbcType=VARCHAR},
- declaration_batch = #{declarationBatch,jdbcType=INTEGER},
- patent_type = #{patentType,jdbcType=INTEGER}
- where id = #{id,jdbcType=INTEGER}
- </update>
- <insert id="insertSelectiveList" parameterType="java.util.List">
- insert into t_change_task ( tid, cid, split_status,
- order_no, commodity_id, commodity_name,
- commodity_quantity, commodity_price, task_comment,
- split_super , receiver_name, create_time,service_life,
- service_year, year_sum, contract_term,declaration_batch,patent_type)
- values
- <foreach collection="list" index="index" item="item" separator=",">
- ( #{item.tid,jdbcType=INTEGER}, #{item.cid,jdbcType=INTEGER}, #{item.splitStatus,jdbcType=INTEGER},
- #{item.orderNo,jdbcType=VARCHAR}, #{item.commodityId,jdbcType=VARCHAR}, #{item.commodityName,jdbcType=VARCHAR},
- #{item.commodityQuantity,jdbcType=INTEGER}, #{item.commodityPrice,jdbcType=DECIMAL}, #{item.taskComment,jdbcType=VARCHAR},
- #{item.splitSuper,jdbcType=INTEGER}, #{item.receiverName,jdbcType=VARCHAR}, now(), #{item.serviceLife,jdbcType=VARCHAR},
- #{item.serviceYear,jdbcType=VARCHAR}, #{item.yearSum,jdbcType=INTEGER},#{item.contractTerm,jdbcType=VARCHAR},
- #{declarationBatch,jdbcType=INTEGER},#{patentType,jdbcType=INTEGER})
- </foreach>
- </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,
- a.declaration_batch declarationBatch,a.patent_type patentType
- 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 !=2
- </if>
- and a.cid= #{id} order by a.id
- </select>
- <update id="updateByTid">
- update t_change_task set type= #{type}
- 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>
- <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
- 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.split_super= #{splitSuper} and a.cid= #{cid} 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>
- </mapper>
|