| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149 |
- <?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"/>
- </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
- </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>
- </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>
- </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)
- 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})
- </insert>
- <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>
- </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>
- </trim>
- </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)
- 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})
- </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)
- 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})
- </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)
- </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 and assistantAid != ''">
- assistant_aid = #{assistantAid},
- </if>
- <if test="assistantName != null and assistantName != ''">
- 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>
- </set>
- where id = #{id}
- </update>
- <!--通过主键删除-->
- <delete id="deleteById">
- delete
- from public_release
- where id = #{id}
- </delete>
- <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,
- 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.clock_in clockIn,
- 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 or type==6">
- left join admin_public_reviewer apr on a.aid=apr.aid
- </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)
- </if>
- <if test="assist == 2">
- and a.assist =2
- </if>
- <if test="assist == 3">
- and a.assist =3
- </if>
- <if test="assist ==4">
- and a.assist in (2,3)
- </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)
- and apr.reviewer_id = #{aid} and apr.type=0
- </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}
- and a.status=1
- <if test="status==null">and a.public_type in (1,2) </if>
- <if test="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}
- and a.status=1
- <if test="status==null">and a.tech_start_process in (1,2) </if>
- <if test="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=3 and a.assist=2
- and apr.reviewer_id= #{aid} and apr.type=1
- </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">
- <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 or type==6">
- left join admin_public_reviewer apr on a.aid=apr.aid
- </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.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 ,
- 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="checkTime" resultType="java.lang.Integer">
- select id from public_release where aid=#{aid} and status in (0,1,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="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>
- <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}
- and a.release_start BETWEEN #{startTime} and #{endTime} )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 ,
- 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 left join admin_public_reviewer b on a.aid =b.aid
- and b.type =1
- where a.`type`=3 and a.assist =2 and a.status =1
- and b.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 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 ,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>
- </mapper>
|