CitEAMADisposalExtendsMapper.xml 7.34 KB
Newer Older
1 2 3
<?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="pwc.taxtech.atms.dao.CitEAMAssetsDisposalMapper">
4 5
  <sql id="QueryCondition">
    1 = 1
6
    <if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(citEAMAssetsDisposal.period)">
7
      AND period= #{citEAMAssetsDisposal.period,jdbcType=VARCHAR}
8
    </if>
kevin's avatar
#  
kevin committed
9
    <if test="citEAMAssetsDisposal.compensationSaleAmount!=null and citEAMAssetsDisposal.compensationSaleAmount != '' ">
10 11
      AND compensation_sale_amount &gt;= #{citEAMAssetsDisposal.compensationSaleAmount,jdbcType=INTEGER}
    </if>
kevin's avatar
#  
kevin committed
12
    <if test="citEAMAssetsDisposal.assetLabelNumber!=null and citEAMAssetsDisposal.assetLabelNumber!='' ">
13 14
      AND asset_label_number &lt;= #{citEAMAssetsDisposal.assetLabelNumber,jdbcType=INTEGER}
    </if>
kevin's avatar
#  
kevin committed
15 16 17 18 19 20 21 22 23
    <if test="citEAMAssetsDisposal.periodStart!=null and citEAMAssetsDisposal.periodStart!= '' and citEAMAssetsDisposal.periodEnd!= null and citEAMAssetsDisposal.periodEnd!= ''">
      AND period  between  ${citEAMAssetsDisposal.periodStart} and ${citEAMAssetsDisposal.periodEnd}
    </if>
    <if test="citEAMAssetsDisposal.periodStart == null and citEAMAssetsDisposal.periodStart != '' and citEAMAssetsDisposal.periodEnd != null and citEAMAssetsDisposal.periodEnd != ''">
      AND period  &lt; ${citEAMAssetsDisposal.periodEnd} or period = ${citEAMAssetsDisposal.periodEnd}
    </if>
    <if test="citEAMAssetsDisposal.periodStart != null and citEAMAssetsDisposal.periodStart != '' and citEAMAssetsDisposal.periodEnd == null and citEAMAssetsDisposal.periodEnd  != '' ">
      AND period  &gt; ${citEAMAssetsDisposal.periodStart} or period = ${citEAMAssetsDisposal.periodStart}
    </if>
24
  </sql>
kevin's avatar
#  
kevin committed
25

26
  <insert id="insertBatch" parameterType="java.util.List">
zhkwei's avatar
zhkwei committed
27
    insert into cit_eam_assets_disposal
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
    (<include refid="Base_Column_List"/>)
    values
    <foreach collection="list" item="item" index="index" separator=",">
      <trim prefix="(" suffix=")" suffixOverrides=",">
        <choose>
          <when test="item.id != null">#{item.id,jdbcType=BIGINT},</when>
          <otherwise>0,</otherwise>
        </choose>
        <choose>
          <when test="item.organizationId != null">#{item.organizationId,jdbcType=VARCHAR},</when>
          <otherwise>'',</otherwise>
        </choose>
        <choose>
          <when test="item.projectId != null">#{item.projectId,jdbcType=VARCHAR},</when>
          <otherwise>'',</otherwise>
        </choose>
zhkwei's avatar
zhkwei committed
44 45 46 47
        <choose>
          <when test="item.period != null">#{item.period,jdbcType=INTEGER},</when>
          <otherwise>0,</otherwise>
        </choose>
48 49 50 51 52
        <choose>
          <when test="item.source != null">#{item.source,jdbcType=VARCHAR},</when>
          <otherwise>'',</otherwise>
        </choose>
        <choose>
zhkwei's avatar
zhkwei committed
53
          <when test="item.occurPeriod != null">#{item.occurPeriod,jdbcType=INTEGER},</when>
54 55
          <otherwise>0,</otherwise>
        </choose>
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
        <choose>
          <when test="item.oaAssetBillType != null">#{item.oaAssetBillType,jdbcType=VARCHAR},</when>
          <otherwise>'',</otherwise>
        </choose>
        <choose>
          <when test="item.oaAssetNumber != null">#{item.oaAssetNumber,jdbcType=VARCHAR},</when>
          <otherwise>'',</otherwise>
        </choose>
        <choose>
          <when test="item.scrapReason != null">#{item.scrapReason,jdbcType=VARCHAR},</when>
          <otherwise>'',</otherwise>
        </choose>
        <choose>
          <when test="item.assetNumber != null">#{item.assetNumber,jdbcType=VARCHAR},</when>
          <otherwise>'',</otherwise>
        </choose>
