<select id="search" resultMap="bgtPmAnnualDO">
SELECT
<include refid="bgtPmAnnual_Some_Columns" />
FROM bgt_pm_annual bgtPmAnnual
<where>
<include refid="Ext_Search" />
<if test="bgtPmAnnual.proCodes != null and bgtPmAnnual.proCodes.size() > 0">
AND bgtPmAnnual.pro_code in
<foreach collection="bgtPmAnnual.proCodes" item="item"
open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if
test="bgtPmAnnual.processInstanceIds != null and bgtPmAnnual.processInstanceIds.size() > 0">
and bgtPmAnnual.pro_code in
(
select distinct bgtBill.pro_code from
bgt_bill as bgtBill
where bgtBill.is_deleted = '0'
AND
bgtBill.mof_div_code = #{bgtPmAnnual.mofDivCode,jdbcType=VARCHAR}
AND bgtBill.fiscal_year = #{bgtPmAnnual.fiscalYear,jdbcType=VARCHAR}
AND bgtBill.bgt_req_stage =
#{bgtPmAnnual.applyLink,jdbcType=VARCHAR}
AND
bgtBill.process_instance_id in
<foreach collection="bgtPmAnnual.processInstanceIds" item="item"
open="(" close=")" separator=",">
#{item}
</foreach>
<if
test="bgtPmAnnual.billTypeCodes != null and bgtPmAnnual.billTypeCodes.size() > 0">
and bgtBill.bill_type_code in
<foreach collection="bgtPmAnnual.billTypeCodes" item="item"
open="(" close=")" separator=",">
#{item}
</foreach>
</if>
)
</if>
<if test="ew != null">
<include refid="Common.ew" />
</if>
AND is_deleted = '0'
</where>
<if test="orderBy !=null and orderBy !='' ">
<include refid="Common.orderBy" />
</if>
</select>
<select id="specialFlowLoad" resultMap="bgtPmAnnualDO">
SELECT
<include refid="bgtPmAnnual_Some_Columns" />
FROM bgt_pm_annual bgtPmAnnual
<where>
<include refid="Ext_Search" />
<if
test="bgtPmAnnual.processInstanceIds != null and bgtPmAnnual.processInstanceIds.size() > 0">
and bgtPmAnnual.pro_code in
(
select distinct bgtBill.pro_code from
bgt_bill as bgtBill
where bgtBill.is_deleted = '0'
AND
bgtBill.mof_div_code = #{bgtPmAnnual.mofDivCode,jdbcType=VARCHAR}
AND bgtBill.fiscal_year = #{bgtPmAnnual.fiscalYear,jdbcType=VARCHAR}
AND bgtBill.bgt_req_stage =
#{bgtPmAnnual.applyLink,jdbcType=VARCHAR}
and
bgtBill.process_instance_id in
<foreach collection="bgtPmAnnual.processInstanceIds" item="item"
open="(" close=")" separator=",">
#{item}
</foreach>
<if
test="bgtPmAnnual.billTypeCodes != null and bgtPmAnnual.billTypeCodes.size() > 0">
and bgtBill.bill_type_code in
<foreach collection="bgtPmAnnual.billTypeCodes" item="item"
open="(" close=")" separator=",">
#{item}
</foreach>
</if>
)
</if>
<if test="ew != null">
<include refid="Common.ew" />
</if>
AND is_deleted = '0'
</where>
<if test="orderBy !=null and orderBy !='' ">
<include refid="Common.orderBy" />
</if>
</select>
<select id="endAuditFlowLoad" resultMap="bgtPmAnnualDO">
SELECT
<include refid="bgtPmAnnual_Some_Columns" />
FROM bgt_pm_annual bgtPmAnnual
<where>
<include refid="Ext_Search" />
And exists(
select bgtBill.id from
bgt_bill as bgtBill
where
bgtBill.is_deleted = '0'
AND bgtBill.mof_div_code =
bgtPmAnnual.mof_div_code
AND bgtBill.fiscal_year =
bgtPmAnnual.fiscal_year
AND bgtBill.bgt_req_stage =
bgtPmAnnual.apply_link
AND bgtBill.pro_code = bgtPmAnnual.pro_code
AND
bgtBill.is_end = '1'
<if
test="bgtPmAnnual.billTypeCodes != null and bgtPmAnnual.billTypeCodes.size() > 0">
and bgtBill.bill_type_code in
<foreach collection="bgtPmAnnual.billTypeCodes" item="item"
open="(" close=")" separator=",">
#{item}
</foreach>
</if>
)
<if test="ew != null">
<include refid="Common.ew" />
</if>
AND is_deleted = '0'
</where>
<if test="orderBy !=null and orderBy !='' ">
<include refid="Common.orderBy" />
</if>
</select>
<select id="queryDataMapByBids" resultMap="bgtPmAnnualDO">
SELECT
<include refid="bgtPmAnnual_Some_Columns" />
FROM bgt_pm_annual bgtPmAnnual
<where>
bgtPmAnnual.is_deleted = '0'
and bgtPmAnnual.bgt_pman_id in
<foreach collection="list" item="item" open="(" close=")"
separator=",">
#{item}
</foreach>
</where>
</select>
<select id="selectByCodes" resultMap="bgtPmAnnualDO">
SELECT
<include refid="bgtPmAnnual_Some_Columns" />
FROM bgt_pm_annual bgtPmAnnual
<where>
bgtPmAnnual.is_deleted = '0'
and bgtPmAnnual.apply_link='1'
and bgtPmAnnual.pro_code in
<foreach collection="list" item="item" open="(" close=")"
separator=",">
#{item}
</foreach>
</where>
</select>
<update id="deleteByDominateDetailIds">
update bgt_pm_annual set is_deleted='1',update_time=CURRENT_TIMESTAMP
where bgt_dominate_detail_id in
<foreach collection="list" item="item" open="(" close=")"
separator=",">
#{item}
</foreach>
</update>
<select id="selectByProCodes" resultMap="bgtPmAnnualDO">
SELECT
<include refid="bgtPmAnnual_Some_Columns"/>
FROM bgt_pm_annual bgtPmAnnual
<where>
<if test="bgtPmAnnual.id !=null " >
AND id = #{bgtPmAnnual.id,jdbcType=BIGINT,javaType=java.lang.Long}
</if>
<if test="bgtPmAnnual.createBy !=null and bgtPmAnnual.createBy!='' " >
AND create_by = #{bgtPmAnnual.createBy,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.createById !=null and bgtPmAnnual.createById!='' " >
AND create_by_id = #{bgtPmAnnual.createById,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.createTime !=null " >
AND create_time = #{bgtPmAnnual.createTime,jdbcType=TIMESTAMP,javaType=java.util.Date}
</if>
<if test="bgtPmAnnual.updateBy !=null and bgtPmAnnual.updateBy!='' " >
AND update_by = #{bgtPmAnnual.updateBy,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.updateById !=null and bgtPmAnnual.updateById!='' " >
AND update_by_id = #{bgtPmAnnual.updateById,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.updateTime !=null " >
AND update_time = #{bgtPmAnnual.updateTime,jdbcType=TIMESTAMP,javaType=java.util.Date}
</if>
<if test="bgtPmAnnual.isDeleted !=null and bgtPmAnnual.isDeleted!='' " >
AND is_deleted = #{bgtPmAnnual.isDeleted,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.ver !=null " >
AND ver = #{bgtPmAnnual.ver,jdbcType=INTEGER,javaType=java.lang.Integer}
</if>
<if test="bgtPmAnnual.mofDivCode !=null and bgtPmAnnual.mofDivCode!='' " >
AND mof_div_code = #{bgtPmAnnual.mofDivCode,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.fiscalYear !=null and bgtPmAnnual.fiscalYear!='' " >
AND fiscal_year = #{bgtPmAnnual.fiscalYear,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.eleVersion !=null and bgtPmAnnual.eleVersion!='' " >
AND ele_version = #{bgtPmAnnual.eleVersion,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.version !=null and bgtPmAnnual.version!='' " >
AND version = #{bgtPmAnnual.version,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.versionName !=null and bgtPmAnnual.versionName!='' " >
AND version_name = #{bgtPmAnnual.versionName,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.mgtDeptCode !=null and bgtPmAnnual.mgtDeptCode!='' " >
AND mgt_dept_code = #{bgtPmAnnual.mgtDeptCode,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.mgtMofDepCode !=null and bgtPmAnnual.mgtMofDepCode!='' " >
AND mgt_mof_dep_code = #{bgtPmAnnual.mgtMofDepCode,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.mofDepCode !=null and bgtPmAnnual.mofDepCode!='' " >
AND mof_dep_code = #{bgtPmAnnual.mofDepCode,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.deptCode !=null and bgtPmAnnual.deptCode!='' " >
AND dept_code = #{bgtPmAnnual.deptCode,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.agencyCode !=null and bgtPmAnnual.agencyCode!='' " >
AND agency_code = #{bgtPmAnnual.agencyCode,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.bgtPmanId !=null and bgtPmAnnual.bgtPmanId!='' " >
AND bgt_pman_id = #{bgtPmAnnual.bgtPmanId,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.proKindCode !=null and bgtPmAnnual.proKindCode!='' " >
AND pro_kind_code = #{bgtPmAnnual.proKindCode,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.proId !=null and bgtPmAnnual.proId!='' " >
AND pro_id = #{bgtPmAnnual.proId,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.proName !=null and bgtPmAnnual.proName!='' " >
AND pro_name = #{bgtPmAnnual.proName,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.proLevel !=null and bgtPmAnnual.proLevel!='' " >
AND pro_level = #{bgtPmAnnual.proLevel,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.expFuncCode !=null and bgtPmAnnual.expFuncCode!='' " >
AND exp_func_code = #{bgtPmAnnual.expFuncCode,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.govBgtEcoCode !=null and bgtPmAnnual.govBgtEcoCode!='' " >
AND gov_bgt_eco_code = #{bgtPmAnnual.govBgtEcoCode,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.depBgtEcoCode !=null and bgtPmAnnual.depBgtEcoCode!='' " >
AND dep_bgt_eco_code = #{bgtPmAnnual.depBgtEcoCode,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.fundTypeCode !=null and bgtPmAnnual.fundTypeCode!='' " >
AND fund_type_code = #{bgtPmAnnual.fundTypeCode,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.applyUp !=null " >
AND apply_up = #{bgtPmAnnual.applyUp,jdbcType=DECIMAL,javaType=java.math.BigDecimal}
</if>
<if test="bgtPmAnnual.finAuditMoney !=null " >
AND fin_audit_money = #{bgtPmAnnual.finAuditMoney,jdbcType=DECIMAL,javaType=java.math.BigDecimal}
</if>
<if test="bgtPmAnnual.manageMofDepCode !=null and bgtPmAnnual.manageMofDepCode!='' " >
AND manage_mof_dep_code = #{bgtPmAnnual.manageMofDepCode,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.applyLink !=null and bgtPmAnnual.applyLink!='' " >
AND apply_link = #{bgtPmAnnual.applyLink,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.replyAmt !=null " >
AND reply_amt = #{bgtPmAnnual.replyAmt,jdbcType=DECIMAL,javaType=java.math.BigDecimal}
</if>
<if test="bgtPmAnnual.adjAmt !=null " >
AND adj_amt = #{bgtPmAnnual.adjAmt,jdbcType=DECIMAL,javaType=java.math.BigDecimal}
</if>
<if test="bgtPmAnnual.disAmt !=null " >
AND dis_amt = #{bgtPmAnnual.disAmt,jdbcType=DECIMAL,javaType=java.math.BigDecimal}
</if>
<if test="bgtPmAnnual.curAmt !=null " >
AND cur_amt = #{bgtPmAnnual.curAmt,jdbcType=DECIMAL,javaType=java.math.BigDecimal}
</if>
<if test="bgtPmAnnual.budgetLevelCode !=null and bgtPmAnnual.budgetLevelCode!='' " >
AND budget_level_code = #{bgtPmAnnual.budgetLevelCode,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.foundTypeCode !=null and bgtPmAnnual.foundTypeCode!='' " >
AND found_type_code = #{bgtPmAnnual.foundTypeCode,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.addAmt !=null " >
AND add_amt = #{bgtPmAnnual.addAmt,jdbcType=DECIMAL,javaType=java.math.BigDecimal}
</if>
<if test="bgtPmAnnual.backAmt !=null " >
AND back_amt = #{bgtPmAnnual.backAmt,jdbcType=DECIMAL,javaType=java.math.BigDecimal}
</if>
<if test="bgtPmAnnual.disPlanId !=null and bgtPmAnnual.disPlanId!='' " >
AND dis_plan_id = #{bgtPmAnnual.disPlanId,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.isGovpur !=null " >
AND is_govpur = #{bgtPmAnnual.isGovpur,jdbcType=SMALLINT,javaType=java.lang.Short}
</if>
<if test="bgtPmAnnual.isGovserv !=null " >
AND is_govserv = #{bgtPmAnnual.isGovserv,jdbcType=SMALLINT,javaType=java.lang.Short}
</if>
<if test="bgtPmAnnual.isAsset !=null " >
AND is_asset = #{bgtPmAnnual.isAsset,jdbcType=SMALLINT,javaType=java.lang.Short}
</if>
<if test="bgtPmAnnual.isProAgricultureFund !=null " >
AND is_pro_agriculture_fund = #{bgtPmAnnual.isProAgricultureFund,jdbcType=SMALLINT,javaType=java.lang.Short}
</if>
<if test="bgtPmAnnual.proPayDicCode !=null and bgtPmAnnual.proPayDicCode!='' " >
AND pro_pay_dic_code = #{bgtPmAnnual.proPayDicCode,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.parentCode !=null and bgtPmAnnual.parentCode!='' " >
AND parent_code = #{bgtPmAnnual.parentCode,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.parentName !=null and bgtPmAnnual.parentName!='' " >
AND parent_name = #{bgtPmAnnual.parentName,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.bgtOrderId !=null and bgtPmAnnual.bgtOrderId!='' " >
AND bgt_order_id = #{bgtPmAnnual.bgtOrderId,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.payTypeCode !=null and bgtPmAnnual.payTypeCode!='' " >
AND pay_type_code = #{bgtPmAnnual.payTypeCode,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.payBizTypeCode !=null and bgtPmAnnual.payBizTypeCode!='' " >
AND pay_biz_type_code = #{bgtPmAnnual.payBizTypeCode,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.rcid !=null and bgtPmAnnual.rcid!='' " >
AND rcid = #{bgtPmAnnual.rcid,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.processInstanceId !=null and bgtPmAnnual.processInstanceId!='' " >
AND process_instance_id = #{bgtPmAnnual.processInstanceId,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.isThrSec !=null " >
AND is_thr_sec = #{bgtPmAnnual.isThrSec,jdbcType=SMALLINT,javaType=java.lang.Short}
</if>
<if test="bgtPmAnnual.isAdvand !=null " >
AND is_advand = #{bgtPmAnnual.isAdvand,jdbcType=SMALLINT,javaType=java.lang.Short}
</if>
<if test="bgtPmAnnual.isEnd !=null " >
AND is_end = #{bgtPmAnnual.isEnd,jdbcType=SMALLINT,javaType=java.lang.Short}
</if>
<if test="bgtPmAnnual.subMofDivCode !=null and bgtPmAnnual.subMofDivCode!='' " >
AND sub_mof_div_code = #{bgtPmAnnual.subMofDivCode,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.advandAmt !=null " >
AND advand_amt = #{bgtPmAnnual.advandAmt,jdbcType=DECIMAL,javaType=java.math.BigDecimal}
</if>
<if test="bgtPmAnnual.supBgtDocNo !=null and bgtPmAnnual.supBgtDocNo!='' " >
AND sup_bgt_doc_no = #{bgtPmAnnual.supBgtDocNo,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.isPovery !=null " >
AND is_povery = #{bgtPmAnnual.isPovery,jdbcType=SMALLINT,javaType=java.lang.Short}
</if>
<if test="bgtPmAnnual.isDepbgt !=null " >
AND is_depbgt = #{bgtPmAnnual.isDepbgt,jdbcType=SMALLINT,javaType=java.lang.Short}
</if>
<if test="bgtPmAnnual.isApproval !=null " >
AND is_approval = #{bgtPmAnnual.isApproval,jdbcType=SMALLINT,javaType=java.lang.Short}
</if>
<if test="bgtPmAnnual.isIssuebgt !=null " >
AND is_issuebgt = #{bgtPmAnnual.isIssuebgt,jdbcType=SMALLINT,javaType=java.lang.Short}
</if>
<if test="bgtPmAnnual.bizTypeCode !=null and bgtPmAnnual.bizTypeCode!='' " >
AND biz_type_code = #{bgtPmAnnual.bizTypeCode,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.tpFuncCode !=null and bgtPmAnnual.tpFuncCode!='' " >
AND tp_func_code = #{bgtPmAnnual.tpFuncCode,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.bgtAmt !=null " >
AND bgt_amt = #{bgtPmAnnual.bgtAmt,jdbcType=DECIMAL,javaType=java.math.BigDecimal}
</if>
<if test="bgtPmAnnual.enableIssueAmt !=null " >
AND enable_issue_amt = #{bgtPmAnnual.enableIssueAmt,jdbcType=DECIMAL,javaType=java.math.BigDecimal}
</if>
<if test="bgtPmAnnual.rescriptumAmt !=null " >
AND rescriptum_amt = #{bgtPmAnnual.rescriptumAmt,jdbcType=DECIMAL,javaType=java.math.BigDecimal}
</if>
<if test="bgtPmAnnual.isObtain !=null " >
AND is_obtain = #{bgtPmAnnual.isObtain,jdbcType=SMALLINT,javaType=java.lang.Short}
</if>
<if test="bgtPmAnnual.publishStatus !=null " >
AND publish_status = #{bgtPmAnnual.publishStatus,jdbcType=SMALLINT,javaType=java.lang.Short}
</if>
<if test="bgtPmAnnual.effectiveAmt !=null " >
AND effective_amt = #{bgtPmAnnual.effectiveAmt,jdbcType=DECIMAL,javaType=java.math.BigDecimal}
</if>
<if test="bgtPmAnnual.bgtParentId !=null and bgtPmAnnual.bgtParentId!='' " >
AND bgt_parent_id = #{bgtPmAnnual.bgtParentId,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.bgtDominateDetailId !=null and bgtPmAnnual.bgtDominateDetailId!='' " >
AND bgt_dominate_detail_id = #{bgtPmAnnual.bgtDominateDetailId,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.isEmphasisProject !=null " >
AND is_emphasis_project = #{bgtPmAnnual.isEmphasisProject,jdbcType=SMALLINT,javaType=java.lang.Short}
</if>
<if test="bgtPmAnnual.proCodeLevelOne !=null and bgtPmAnnual.proCodeLevelOne!='' " >
AND pro_code_level_one = #{bgtPmAnnual.proCodeLevelOne,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.proCodeLevelTwo !=null and bgtPmAnnual.proCodeLevelTwo!='' " >
AND pro_code_level_two = #{bgtPmAnnual.proCodeLevelTwo,jdbcType=VARCHAR}
</if>
<if test="bgtPmAnnual.proCode !=null and bgtPmAnnual.proCode!='' " >
AND pro_code = #{bgtPmAnnual.proCode,jdbcType=VARCHAR}
</if>
<if test="list != null and list.size() > 0">
and pro_code in
<foreach collection="list" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
and is_deleted = '0'
</where>
</select>
<select id="queryCountByCondition" resultType="java.lang.Integer">
select count(id)
FROM bgt_bill
where is_deleted='0' and fiscal_year=#{param.fiscalYear} and
mof_div_code=#{param.mofDivCode}
and bill_type_code=#{param.billTypeCode}
<if test="param.mofDepCode != null and param.mofDepCode != ''">
and mof_dep_code = #{param.mofDepCode}
</if>
<if test="param.mgtMofDepCode != null and param.mgtMofDepCode != ''">
and mgt_mof_dep_code = #{param.mgtMofDepCode}
</if>
<if test="param.deptCode != null and param.deptCode != ''">
and dept_code = #{param.deptCode}
</if>
<if test="param.mgtDeptCode != null and param.mgtDeptCode != ''">
and mgt_dept_code = #{param.mgtDeptCode}
</if>
<if test="param.agencyCode != null and param.agencyCode != ''">
and agency_code = #{param.agencyCode}
</if>
<if test="param.proCode != null and param.proCode != ''">
and pro_code = #{param.proCode}
</if>
<if test="param.bgtReqStage != null and param.bgtReqStage != ''">
and bgt_req_stage = #{param.bgtReqStage}
</if>
<if test="param.bgtReportCode != null and param.bgtReportCode != ''">
and bgt_report_code = #{param.bgtReportCode}
</if>
<if
test="param.processInstanceIds != null and param.processInstanceIds.size() > 0">
and process_instance_id in
<foreach collection="param.processInstanceIds" item="item"
open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</select>