|
|
@@ -9,13 +9,12 @@
|
|
|
<result property="year" column="year" jdbcType="INTEGER"/>
|
|
|
<result property="salesAmount" column="sales_amount" jdbcType="VARCHAR"/>
|
|
|
<result property="researchAmount" column="research_amount" jdbcType="VARCHAR"/>
|
|
|
- <result property="assets" column="assets" jdbcType="VARCHAR"/>
|
|
|
<result property="aid" column="aid" jdbcType="VARCHAR"/>
|
|
|
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="TaskAnnualReportAllSql">
|
|
|
- id, uid, tid, year, sales_amount, research_amount, assets, aid, create_time
|
|
|
+ id, uid, tid, year, sales_amount, research_amount, aid, create_time
|
|
|
</sql>
|
|
|
|
|
|
<!--查询单个-->
|
|
|
@@ -45,15 +44,12 @@
|
|
|
<if test="year != null">
|
|
|
and year = #{year}
|
|
|
</if>
|
|
|
- <if test="salesAmount != null and salesAmount != ''">
|
|
|
+ <if test="salesAmount != null">
|
|
|
and sales_amount = #{salesAmount}
|
|
|
</if>
|
|
|
- <if test="researchAmount != null and researchAmount != ''">
|
|
|
+ <if test="researchAmount != null">
|
|
|
and research_amount = #{researchAmount}
|
|
|
</if>
|
|
|
- <if test="assets != null and assets != ''">
|
|
|
- and assets = #{assets}
|
|
|
- </if>
|
|
|
<if test="aid != null and aid != ''">
|
|
|
and aid = #{aid}
|
|
|
</if>
|
|
|
@@ -83,15 +79,12 @@
|
|
|
<if test="year != null">
|
|
|
and year = #{year}
|
|
|
</if>
|
|
|
- <if test="salesAmount != null and salesAmount != ''">
|
|
|
+ <if test="salesAmount != null">
|
|
|
and sales_amount = #{salesAmount}
|
|
|
</if>
|
|
|
- <if test="researchAmount != null and researchAmount != ''">
|
|
|
+ <if test="researchAmount != null">
|
|
|
and research_amount = #{researchAmount}
|
|
|
</if>
|
|
|
- <if test="assets != null and assets != ''">
|
|
|
- and assets = #{assets}
|
|
|
- </if>
|
|
|
<if test="aid != null and aid != ''">
|
|
|
and aid = #{aid}
|
|
|
</if>
|
|
|
@@ -103,25 +96,25 @@
|
|
|
|
|
|
<!--新增所有列-->
|
|
|
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
|
|
- insert into task_annual_report(uid, tid, year, sales_amount, research_amount, assets, aid, create_time)
|
|
|
- values (#{uid}, #{tid}, #{year}, #{salesAmount}, #{researchAmount}, #{assets}, #{aid}, #{createTime})
|
|
|
+ insert into task_annual_report(uid, tid, year, sales_amount, research_amount, aid, create_time)
|
|
|
+ values (#{uid}, #{tid}, #{year}, #{salesAmount}, #{researchAmount}, #{aid}, #{createTime})
|
|
|
</insert>
|
|
|
|
|
|
<insert id="insertBatch">
|
|
|
- insert into task_annual_report(uid, tid, year, sales_amount, research_amount, assets, aid, create_time)
|
|
|
+ insert into task_annual_report(uid, tid, year, sales_amount, research_amount, aid, create_time)
|
|
|
values
|
|
|
<foreach collection="entities" item="entity" separator=",">
|
|
|
(#{entity.uid}, #{entity.tid}, #{entity.year}, #{entity.salesAmount}, #{entity.researchAmount},
|
|
|
- #{entity.assets}, #{entity.aid}, #{entity.createTime})
|
|
|
+ #{entity.aid}, #{entity.createTime})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
|
|
|
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
|
|
- insert into task_annual_report(uid, tid, year, sales_amount, research_amount, assets, aid, create_time)
|
|
|
+ insert into task_annual_report(uid, tid, year, sales_amount, research_amount, aid, create_time)
|
|
|
values
|
|
|
<foreach collection="entities" item="entity" separator=",">
|
|
|
(#{entity.uid}, #{entity.tid}, #{entity.year}, #{entity.salesAmount}, #{entity.researchAmount},
|
|
|
- #{entity.assets}, #{entity.aid}, #{entity.createTime})
|
|
|
+ #{entity.aid}, #{entity.createTime})
|
|
|
</foreach>
|
|
|
on duplicate key update
|
|
|
uid = values(uid),
|
|
|
@@ -129,7 +122,6 @@
|
|
|
year = values(year),
|
|
|
sales_amount = values(sales_amount),
|
|
|
research_amount = values(research_amount),
|
|
|
- assets = values(assets),
|
|
|
aid = values(aid),
|
|
|
create_time = values(create_time)
|
|
|
</insert>
|
|
|
@@ -147,15 +139,12 @@
|
|
|
<if test="year != null">
|
|
|
year = #{year},
|
|
|
</if>
|
|
|
- <if test="salesAmount != null and salesAmount != ''">
|
|
|
+ <if test="salesAmount != null">
|
|
|
sales_amount = #{salesAmount},
|
|
|
</if>
|
|
|
- <if test="researchAmount != null and researchAmount != ''">
|
|
|
+ <if test="researchAmount != null">
|
|
|
research_amount = #{researchAmount},
|
|
|
</if>
|
|
|
- <if test="assets != null and assets != ''">
|
|
|
- assets = #{assets},
|
|
|
- </if>
|
|
|
<if test="aid != null and aid != ''">
|
|
|
aid = #{aid},
|
|
|
</if>
|