72
        <choose>
zhkwei's avatar
zhkwei committed
73 74
          <when test="item.assetLabelNumber != null">#{item.assetLabelNumber,jdbcType=VARCHAR},</when>
          <otherwise>'',</otherwise>
75 76 77 78 79
        </choose>
        <choose>
          <when test="item.compensationSaleAmount != null">#{item.compensationSaleAmount,jdbcType=DECIMAL},</when>
          <otherwise>0,</otherwise>
        </choose>
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
        <choose>
          <when test="item.liableEmployeeNum != null">#{item.liableEmployeeNum,jdbcType=VARCHAR},</when>
          <otherwise>'',</otherwise>
        </choose>
        <choose>
          <when test="item.liableEmployeeName != null">#{item.liableEmployeeName,jdbcType=VARCHAR},</when>
          <otherwise>'',</otherwise>
        </choose>
        <choose>
          <when test="item.remitEmployeeNum != null">#{item.remitEmployeeNum,jdbcType=VARCHAR},</when>
          <otherwise>'',</otherwise>
        </choose>
        <choose>
          <when test="item.remitEmployeeName != null">#{item.remitEmployeeName,jdbcType=VARCHAR},</when>
          <otherwise>'',</otherwise>
        </choose>
        <choose>
          <when test="item.remitTime != null">#{item.remitTime,jdbcType=TIMESTAMP},</when>
          <otherwise>CURRENT_TIMESTAMP,</otherwise>
        </choose>
        <choose>
          <when test="item.remitAmount != null">#{item.remitAmount,jdbcType=DECIMAL},</when>
          <otherwise>0,</otherwise>
        </choose>
        <choose>
          <when test="item.gatheringCompanyName != null">#{item.gatheringCompanyName,jdbcType=VARCHAR},</when>
          <otherwise>'',</otherwise>
        </choose>
        <choose>
          <when test="item.gatheringCompanyAccount != null">#{item.gatheringCompanyAccount,jdbcType=VARCHAR},</when>
          <otherwise>'',</otherwise>
        </choose>
zhkwei's avatar
zhkwei committed
112 113 114 115
        <choose>
          <when test="item.remark != null">#{item.remark,jdbcType=VARCHAR},</when>
          <otherwise>'',</otherwise>
        </choose>
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
        <choose>
          <when test="item.createdBy != null">#{item.createdBy,jdbcType=VARCHAR},</when>
          <otherwise>'',</otherwise>
        </choose>
        <choose>
          <when test="item.updatedBy != null">#{item.updatedBy,jdbcType=VARCHAR},</when>
          <otherwise>'',</otherwise>
        </choose>
        <choose>
          <when test="item.createTime != null">#{item.createTime,jdbcType=TIMESTAMP},</when>
          <otherwise>CURRENT_TIMESTAMP,</otherwise>
        </choose>
        <choose>
          <when test="item.updateTime != null">#{item.updateTime,jdbcType=TIMESTAMP},</when>
          <otherwise>CURRENT_TIMESTAMP,</otherwise>
        </choose>
      </trim>
    </foreach>;
    SELECT 1 FROM DUAL;
  </insert>

kevin's avatar
#  
kevin committed
137 138 139
  <select id ="selectByCondition" parameterType="pwc.taxtech.atms.entity.CitEAMAssetsDisposal" resultType="pwc.taxtech.atms.entity.CitEAMAssetsDisposal">
      select
    id, organization_id as organizationId, project_id as projectId, period, source, occur_period as occurPeriod, asset_label_number as assetLabelNumber,
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
    compensation_sale_amount as compensationSaleAmount, created_by as createBy, updated_by as updateBy, create_time as createTime, update_time as updateTime,
    oa_asset_bill_type oaAssetBillType,
    oa_asset_number oaAssetNumber,
    scrap_reason scrapReason,
    asset_number assetNumber,
    asset_label_number assetLabelNumber,
    compensation_sale_amount compensationSaleAmount,
    liable_employee_num liableEmployeeNum,
    liable_employee_name liableEmployeeName,
    remit_employee_num remitEmployeeNum,
    remit_employee_name remitEmployeeName,
    remit_time remitTime,
    remit_amount remitAmount,
    gathering_company_name gatheringCompanyName,
    gathering_company_account gatheringCompanyAccount,
    remark
kevin's avatar
#  
kevin committed
156
    from cit_eam_assets_disposal
157 158 159 160
    WHERE
    <include refid="QueryCondition"/>
  </select>

161
</mapper>