| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243 |
- <?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.PublicReleaseMapper">
- <resultMap type="com.goafanti.common.model.PublicRelease" id="PublicReleaseMap">
- <result property="id" column="id" jdbcType="INTEGER"/>
- <result property="aid" column="aid" jdbcType="VARCHAR"/>
- <result property="releaseStart" column="release_start" jdbcType="TIMESTAMP"/>
- <result property="releaseEnd" column="release_end" jdbcType="TIMESTAMP"/>
- <result property="remarks" column="remarks" jdbcType="VARCHAR"/>
- <result property="annexUrl" column="annex_url" jdbcType="VARCHAR"/>
- <result property="status" column="status" jdbcType="INTEGER"/>
- <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
- <result property="pid" column="pid" jdbcType="VARCHAR"/>
- <result property="pname" column="pname" jdbcType="VARCHAR"/>
- <result property="duration" column="duration" jdbcType="NUMERIC"/>
- <result property="validDate" column="valid_date" jdbcType="VARCHAR"/>
- <result property="supplement" column="supplement" jdbcType="VARCHAR"/>
- <result property="auditInfo" column="audit_info" jdbcType="VARCHAR"/>
- <result property="plan" column="plan" jdbcType="VARCHAR"/>
- <result property="expectedEffect" column="expected_effect" jdbcType="VARCHAR"/>
- <result property="nextPlan" column="next_plan" jdbcType="VARCHAR"/>
- <result property="type" column="type" jdbcType="INTEGER"/>
- <result property="orderNo" column="order_no" jdbcType="VARCHAR"/>
- <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
- <result property="updateStatus" column="update_status" jdbcType="INTEGER"/>
- <result property="assist" column="assist" jdbcType="INTEGER"/>
- <result property="assistAid" column="assist_aid" jdbcType="VARCHAR"/>
- <result property="assistAidName" column="assist_aid_name" jdbcType="VARCHAR"/>
- <result property="mainId" column="main_id" jdbcType="INTEGER"/>
- <result property="mainName" column="main_name" jdbcType="VARCHAR"/>
- <result property="rejectName" column="reject_name" jdbcType="VARCHAR"/>
- <result property="assistantAid" column="assistant_aid" jdbcType="VARCHAR"/>
- <result property="assistantName" column="assistant_name" jdbcType="VARCHAR"/>
- <result property="publicAgain" column="public_again" jdbcType="INTEGER"/>
- <result property="auditTime" column="audit_time" jdbcType="TIMESTAMP"/>
- <result property="newUser" column="new_user" jdbcType="VARCHAR"/>
- <result property="signSum" column="sign_sum" jdbcType="VARCHAR"/>
- <result property="userNames" column="user_names" jdbcType="VARCHAR"/>
- <result property="objectType" column="object_type" jdbcType="INTEGER"/>
- <result property="publicType" column="public_type" jdbcType="INTEGER"/>
- <result property="districtName" column="district_name" jdbcType="VARCHAR"/>
- <result property="clockIn" column="clock_in" jdbcType="INTEGER"/>
- <result property="techStartProcess" column="tech_start_process" jdbcType="INTEGER"/>
- <result property="addressName" column="address_name" jdbcType="VARCHAR"/>
- <result property="assistProcess" column="assist_process" jdbcType="INTEGER"/>
- <result property="alone" column="alone" jdbcType="INTEGER"/>
- </resultMap>
- <sql id="PublicReleaseAllSql">
- id, aid, release_start, release_end, remarks, annex_url, status, create_time, pid, pname, duration, valid_date, supplement, audit_info, plan, expected_effect, next_plan, type, order_no, update_time, update_status, assist, assist_aid, assist_aid_name, main_id, main_name, reject_name, assistant_aid, assistant_name, public_again, audit_time, new_user, sign_sum, user_names, object_type, public_type, district_name, clock_in, tech_start_process, address_name, assist_process, alone
- </sql>
- <!--查询单个-->
- <select id="queryById" resultMap="PublicReleaseMap">
- select
- <include refid="PublicReleaseAllSql"/>
- from public_release
- where id = #{id}
- </select>
- <!--查询指定行数据-->
- <select id="findPublicReleaseList" resultMap="PublicReleaseMap">
- select
- <include refid="PublicReleaseAllSql"/>
- from public_release
- <where>
- <if test="id != null">
- and id = #{id}
- </if>
- <if test="aid != null and aid != ''">
- and aid = #{aid}
- </if>
- <if test="releaseStart != null">
- and release_start = #{releaseStart}
- </if>
- <if test="releaseEnd != null">
- and release_end = #{releaseEnd}
- </if>
- <if test="remarks != null and remarks != ''">
- and remarks = #{remarks}
- </if>
- <if test="annexUrl != null and annexUrl != ''">
- and annex_url = #{annexUrl}
- </if>
- <if test="status != null">
- and status = #{status}
- </if>
- <if test="createTime != null">
- and create_time = #{createTime}
- </if>
- <if test="pid != null and pid != ''">
- and pid = #{pid}
- </if>
- <if test="pname != null and pname != ''">
- and pname = #{pname}
- </if>
- <if test="duration != null">
- and duration = #{duration}
- </if>
- <if test="validDate != null and validDate != ''">
- and valid_date = #{validDate}
- </if>
- <if test="supplement != null and supplement != ''">
- and supplement = #{supplement}
- </if>
- <if test="auditInfo != null and auditInfo != ''">
- and audit_info = #{auditInfo}
- </if>
- <if test="plan != null and plan != ''">
- and plan = #{plan}
- </if>
- <if test="expectedEffect != null and expectedEffect != ''">
- and expected_effect = #{expectedEffect}
- </if>
- <if test="nextPlan != null and nextPlan != ''">
- and next_plan = #{nextPlan}
- </if>
- <if test="type != null">
- and type = #{type}
- </if>
- <if test="orderNo != null and orderNo != ''">
- and order_no = #{orderNo}
- </if>
- <if test="updateTime != null">
- and update_time = #{updateTime}
- </if>
- <if test="updateStatus != null">
- and update_status = #{updateStatus}
- </if>
- <if test="assist != null">
- and assist = #{assist}
- </if>
- <if test="assistAid != null and assistAid != ''">
- and assist_aid = #{assistAid}
- </if>
- <if test="assistAidName != null and assistAidName != ''">
- and assist_aid_name = #{assistAidName}
- </if>
- <if test="mainId != null">
- and main_id = #{mainId}
- </if>
- <if test="mainName != null and mainName != ''">
- and main_name = #{mainName}
- </if>
- <if test="rejectName != null and rejectName != ''">
- and reject_name = #{rejectName}
- </if>
- <if test="assistantAid != null and assistantAid != ''">
- and assistant_aid = #{assistantAid}
- </if>
- <if test="assistantName != null and assistantName != ''">
- and assistant_name = #{assistantName}
- </if>
- <if test="publicAgain != null">
- and public_again = #{publicAgain}
- </if>
- <if test="auditTime != null">
- and audit_time = #{auditTime}
- </if>
- <if test="newUser != null and newUser != ''">
- and new_user = #{newUser}
- </if>
- <if test="signSum != null and signSum != ''">
- and sign_sum = #{signSum}
- </if>
- <if test="userNames != null and userNames != ''">
- and user_names = #{userNames}
- </if>
- <if test="objectType != null">
- and object_type = #{objectType}
- </if>
- <if test="publicType != null">
- and public_type = #{publicType}
- </if>
- <if test="districtName != null and districtName != ''">
- and district_name = #{districtName}
- </if>
- <if test="clockIn != null">
- and clock_in = #{clockIn}
- </if>
- <if test="techStartProcess != null">
- and tech_start_process = #{techStartProcess}
- </if>
- <if test="addressName != null and addressName != ''">
- and address_name = #{addressName}
- </if>
- <if test="assistProcess != null">
- and assist_process = #{assistProcess}
- </if>
- <if test="alone != null">
- and alone = #{alone}
- </if>
- </where>
- <if test="page_sql != null">
- ${page_sql}
- </if>
- </select>
- <!--统计总行数-->
- <select id="findPublicReleaseCount" resultType="java.lang.Integer">
- select count(1)
- from public_release
- <where>
- <if test="id != null">
- and id = #{id}
- </if>
- <if test="aid != null and aid != ''">
- and aid = #{aid}
- </if>
- <if test="releaseStart != null">
- and release_start = #{releaseStart}
- </if>
- <if test="releaseEnd != null">
- and release_end = #{releaseEnd}
- </if>
- <if test="remarks != null and remarks != ''">
- and remarks = #{remarks}
- </if>
- <if test="annexUrl != null and annexUrl != ''">
- and annex_url = #{annexUrl}
- </if>
- <if test="status != null">
- and status = #{status}
- </if>
- <if test="createTime != null">
- and create_time = #{createTime}
- </if>
- <if test="pid != null and pid != ''">
- and pid = #{pid}
- </if>
- <if test="pname != null and pname != ''">
- and pname = #{pname}
- </if>
- <if test="duration != null">
- and duration = #{duration}
- </if>
- <if test="validDate != null and validDate != ''">
- and valid_date = #{validDate}
- </if>
- <if test="supplement != null and supplement != ''">
- and supplement = #{supplement}
- </if>
- <if test="auditInfo != null and auditInfo != ''">
- and audit_info = #{auditInfo}
- </if>
- <if test="plan != null and plan != ''">
- and plan = #{plan}
- </if>
- <if test="expectedEffect != null and expectedEffect != ''">
- and expected_effect = #{expectedEffect}
- </if>
- <if test="nextPlan != null and nextPlan != ''">
- and next_plan = #{nextPlan}
- </if>
- <if test="type != null">
- and type = #{type}
- </if>
- <if test="orderNo != null and orderNo != ''">
- and order_no = #{orderNo}
- </if>
- <if test="updateTime != null">
- and update_time = #{updateTime}
- </if>
- <if test="updateStatus != null">
- and update_status = #{updateStatus}
- </if>
- <if test="assist != null">
- and assist = #{assist}
- </if>
- <if test="assistAid != null and assistAid != ''">
- and assist_aid = #{assistAid}
- </if>
- <if test="assistAidName != null and assistAidName != ''">
- and assist_aid_name = #{assistAidName}
- </if>
- <if test="mainId != null">
- and main_id = #{mainId}
- </if>
- <if test="mainName != null and mainName != ''">
- and main_name = #{mainName}
- </if>
- <if test="rejectName != null and rejectName != ''">
- and reject_name = #{rejectName}
- </if>
- <if test="assistantAid != null and assistantAid != ''">
- and assistant_aid = #{assistantAid}
- </if>
- <if test="assistantName != null and assistantName != ''">
- and assistant_name = #{assistantName}
- </if>
- <if test="publicAgain != null">
- and public_again = #{publicAgain}
- </if>
- <if test="auditTime != null">
- and audit_time = #{auditTime}
- </if>
- <if test="newUser != null and newUser != ''">
- and new_user = #{newUser}
- </if>
- <if test="signSum != null and signSum != ''">
- and sign_sum = #{signSum}
- </if>
- <if test="userNames != null and userNames != ''">
- and user_names = #{userNames}
- </if>
- <if test="objectType != null">
- and object_type = #{objectType}
- </if>
- <if test="publicType != null">
- and public_type = #{publicType}
- </if>
- <if test="districtName != null and districtName != ''">
- and district_name = #{districtName}
- </if>
- <if test="clockIn != null">
- and clock_in = #{clockIn}
- </if>
- <if test="techStartProcess != null">
- and tech_start_process = #{techStartProcess}
- </if>
- <if test="addressName != null and addressName != ''">
- and address_name = #{addressName}
- </if>
- <if test="assistProcess != null">
- and assist_process = #{assistProcess}
- </if>
- <if test="alone != null">
- and alone = #{alone}
- </if>
- </where>
- </select>
- <!--新增所有列-->
- <insert id="insert" keyProperty="id" useGeneratedKeys="true">
- insert into public_release(aid, release_start, release_end, remarks, annex_url, status, create_time, pid, pname,
- duration, valid_date, supplement, audit_info, plan, expected_effect, next_plan, type,
- order_no, update_time, update_status, assist, assist_aid, assist_aid_name, main_id,
- main_name, reject_name, assistant_aid, assistant_name, public_again, audit_time,
- new_user, sign_sum, user_names, object_type, public_type, district_name, clock_in,
- tech_start_process, address_name, assist_process, alone)
- values (#{aid}, #{releaseStart}, #{releaseEnd}, #{remarks}, #{annexUrl}, #{status}, #{createTime}, #{pid},
- #{pname}, #{duration}, #{validDate}, #{supplement}, #{auditInfo}, #{plan}, #{expectedEffect},
- #{nextPlan}, #{type}, #{orderNo}, #{updateTime}, #{updateStatus}, #{assist}, #{assistAid},
- #{assistAidName}, #{mainId}, #{mainName}, #{rejectName}, #{assistantAid}, #{assistantName},
- #{publicAgain}, #{auditTime}, #{newUser}, #{signSum}, #{userNames}, #{objectType}, #{publicType},
- #{districtName}, #{clockIn}, #{techStartProcess}, #{addressName}, #{assistProcess}, #{alone})
- </insert>
- <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
- insert into public_release(aid, release_start, release_end, remarks, annex_url, status, create_time, pid, pname,
- duration, valid_date, supplement, audit_info, plan, expected_effect, next_plan, type, order_no, update_time,
- update_status, assist, assist_aid, assist_aid_name, main_id, main_name, reject_name, assistant_aid,
- assistant_name, public_again, audit_time, new_user, sign_sum, user_names, object_type, public_type,
- district_name, clock_in, tech_start_process, address_name, assist_process, alone)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.aid}, #{entity.releaseStart}, #{entity.releaseEnd}, #{entity.remarks}, #{entity.annexUrl},
- #{entity.status}, #{entity.createTime}, #{entity.pid}, #{entity.pname}, #{entity.duration},
- #{entity.validDate}, #{entity.supplement}, #{entity.auditInfo}, #{entity.plan}, #{entity.expectedEffect},
- #{entity.nextPlan}, #{entity.type}, #{entity.orderNo}, #{entity.updateTime}, #{entity.updateStatus},
- #{entity.assist}, #{entity.assistAid}, #{entity.assistAidName}, #{entity.mainId}, #{entity.mainName},
- #{entity.rejectName}, #{entity.assistantAid}, #{entity.assistantName}, #{entity.publicAgain},
- #{entity.auditTime}, #{entity.newUser}, #{entity.signSum}, #{entity.userNames}, #{entity.objectType},
- #{entity.publicType}, #{entity.districtName}, #{entity.clockIn}, #{entity.techStartProcess},
- #{entity.addressName}, #{entity.assistProcess}, #{entity.alone})
- </foreach>
- </insert>
- <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
- insert into public_release(aid, release_start, release_end, remarks, annex_url, status, create_time, pid, pname,
- duration, valid_date, supplement, audit_info, plan, expected_effect, next_plan, type, order_no, update_time,
- update_status, assist, assist_aid, assist_aid_name, main_id, main_name, reject_name, assistant_aid,
- assistant_name, public_again, audit_time, new_user, sign_sum, user_names, object_type, public_type,
- district_name, clock_in, tech_start_process, address_name, assist_process, alone)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.aid}, #{entity.releaseStart}, #{entity.releaseEnd}, #{entity.remarks}, #{entity.annexUrl},
- #{entity.status}, #{entity.createTime}, #{entity.pid}, #{entity.pname}, #{entity.duration},
- #{entity.validDate}, #{entity.supplement}, #{entity.auditInfo}, #{entity.plan}, #{entity.expectedEffect},
- #{entity.nextPlan}, #{entity.type}, #{entity.orderNo}, #{entity.updateTime}, #{entity.updateStatus},
- #{entity.assist}, #{entity.assistAid}, #{entity.assistAidName}, #{entity.mainId}, #{entity.mainName},
- #{entity.rejectName}, #{entity.assistantAid}, #{entity.assistantName}, #{entity.publicAgain},
- #{entity.auditTime}, #{entity.newUser}, #{entity.signSum}, #{entity.userNames}, #{entity.objectType},
- #{entity.publicType}, #{entity.districtName}, #{entity.clockIn}, #{entity.techStartProcess},
- #{entity.addressName}, #{entity.assistProcess}, #{entity.alone})
- </foreach>
- on duplicate key update
- aid = values(aid),
- release_start = values(release_start),
- release_end = values(release_end),
- remarks = values(remarks),
- annex_url = values(annex_url),
- status = values(status),
- create_time = values(create_time),
- pid = values(pid),
- pname = values(pname),
- duration = values(duration),
- valid_date = values(valid_date),
- supplement = values(supplement),
- audit_info = values(audit_info),
- plan = values(plan),
- expected_effect = values(expected_effect),
- next_plan = values(next_plan),
- type = values(type),
- order_no = values(order_no),
- update_time = values(update_time),
- update_status = values(update_status),
- assist = values(assist),
- assist_aid = values(assist_aid),
- assist_aid_name = values(assist_aid_name),
- main_id = values(main_id),
- main_name = values(main_name),
- reject_name = values(reject_name),
- assistant_aid = values(assistant_aid),
- assistant_name = values(assistant_name),
- public_again = values(public_again),
- audit_time = values(audit_time),
- new_user = values(new_user),
- sign_sum = values(sign_sum),
- user_names = values(user_names),
- object_type = values(object_type),
- public_type = values(public_type),
- district_name = values(district_name),
- clock_in = values(clock_in),
- tech_start_process = values(tech_start_process),
- address_name = values(address_name),
- assist_process = values(assist_process),
- alone = values(alone)
- </insert>
- <!--通过主键修改数据-->
- <update id="update">
- update public_release
- <set>
- <if test="aid != null and aid != ''">
- aid = #{aid},
- </if>
- <if test="releaseStart != null">
- release_start = #{releaseStart},
- </if>
- <if test="releaseEnd != null">
- release_end = #{releaseEnd},
- </if>
- <if test="remarks != null and remarks != ''">
- remarks = #{remarks},
- </if>
- <if test="annexUrl != null and annexUrl != ''">
- annex_url = #{annexUrl},
- </if>
- <if test="status != null">
- status = #{status},
- </if>
- <if test="createTime != null">
- create_time = #{createTime},
- </if>
- <if test="pid != null and pid != ''">
- pid = #{pid},
- </if>
- <if test="pname != null and pname != ''">
- pname = #{pname},
- </if>
- <if test="duration != null">
- duration = #{duration},
- </if>
- <if test="validDate != null and validDate != ''">
- valid_date = #{validDate},
- </if>
- <if test="supplement != null and supplement != ''">
- supplement = #{supplement},
- </if>
- <if test="auditInfo != null and auditInfo != ''">
- audit_info = #{auditInfo},
- </if>
- <if test="plan != null and plan != ''">
- plan = #{plan},
- </if>
- <if test="expectedEffect != null and expectedEffect != ''">
- expected_effect = #{expectedEffect},
- </if>
- <if test="nextPlan != null and nextPlan != ''">
- next_plan = #{nextPlan},
- </if>
- <if test="type != null">
- type = #{type},
- </if>
- <if test="orderNo != null and orderNo != ''">
- order_no = #{orderNo},
- </if>
- <if test="updateTime != null">
- update_time = #{updateTime},
- </if>
- <if test="updateStatus != null">
- update_status = #{updateStatus},
- </if>
- <if test="assist != null">
- assist = #{assist},
- </if>
- <if test="assistAid != null and assistAid != ''">
- assist_aid = #{assistAid},
- </if>
- <if test="assistAidName != null and assistAidName != ''">
- assist_aid_name = #{assistAidName},
- </if>
- <if test="mainId != null">
- main_id = #{mainId},
- </if>
- <if test="mainName != null and mainName != ''">
- main_name = #{mainName},
- </if>
- <if test="rejectName != null and rejectName != ''">
- reject_name = #{rejectName},
- </if>
- <if test="assistantAid != null ">
- assistant_aid = #{assistantAid},
- </if>
- <if test="assistantName != null">
- assistant_name = #{assistantName},
- </if>
- <if test="publicAgain != null">
- public_again = #{publicAgain},
- </if>
- <if test="auditTime != null">
- audit_time = #{auditTime},
- </if>
- <if test="newUser != null and newUser != ''">
- new_user = #{newUser},
- </if>
- <if test="signSum != null and signSum != ''">
- sign_sum = #{signSum},
- </if>
- <if test="userNames != null and userNames != ''">
- user_names = #{userNames},
- </if>
- <if test="objectType != null">
- object_type = #{objectType},
- </if>
- <if test="publicType != null">
- public_type = #{publicType},
- </if>
- <if test="districtName != null and districtName != ''">
- district_name = #{districtName},
- </if>
- <if test="clockIn != null">
- clock_in = #{clockIn},
- </if>
- <if test="techStartProcess != null">
- tech_start_process = #{techStartProcess},
- </if>
- <if test="addressName != null and addressName != ''">
- address_name = #{addressName},
- </if>
- <if test="assistProcess != null">
- assist_process = #{assistProcess},
- </if>
- <if test="alone != null">
- alone = #{alone},
- </if>
- </set>
- where id = #{id}
- </update>
- <!--通过主键删除-->
- <delete id="deleteById">
- delete
- from public_release
- where id = #{id}
- </delete>
- <delete id="deleteByMainId">
- delete from public_release where main_id = #{id}
- </delete>
- <!--注意增删字段需要单独处理-->
- <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicRelease" useGeneratedKeys="true">
- insert into public_release
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">id,</if>
- <if test="aid != null">aid,</if>
- <if test="releaseStart != null">release_start,</if>
- <if test="releaseEnd != null">release_end,</if>
- <if test="remarks != null">remarks,</if>
- <if test="annexUrl != null">annex_url,</if>
- <if test="status != null">status,</if>
- <if test="createTime != null">create_time,</if>
- <if test="pid != null">pid,</if>
- <if test="pname != null">pname,</if>
- <if test="duration != null">duration,</if>
- <if test="validDate != null">valid_date,</if>
- <if test="supplement != null">supplement,</if>
- <if test="auditInfo != null">audit_info,</if>
- <if test="plan != null">plan,</if>
- <if test="expectedEffect != null">expected_effect,</if>
- <if test="nextPlan != null">next_plan,</if>
- <if test="type != null">type,</if>
- <if test="orderNo != null">order_no,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="updateStatus != null">update_status,</if>
- <if test="assist != null">assist,</if>
- <if test="assistAid != null">assist_aid,</if>
- <if test="assistAidName != null">assist_aid_name,</if>
- <if test="mainId != null">main_id,</if>
- <if test="mainName != null">main_name,</if>
- <if test="rejectName != null">reject_name,</if>
- <if test="assistantAid != null">assistant_aid,</if>
- <if test="assistantName != null">assistant_name,</if>
- <if test="publicAgain != null">public_again,</if>
- <if test="auditTime != null">audit_time,</if>
- <if test="newUser != null">new_user,</if>
- <if test="signSum != null">sign_sum,</if>
- <if test="userNames != null">user_names,</if>
- <if test="objectType != null">object_type,</if>
- <if test="publicType != null">public_type,</if>
- <if test="districtName != null">district_name,</if>
- <if test="clockIn != null">clock_in,</if>
- <if test="techStartProcess != null">tech_start_process,</if>
- <if test="addressName != null">address_name,</if>
- <if test="assistProcess != null">assist_process,</if>
- <if test="alone != null">alone,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">#{id,jdbcType=INTEGER},</if>
- <if test="aid != null">#{aid,jdbcType=VARCHAR},</if>
- <if test="releaseStart != null">#{releaseStart,jdbcType=TIMESTAMP},</if>
- <if test="releaseEnd != null">#{releaseEnd,jdbcType=TIMESTAMP},</if>
- <if test="remarks != null">#{remarks,jdbcType=VARCHAR},</if>
- <if test="annexUrl != null">#{annexUrl,jdbcType=VARCHAR},</if>
- <if test="status != null">#{status,jdbcType=INTEGER},</if>
- <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
- <if test="pid != null">#{pid,jdbcType=VARCHAR},</if>
- <if test="pname != null">#{pname,jdbcType=VARCHAR},</if>
- <if test="duration != null">#{duration,jdbcType=DOUBLE},</if>
- <if test="validDate != null">#{validDate,jdbcType=VARCHAR},</if>
- <if test="supplement != null">#{supplement,jdbcType=VARCHAR},</if>
- <if test="auditInfo != null">#{auditInfo,jdbcType=VARCHAR},</if>
- <if test="plan != null">#{plan,jdbcType=VARCHAR},</if>
- <if test="expectedEffect != null">#{expectedEffect,jdbcType=VARCHAR},</if>
- <if test="nextPlan != null">#{nextPlan,jdbcType=VARCHAR},</if>
- <if test="type != null">#{type,jdbcType=INTEGER},</if>
- <if test="orderNo != null">#{orderNo,jdbcType=VARCHAR},</if>
- <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
- <if test="updateStatus != null">#{updateStatus,jdbcType=INTEGER},</if>
- <if test="assist != null">#{assist,jdbcType=INTEGER},</if>
- <if test="assistAid != null">#{assistAid,jdbcType=VARCHAR},</if>
- <if test="assistAidName != null">#{assistAidName,jdbcType=VARCHAR},</if>
- <if test="mainId != null">#{mainId,jdbcType=INTEGER},</if>
- <if test="mainName != null">#{mainName,jdbcType=VARCHAR},</if>
- <if test="rejectName != null">#{rejectName,jdbcType=VARCHAR},</if>
- <if test="assistantAid != null">#{assistantAid,jdbcType=VARCHAR},</if>
- <if test="assistantName != null">#{assistantName,jdbcType=VARCHAR},</if>
- <if test="publicAgain != null">#{publicAgain,jdbcType=INTEGER},</if>
- <if test="auditTime != null">#{auditTime,jdbcType=TIMESTAMP},</if>
- <if test="newUser != null">#{newUser,jdbcType=VARCHAR},</if>
- <if test="signSum != null">#{signSum,jdbcType=VARCHAR},</if>
- <if test="userNames != null">#{userNames,jdbcType=VARCHAR},</if>
- <if test="objectType != null">#{objectType,jdbcType=INTEGER},</if>
- <if test="publicType != null">#{publicType,jdbcType=INTEGER},</if>
- <if test="districtName != null">#{districtName,jdbcType=VARCHAR},</if>
- <if test="clockIn != null">#{clockIn,jdbcType=INTEGER},</if>
- <if test="techStartProcess != null">#{techStartProcess,jdbcType=INTEGER},</if>
- <if test="addressName != null">#{addressName,jdbcType=VARCHAR},</if>
- <if test="assistProcess != null">#{assistProcess,jdbcType=INTEGER},</if>
- <if test="alone != null">#{alone,jdbcType=INTEGER},</if>
- </trim>
- </insert>
- <update id="updateSignByAidAndUid">
- update public_release_details a left join public_release b on a.prid =b.id
- left join `user` c on a.uid=c.id
- set a.sign_sum =a.sign_sum +1
- where a.uid= #{uid} and a.main_status =1 and b.aid= #{aid}
- </update>
- <select id="listPublicRelease" resultType="com.goafanti.weChat.bo.OutPublicReleaseList">
- select a.id ,c.name aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.aid,a.public_type publicType,a.order_no orderNo,
- date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,a.status,
- date_format(a.update_time ,'%Y-%m-%d %H:%i:%S') updateTimes,a.update_status updateStatus,a.district_name districtName,
- a.assist,a.assist_aid assistAid,a.assist_aid_name assistAidName,a.type,a.main_name mainName,a.reject_name rejectName,
- a.assistant_aid assistantAid ,a.assistant_name assistantName,a.public_again publicAgain,a.user_names userNames,a.alone,
- <if test="type==7">
- opc.max_process maxProcess,
- </if>
- ea.total_amount expenseAmount ,a.clock_in clockIn,a.assist_process assistProcess,a.tech_start_process techStartProcess
- from public_release a left join admin c on a.aid =c.id
- left join expense_account ea ON a.id = ea.prid AND ea.status IN (0, 1, 2, 3)
- <if test="type==2">
- left join department d on c.department_id =d.id
- </if>
- <if test="type==4 or type==5 or userName !=null">
- left join public_release_details b on a.id=b.prid
- left join user e on b.uid=e.id left join admin ad on e.aid=ad.id
- </if>
- <if test="type==5">
- left join t_order_new ton on a.order_no =ton.order_no
- left join t_order_mid tom on a.order_no=tom.order_no
- </if>
- <if test="type==1">
- left join admin_public_reviewer apr on a.aid=apr.aid
- </if>
- <if test="type==7">
- left join t_order_public_release_count opc on a.order_no=opc.order_no
- </if>
- where 1=1
- <include refid="listPublicReleaseSql"/>
- ORDER BY (case when a.status=1 then 1 when a.status=2 then 2 when a.status=3 then 5
- when a.status=0 then 3 when a.status=4 then 4 else 0 end),a.create_time desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
- <sql id="listPublicReleaseSql">
- <if test="type==0">
- and a.public_type in (0,1,2,3)
- <if test="assist ==0">
- and a.assist in(0,1,4)
- </if>
- <if test="assist == 2">
- and a.assist in (2,4)
- </if>
- <if test="assist == 3">
- and a.assist =3
- </if>
- <if test="assist ==4">
- and a.assist in (2,3,4)
- </if>
- <if test="assistType ==1">
- and a.assist in(0,1,2)
- </if>
- <if test="aid !=null">
- and a.aid= #{aid}
- </if>
- <if test="statusType ==1">
- and a.status in (0,1,2,4)
- </if>
- </if>
- <if test="type==1">
- and a.public_type in (0,2)
- and a.assist in(0,1)
- and a.tech_start_process in (0,2)
- and a.assist_process in (0,1,2,3,4)
- and apr.reviewer_id = #{aid} and apr.type=0
- <if test="status == 1">
- and a.status = #{status} and a.assist_process in (0,1)
- </if>
- <if test="status == 2">
- and a.status = #{status} and a.assist_process in (2,3,4)
- </if>
- </if>
- <if test="type==2">
- and a.public_type in (0,2)
- and a.assist in(0,1)
- and d.manager_id = #{aid}
- </if>
- <if test="type==3">
- and a.public_type in (0,2)
- and a.assist=2
- <if test="aid !=null">
- and a.aid= #{aid}
- </if>
- and a.type = #{type}
- </if>
- <if test="type==4">
- and a.assist in(0,1)
- and e.aid = #{aid}
- <if test="status==null"> and a.public_type in (1,2) </if>
- <if test="status==1">and a.status=1 and a.public_type in (1) </if>
- <if test="status==2">and a.public_type in (2) </if>
- </if>
- <if test="type==5">
- and e.aid =#{aid}
- <if test="status==null">and a.tech_start_process in (1,2) </if>
- <if test="status==1">and a.status=1 and a.tech_start_process in (1) </if>
- <if test="status==2">and a.tech_start_process in (2) </if>
- </if>
- <if test="type==6">
- and a.type=0 and a.assist=1
- and a.id in (select pr.main_id from public_release pr left join admin_public_reviewer apr
- on pr.aid = apr.aid where pr.`type` =3 and apr.type = 1 and apr.reviewer_id = #{aid})
- </if>
- <if test="type==7">
- and opc.max_process in (1,2,3,4,5)
- <if test="maxProcessStatus ==null">
- and opc.max_process >= #{configType}
- </if>
- <if test="maxProcessStatus ==0">
- and opc.max_process= #{configType}
- </if>
- <if test="maxProcessStatus ==1">
- and opc.max_process > #{configType}
- and opc.max_process in (1,2,3,5)
- </if>
- <if test="maxProcessStatus ==2">
- and opc.max_process =4
- </if>
- </if>
- <if test="clockIn !=null">
- and a.clock_in =#{clockIn}
- </if>
- <if test="clockTime !=null">
- and a.release_start < #{clockTime} and a.release_end > #{clockTime}
- </if>
- <if test="releaseStarts != null and publicEnd != null">
- and a.release_start BETWEEN #{releaseStarts} and #{publicEnd}
- </if>
- <if test="userName !=null">
- and e.nickname like concat('%',#{userName},'%')
- </if>
- <if test="type!=4 and type !=5 and type != 1">
- <if test="status !=null ">
- and a.status = #{status}
- </if>
- </if>
- </sql>
- <select id="countPublicRelease" resultType="java.lang.Integer">
- select count(*)
- from public_release a left join admin c on a.aid =c.id
- <if test="type==2">
- left join department d on c.department_id =d.id
- </if>
- <if test="type==4 or type==5 or userName !=null">
- left join public_release_details b on a.id=b.prid
- left join user e on b.uid=e.id left join admin ad on e.aid=ad.id
- </if>
- <if test="type==1">
- left join admin_public_reviewer apr on a.aid=apr.aid
- </if>
- <if test="type==7">
- left join t_order_public_release_count opc on a.order_no=opc.order_no
- </if>
- where 1=1
- <include refid="listPublicReleaseSql"/>
- </select>
- <select id="selectDtails" resultType="com.goafanti.weChat.bo.OutPublicRelease">
- select a.id,c.name aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.update_time updateTime,a.user_names userNames,
- date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,a.status,a.assist_process assistProcess,
- a.annex_url annexUrl ,a.remarks,a.duration ,a.valid_date validDate ,a.aid ,c.superior_id suprId,a.tech_start_process techStartProcess,a.alone,
- a.plan ,a.expected_effect expectedEffect,a.next_plan nextPlan,c.reviewer,a.type,a.order_no orderNo,d.contract_no contractNo,a.address_name addressName,
- date_format(a.update_time ,'%Y-%m-%d %H:%i:%S') updateTimes,a.update_Status updateStatus,a.assist,a.assist_aid assistAid,a.assist_aid_name assistAidName,
- a.main_name mainName,a.assistant_aid assistantAid,a.assistant_name assistantName,a.public_again publicAhain,x.uids,a.public_type publicType,c2.name reviewerName
- from public_release a left join admin c on a.aid =c.id left join admin c2 on c.reviewer =c2.id
- left join (select prid ,GROUP_CONCAT(uid)uids from public_release_details where prid= #{id} group by prid)x on a.id=x.prid
- left join t_order_new d on a.order_no=d.order_no
- where 1=1
- <if test="id !=null">
- and a.id= #{id}
- </if>
- </select>
- <select id="selectDtailsByFid" resultType="com.goafanti.weChat.bo.OutPublicReleaseAndDetails">
- select a.id,c.name aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.update_time updateTime,a.user_names userNames,
- date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,a.status,
- a.annex_url annexUrl ,a.remarks,a.duration ,a.valid_date validDate ,a.aid ,c.superior_id suprId,x.uid uids,x.district_name districtName ,u.nickname,
- a.plan ,a.expected_effect expectedEffect,a.next_plan nextPlan,c.reviewer,a.type,a.order_no orderNo,d.contract_no contractNo,
- date_format(a.update_time ,'%Y-%m-%d %H:%i:%S') updateTimes,a.update_Status updateStatus,a.assist,a.assist_aid assistAid,a.assist_aid_name assistAidName,
- a.main_name mainName,a.assistant_aid assistantAid,a.assistant_name assistantName,a.public_again publicAhain
- from public_release a left join admin c on a.aid =c.id
- left join public_release_details x on a.id=x.prid
- left join user u on x.uid=u.id
- left join t_order_new d on a.order_no=d.order_no
- where 1=1
- <if test="ufid !=null">
- and x.ufid= #{ufid}
- </if>
- </select>
- <select id="listPublicStatistics" resultType="com.goafanti.weChat.bo.OutPublicStatistics">
- select y.aid,y.bh,y.dk,y.wsh,y.tg,y.duration,c.name from(select x.aid ,sum(x.bh)bh,sum(x.wsh)wsh,sum(x.tg)tg,sum(x.dk)dk,sum(x.duration)duration
- from (select a.aid, if(a.status=0,1,0)bh ,if(a.status=1,1,0)wsh,if(a.status=2,1,0)tg,b.dk ,if(a.status=2,a.duration,0)duration
- from public_release a inner join (select prid ,sum(if(clock_in=1,1,0))dk from public_release_details where 1=1
- <if test="clockStart != null and clockEnd != null">
- and clock_in_time between #{clockStart} and #{clockEnd}
- </if>
- group by prid ) b on a.id =b.prid
- left join admin c on a.aid=c.id where 1=1
- <if test="aid != null">
- and a.aid= #{aid}
- </if>
- <if test="createStart != null and createEnd !=null">
- and a.create_time between #{createStart} and #{createEnd}
- </if>
- <if test="depId != null">
- and c.department_id = #{depId}
- </if>
- )x group by x.aid)y left join admin c on c.id=y.aid
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
- <select id="countPublicStatistics" resultType="java.lang.Integer">
- select count(*) from (select aid from public_release a
- inner join (select prid ,sum(if(clock_in=1,1,0))dk from public_release_details where 1=1
- <if test="clockStart != null and clockEnd != null">
- and clock_in_time between #{clockStart} and #{clockEnd}
- </if>
- group by prid ) b on a.id =b.prid
- left join admin c on a.aid=c.id
- where 1=1
- <if test="aid != null">
- and a.aid= #{aid}
- </if>
- <if test="createStart != null and createEnd !=null">
- and a.create_time between #{createStart} and #{createEnd}
- </if>
- <if test="depId != null">
- and c.department_id = #{depId}
- </if>
- group by aid)x
- </select>
- <select id="listPublicDtails" resultType="com.goafanti.weChat.bo.OutPublicDtails">
- select a.id prdId,b.id,a.district_name districtName ,c.name aname,a.duration ,b.status ,b.annex_url annexUrl,a.photo_url photoUrl,d.nickname userName,
- date_format(a.clock_in_time ,'%Y-%m-%d %H:%i:%S') clockInTimes,a.clock_in clockIn ,b.remarks ,b.supplement ,b.`type` ,b.object_type objectType ,b.alone,
- date_format(b.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,b.audit_info auditInfo,date_format(b.audit_time ,'%Y-%m-%d %H:%i:%S') auditTimes,
- date_format(b.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,date_format(b.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,a.address_name addressName,
- b.plan ,b.next_plan nextPlan ,b.expected_effect expectedEffect,b.update_status updateStatus,b.assist_aid_name assistAidName,
- b.main_name mainName,b.assist,b.assistant_aid assistantAid, b.assistant_name assistantName,f.contract_no contractNo,
- e.name sname,f.total_amount totalAmout,d.sign_bills signBills,date_format(d.sign_time,'%Y-%m-%d')signTime
- from public_release_details a left join public_release b on a.prid =b.id
- left join admin c on b.aid =c.id left join t_order_new f on b.order_no =f.order_no
- left join `user` d on a.uid =d.id left join admin e on d.aid=e.id
- where 1=1
- <if test="publicType != null">
- and b.type= #{publicType}
- </if>
- <if test="aid != null">
- and b.aid= #{aid}
- </if>
- <if test="sid != null">
- and d.aid= #{sid}
- </if>
- <if test="deps !=null">
- and c.department_id in
- <foreach close=")" collection="deps" item="dep" open="(" separator=",">
- #{dep}
- </foreach>
- </if>
- <if test="uid != null">
- and a.uid = #{uid}
- </if>
- <if test="releaseStart != null and releaseEnd != null">
- and (b.release_start between #{releaseStart} and #{releaseEnd} or b.release_end between #{releaseStart} and #{releaseEnd})
- </if>
- <if test="createStart != null and createEnd != null">
- and b.create_time between #{createStart} and #{createEnd}
- </if>
- <if test="status != null">
- and b.status = #{status}
- </if>
- <if test="statusType == 1">
- and b.status in (1,2)
- </if>
- <if test="clockIn !=null">
- and a.clock_in= #{clockIn}
- </if>
- <if test="contractNo !=null">
- and f.contract_no like CONCAT('%',#{contractNo},'%')
- </if>
- order by b.status,b.create_time desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
- <select id="countPublicDtails" resultType="java.lang.Integer">
- select count(*)
- from public_release_details a left join public_release b on a.prid =b.id
- left join admin c on b.aid =c.id left join `user` d on a.uid =d.id
- <if test="contractNo !=null">
- left join t_order_new f on b.order_no =f.order_no
- </if>
- where 1=1
- <if test="publicType != null">
- and b.type= #{publicType}
- </if>
- <if test="aid != null">
- and b.aid= #{aid}
- </if>
- <if test="sid != null">
- and d.aid= #{sid}
- </if>
- <if test="deps !=null">
- and c.department_id in
- <foreach close=")" collection="deps" item="dep" open="(" separator=",">
- #{dep}
- </foreach>
- </if>
- <if test="uid != null">
- and a.uid = #{uid}
- </if>
- <if test="releaseStart != null and releaseEnd != null">
- and (b.release_start between #{releaseStart} and #{releaseEnd} or b.release_end between #{releaseStart} and #{releaseEnd})
- </if>
- <if test="createStart != null and createEnd != null">
- and b.create_time between #{createStart} and #{createEnd}
- </if>
- <if test="status != null">
- and b.status = #{status}
- </if>
- <if test="statusType == 1">
- and b.status in (1,2)
- </if>
- <if test="clockIn !=null">
- and a.clock_in= #{clockIn}
- </if>
- <if test="contractNo !=null">
- and f.contract_no like CONCAT('%',#{contractNo},'%')
- </if>
- </select>
- <select id="getTimeUserFollow" resultType="com.goafanti.common.model.OutPublicReleaseCount">
- select e.id province,d.id depId,a.aid,a.uid,a.new_user newUser ,1 quantity from (select a.aid,b.uid,b.new_user from public_release a
- left join public_release_details b on a.id=b.prid
- where b.main_status =1 and a.create_time between #{date} and #{now}
- group by a.aid,b.uid,b.new_user)a left join admin c on a.aid=c.id
- left join department d on c.department_id =d.id left join district_glossory e on d.province =e.id
- </select>
- <select id="publicByOrder" resultType="com.goafanti.weChat.bo.OutPublicRelease">
- select a.id,a.uid,b.aid,b.nickname ,c.name aname,a.duration ,a.district_name districtName,
- date_format(pr.release_start,'%Y-%m-%d %H:%i:%S')releaseStarts,
- date_format(pr.release_end ,'%Y-%m-%d %H:%i:%S')releaseEnds,
- date_format(a.clock_in_time ,'%Y-%m-%d %H:%i:%S')clockInTimes,
- pr.remarks
- from public_release_details a left join public_release pr on a.prid=pr.id
- left join user b on a.uid=b.id left join admin c on pr.aid =c.id
- where pr.order_no = #{orderNo}
- </select>
- <select id="selectByMainId" parameterType="java.lang.Integer" resultMap="PublicReleaseMap">
- select
- <include refid="PublicReleaseAllSql" />
- from public_release
- where main_id = #{mainId}
- <if test="type !=null">
- and type= #{type}
- </if>
- <if test="aid !=null">
- and aid= #{aid}
- </if>
- </select>
- <update id="updateStatusByMainId">
- update public_release set status= #{status}
- where main_id= #{mainId}
- <if test="type !=null">
- and type= #{type}
- </if>
- <if test="aid !=null">
- and aid= #{aid}
- </if>
- </update>
- <update id="updateAssist">
- update public_release set assist_aid=null,assist_aid_name=null
- where id= #{id}
- </update>
- <select id="selectCountByaidAndDate" resultType="java.lang.Integer">
- select ifnull(count(*),0)publicReleaseCount
- from (select aid
- from public_release a left join public_release_details b on a.id=b.prid
- where status =2 and aid= #{aid}
- <if test="startTime !=null and endTime !=null">
- and a.release_start BETWEEN #{startTime} and #{endTime}
- </if>
- )x
- group by aid
- </select>
- <select id="selectByaidAndDate" resultType="com.goafanti.admin.bo.OutFinanceCount">
- select aid,dates,sum(publicCount)publicCount
- from (select aid,if(a.`type` in (0,1,2),1,0) publicCount,DATE_FORMAT(a.release_start , '%Y-%m-%d') dates
- from public_release a left join public_release_details b on a.id=b.prid
- where a.status=2 and a.aid= #{aid}
- and a.release_start between #{startTime} and #{endTime})x
- group by x.aid,x.dates
- </select>
- <select id="selectByOrderNo" resultMap="PublicReleaseMap">
- select
- <include refid="PublicReleaseAllSql" />
- from public_release
- where status in (1,2)
- and order_no= #{orderNo}
- </select>
- <select id="selectMyNewPublic" resultMap="PublicReleaseMap">
- select
- <include refid="PublicReleaseAllSql" />
- from public_release
- where status in(1,2) and aid = #{aid}
- order by release_start desc limit 10
- </select>
- <select id="selectOutListBoById" resultType="com.goafanti.weChat.bo.OutPublicReleaseList">
- select a.id ,c.name aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.aid,a.public_type publicType,
- date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,a.status,
- date_format(a.update_time ,'%Y-%m-%d %H:%i:%S') updateTimes,a.update_status updateStatus,a.district_name districtName,
- a.assist,a.assist_aid assistAid,a.assist_aid_name assistAidName,a.type,a.main_name mainName,a.reject_name rejectName,
- a.assistant_aid assistantAid ,a.assistant_name assistantName,a.public_again publicAgain,a.user_names userNames,
- ea.total_amount expenseAmount ,a.clock_in clockIn,c2.name reviewerName,a.tech_start_process techStartProcess
- from public_release a left join admin c on a.aid =c.id
- left join admin c2 on c.reviewer=c2.id
- left join (select * from expense_account where status in (0,1,2,3)) ea on a.id =ea.prid
- where a.id= #{id}
- </select>
- <select id="selectAll" resultMap="PublicReleaseMap">
- select
- <include refid="PublicReleaseAllSql" />
- from public_release
- where status in (1,2)
- </select>
- <select id="releaseAndExpenseCount" resultType="com.goafanti.weChat.bo.releaseAndExpenseCountOut">
- select
- a.order_no orderNo,a.contract_no contractNo,b.buyer_name buyerName,b.salesman_name salesmanName,b.dep_name depName,
- toc.actual_duration actualDuration ,toc.max_type as maxType,toc.max_status as maxStatus,
- a.total_amount totalAmount,a.settlement_amount settlementAmount,b.bid_type bidType,
- c.expenseCount,c.peopleCount,c.notExamine,c.rejectCount,d.paymentAmount,c.days,c.amount expenseAmount
- from t_order_new a left join t_order_mid b on a.order_no =b.order_no
- left join t_order_public_release_count toc on a.order_no =toc.order_no
- inner join (select a.order_no,a.expenseCount,b.peopleCount,c.notExamine, c.rejectCount,a.days,a.amount
- from (select a.order_no,count(a.id)expenseCount,sum(a.amount) amount,sum(ROUND(a.duration/7.5) )days
- from expense_account a where a.target_type = 1 and a.status=2
- <if test="startTime !=null and endTime !=null">
- and a.create_time BETWEEN #{startTime} and #{endTime}
- </if>
- group by order_no )a
- left join (select order_no,count(aid)peopleCount from (select a.order_no,aid from expense_account a
- where a.target_type = 1 and a.status=2 group by order_no,aid )a group by order_no)b on a.order_no=b.order_no
- left join (select a.order_no,sum(notExamine)notExamine,sum(rejectCount)rejectCount
- from (select a.order_no,status ,IF(status=1,1,0)notExamine,IF(status=3,1,0)rejectCount
- from expense_account a where a.target_type=1
- )a group by order_no)c on a.order_no=c.order_no )c on a.order_no =c.order_no
- left join ( select a.order_no ,sum(c.payment_amount) paymentAmount
- from t_order_new a left join t_order_task b on a.order_no =b.order_no left join t_order_payment c on b.id =c.tid
- where c.status =3 group by order_no )d on a.order_no=d.order_no
- where a.delete_sign in (0,2) and a.process_status >0
- <if test="contractNo != null">
- and a.contract_no = #{contractNo}
- </if>
- <if test="buyerName != null">
- and b.buyer_name like concat('%',#{buyerName},'%')
- </if>
- <if test="depId != null">
- and a.order_dep = #{depId}
- </if>
- <if test="aid != null">
- and a.salesman_id = #{aid}
- </if>
- <if test="allStatus == 1">
- and toc.exceed_duration =0
- </if>
- <if test="allStatus == 2">
- and toc.exceed_duration >0
- </if>
- order by contract_no desc
- </select>
- <select id="selectSonIdByMain" parameterType="java.lang.Integer" resultMap="PublicReleaseMap">
- select
- b.id, b.aid, b.release_start, b.release_end, b.remarks, b.annex_url, b.status, b.create_time, b.pid, b.pname, b.duration, b.valid_date, b.supplement, b.audit_info, b.plan, b.expected_effect, b.next_plan, b.type, b.order_no, b.update_time, b.update_status, b.assist, b.assist_aid, b.assist_aid_name, b.main_id, b.main_name, b.reject_name, b.assistant_aid, b.assistant_name, b.public_again, b.audit_time, b.new_user, b.sign_sum, b.user_names, b.object_type, b.public_type, b.district_name, b.clock_in, b.tech_start_process, b.address_name
- from public_release a left join public_release b on a.main_id=b.id
- where a.id = #{id,jdbcType=INTEGER}
- </select>
- <select id="selectCountByAssistUnaudited" resultType="java.lang.Integer">
- SELECT count(*)
- from public_release a
- where a.`type`=0 and a.assist =1 and a.status =1
- and a.id in (select pr.main_id
- from public_release pr left join admin_public_reviewer apr on
- pr.aid = apr.aid
- where pr.`type` =3 and apr.type = 1
- and apr.reviewer_id = #{aid})
- </select>
- <select id="selectCountByUnaudited" resultType="java.lang.Integer">
- select COUNT(*)
- from public_release a left join admin c on a.aid =c.id
- where a.public_type in (0,2) and a.assist in(0,1) and a.tech_start_process in (0,2)
- and a.status =1 and a.assist_process in (0,1)
- and c.reviewer = #{aid}
- </select>
- <select id="selectCountByOtherUnaudited" resultType="java.lang.Integer">
- select count(*)
- from public_release a
- left join public_release_details b on a.id=b.prid
- left join `user` e on b.uid=e.id
- where a.assist in(0,1)
- and(a.public_type =1 or a.tech_start_process=1)
- and a.status =1
- and e.aid = #{aid}
- </select>
- <select id="selectByUid" resultType="com.goafanti.customer.bo.MyUserDetailsBo">
- select a.id ,a.aid,c.name aname,a.release_start as releaseStart
- from public_release a left join admin c on a.aid =c.id
- where a.status in (2) and a.type in (0,1,2)
- and a.id in (select DISTINCT prid from public_release_details where uid = #{id})
- </select>
- <select id="selectCountByUid" resultType="com.goafanti.customer.bo.MyUserDetailsBo">
- select a.id ,a.aid,c.name aname,a.release_start as releaseStart,a.duration
- from public_release a left join admin c on a.aid =c.id
- where a.status in (2)
- and a.id in (select DISTINCT prid from public_release_details where uid = #{id})
- </select>
- <select id="selectByMainIdAndReviewer" resultMap="PublicReleaseMap">
- select
- a.id, a.aid, a.release_start, a.release_end, a.remarks, a.annex_url, a.status, a.create_time, a.pid, a.pname, a.duration, a.valid_date, a.supplement, a.audit_info, a.plan, a.expected_effect, a.next_plan, a.type, a.order_no, a.update_time, a.update_status, a.assist, a.assist_aid, a.assist_aid_name, a.main_id, a.main_name
- from public_release a left join admin_public_reviewer b on a.aid =b.aid and b.type=1
- where a.main_id = #{id}
- and b.reviewer_id = #{reviewerId}
- </select>
- <select id="selectDetailsByPrid" resultType="com.goafanti.common.model.PublicReleaseDetails">
- select
- a.id, a.prid, a.uid
- from public_release_details a
- where a.prid = #{prid}
- </select>
- <select id="checkTime" resultMap="PublicReleaseMap">
- select
- <include refid="PublicReleaseAllSql"/>
- from public_release where aid=#{aid} and status in (0,1,2)
- and (alone in (0,1) or (alone=2 and assist=2))
- and ( (release_start >= #{start} and release_start <= #{end})
- or (release_start < #{start} and release_end > #{start})
- or (release_start < #{end} and release_end > #{end}))
- </select>
- <select id="checkTech" resultMap="PublicReleaseMap">
- select
- <include refid="PublicReleaseAllSql"/>
- from public_release where status =1 and `type` =0 and assist =1
- and FIND_IN_SET(#{aid},assist_aid)
- and ( (release_start >= #{start} and release_start <= #{end})
- or (release_start < #{start} and release_end > #{start})
- or (release_start < #{end} and release_end > #{end}))
- </select>
- <select id="selectByMonth" resultMap="PublicReleaseMap">
- select
- <include refid="PublicReleaseAllSql"/>
- from public_release where aid=#{aid} and status in (2) and clock_in=1
- and (release_start > #{start} and release_start < #{end})
- </select>
- </mapper>
|