| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654 |
- <?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 id="BaseResultMap" type="com.goafanti.common.model.PublicRelease">
- <id column="id" jdbcType="INTEGER" property="id" />
- <result column="uid" jdbcType="VARCHAR" property="uid" />
- <result column="aid" jdbcType="VARCHAR" property="aid" />
- <result column="release_start" jdbcType="TIMESTAMP" property="releaseStart" />
- <result column="release_end" jdbcType="TIMESTAMP" property="releaseEnd" />
- <result column="remarks" jdbcType="VARCHAR" property="remarks" />
- <result column="annex_url" jdbcType="VARCHAR" property="annexUrl" />
- <result column="user_name" jdbcType="VARCHAR" property="userName" />
- <result column="longitude" jdbcType="VARCHAR" property="longitude" />
- <result column="latitude" jdbcType="VARCHAR" property="latitude" />
- <result column="status" jdbcType="INTEGER" property="status" />
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
- <result column="clock_in" jdbcType="INTEGER" property="clockIn" />
- <result column="clock_in_time" jdbcType="TIMESTAMP" property="clockInTime" />
- <result column="photo_url" jdbcType="VARCHAR" property="photoUrl" />
- <result column="pid" jdbcType="VARCHAR" property="pid" />
- <result column="pname" jdbcType="VARCHAR" property="pname" />
- <result column="ufid" jdbcType="VARCHAR" property="ufid" />
- <result column="duration" jdbcType="DOUBLE" property="duration" />
- <result column="valid_date" jdbcType="VARCHAR" property="validDate" />
- <result column="new_user" jdbcType="INTEGER" property="newUser" />
- <result column="sign_sum" jdbcType="INTEGER" property="signSum" />
- <result column="main_status" jdbcType="INTEGER" property="mainStatus" />
- <result column="supplement" jdbcType="VARCHAR" property="supplement" />
- <result column="audit_info" jdbcType="VARCHAR" property="auditInfo" />
- <result column="plan" jdbcType="VARCHAR" property="plan" />
- <result column="expected_effect" jdbcType="VARCHAR" property="expectedEffect" />
- <result column="next_plan" jdbcType="VARCHAR" property="nextPlan" />
- <result column="type" jdbcType="INTEGER" property="type" />
- <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
- <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
- <result column="update_status" jdbcType="INTEGER" property="updateStatus" />
- </resultMap>
- <sql id="Base_Column_List">
- id, `uid`, aid, release_start, release_end, remarks, annex_url, user_name, longitude,
- latitude, `status`, create_time, clock_in, clock_in_time, photo_url, pid, pname,
- ufid, duration, valid_date, new_user, sign_sum, main_status, supplement, audit_info,
- `plan`, expected_effect, next_plan, `type`, order_no, update_time, update_status
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from public_release
- where id = #{id,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
- delete from public_release
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <insert id="insert" parameterType="com.goafanti.common.model.PublicRelease">
- insert into public_release (id, `uid`, aid,
- release_start, release_end, remarks,
- annex_url, user_name, longitude,
- latitude, `status`, create_time,
- clock_in, clock_in_time, photo_url,
- pid, pname, ufid, duration,
- valid_date, new_user, sign_sum,
- main_status, supplement, audit_info,
- `plan`, expected_effect, next_plan,
- `type`, order_no, update_time,
- update_status)
- values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR},
- #{releaseStart,jdbcType=TIMESTAMP}, #{releaseEnd,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR},
- #{annexUrl,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, #{longitude,jdbcType=VARCHAR},
- #{latitude,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
- #{clockIn,jdbcType=INTEGER}, #{clockInTime,jdbcType=TIMESTAMP}, #{photoUrl,jdbcType=VARCHAR},
- #{pid,jdbcType=VARCHAR}, #{pname,jdbcType=VARCHAR}, #{ufid,jdbcType=VARCHAR}, #{duration,jdbcType=DOUBLE},
- #{validDate,jdbcType=VARCHAR}, #{newUser,jdbcType=INTEGER}, #{signSum,jdbcType=INTEGER},
- #{mainStatus,jdbcType=INTEGER}, #{supplement,jdbcType=VARCHAR}, #{auditInfo,jdbcType=VARCHAR},
- #{plan,jdbcType=VARCHAR}, #{expectedEffect,jdbcType=VARCHAR}, #{nextPlan,jdbcType=VARCHAR},
- #{type,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
- #{updateStatus,jdbcType=INTEGER})
- </insert>
- <insert id="insertSelective" parameterType="com.goafanti.common.model.PublicRelease">
- insert into public_release
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="uid != null">
- `uid`,
- </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="userName != null">
- user_name,
- </if>
- <if test="longitude != null">
- longitude,
- </if>
- <if test="latitude != null">
- latitude,
- </if>
- <if test="status != null">
- `status`,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="clockIn != null">
- clock_in,
- </if>
- <if test="clockInTime != null">
- clock_in_time,
- </if>
- <if test="photoUrl != null">
- photo_url,
- </if>
- <if test="pid != null">
- pid,
- </if>
- <if test="pname != null">
- pname,
- </if>
- <if test="ufid != null">
- ufid,
- </if>
- <if test="duration != null">
- duration,
- </if>
- <if test="validDate != null">
- valid_date,
- </if>
- <if test="newUser != null">
- new_user,
- </if>
- <if test="signSum != null">
- sign_sum,
- </if>
- <if test="mainStatus != null">
- main_status,
- </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>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=INTEGER},
- </if>
- <if test="uid != null">
- #{uid,jdbcType=VARCHAR},
- </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="userName != null">
- #{userName,jdbcType=VARCHAR},
- </if>
- <if test="longitude != null">
- #{longitude,jdbcType=VARCHAR},
- </if>
- <if test="latitude != null">
- #{latitude,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- #{status,jdbcType=INTEGER},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="clockIn != null">
- #{clockIn,jdbcType=INTEGER},
- </if>
- <if test="clockInTime != null">
- #{clockInTime,jdbcType=TIMESTAMP},
- </if>
- <if test="photoUrl != null">
- #{photoUrl,jdbcType=VARCHAR},
- </if>
- <if test="pid != null">
- #{pid,jdbcType=VARCHAR},
- </if>
- <if test="pname != null">
- #{pname,jdbcType=VARCHAR},
- </if>
- <if test="ufid != null">
- #{ufid,jdbcType=VARCHAR},
- </if>
- <if test="duration != null">
- #{duration,jdbcType=DOUBLE},
- </if>
- <if test="validDate != null">
- #{validDate,jdbcType=VARCHAR},
- </if>
- <if test="newUser != null">
- #{newUser,jdbcType=INTEGER},
- </if>
- <if test="signSum != null">
- #{signSum,jdbcType=INTEGER},
- </if>
- <if test="mainStatus != null">
- #{mainStatus,jdbcType=INTEGER},
- </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>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PublicRelease">
- update public_release
- <set>
- <if test="uid != null">
- `uid` = #{uid,jdbcType=VARCHAR},
- </if>
- <if test="aid != null">
- aid = #{aid,jdbcType=VARCHAR},
- </if>
- <if test="releaseStart != null">
- release_start = #{releaseStart,jdbcType=TIMESTAMP},
- </if>
- <if test="releaseEnd != null">
- release_end = #{releaseEnd,jdbcType=TIMESTAMP},
- </if>
- <if test="remarks != null">
- remarks = #{remarks,jdbcType=VARCHAR},
- </if>
- <if test="annexUrl != null">
- annex_url = #{annexUrl,jdbcType=VARCHAR},
- </if>
- <if test="userName != null">
- user_name = #{userName,jdbcType=VARCHAR},
- </if>
- <if test="longitude != null">
- longitude = #{longitude,jdbcType=VARCHAR},
- </if>
- <if test="latitude != null">
- latitude = #{latitude,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- `status` = #{status,jdbcType=INTEGER},
- </if>
- <if test="createTime != null">
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="clockIn != null">
- clock_in = #{clockIn,jdbcType=INTEGER},
- </if>
- <if test="clockInTime != null">
- clock_in_time = #{clockInTime,jdbcType=TIMESTAMP},
- </if>
- <if test="photoUrl != null">
- photo_url = #{photoUrl,jdbcType=VARCHAR},
- </if>
- <if test="pid != null">
- pid = #{pid,jdbcType=VARCHAR},
- </if>
- <if test="pname != null">
- pname = #{pname,jdbcType=VARCHAR},
- </if>
- <if test="ufid != null">
- ufid = #{ufid,jdbcType=VARCHAR},
- </if>
- <if test="duration != null">
- duration = #{duration,jdbcType=DOUBLE},
- </if>
- <if test="validDate != null">
- valid_date = #{validDate,jdbcType=VARCHAR},
- </if>
- <if test="newUser != null">
- new_user = #{newUser,jdbcType=INTEGER},
- </if>
- <if test="signSum != null">
- sign_sum = #{signSum,jdbcType=INTEGER},
- </if>
- <if test="mainStatus != null">
- main_status = #{mainStatus,jdbcType=INTEGER},
- </if>
- <if test="supplement != null">
- supplement = #{supplement,jdbcType=VARCHAR},
- </if>
- <if test="auditInfo != null">
- audit_info = #{auditInfo,jdbcType=VARCHAR},
- </if>
- <if test="plan != null">
- `plan` = #{plan,jdbcType=VARCHAR},
- </if>
- <if test="expectedEffect != null">
- expected_effect = #{expectedEffect,jdbcType=VARCHAR},
- </if>
- <if test="nextPlan != null">
- next_plan = #{nextPlan,jdbcType=VARCHAR},
- </if>
- <if test="type != null">
- `type` = #{type,jdbcType=INTEGER},
- </if>
- <if test="orderNo != null">
- order_no = #{orderNo,jdbcType=VARCHAR},
- </if>
- <if test="updateTime != null">
- update_time = #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateStatus != null">
- update_status = #{updateStatus,jdbcType=INTEGER},
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.PublicRelease">
- update public_release
- set `uid` = #{uid,jdbcType=VARCHAR},
- aid = #{aid,jdbcType=VARCHAR},
- release_start = #{releaseStart,jdbcType=TIMESTAMP},
- release_end = #{releaseEnd,jdbcType=TIMESTAMP},
- remarks = #{remarks,jdbcType=VARCHAR},
- annex_url = #{annexUrl,jdbcType=VARCHAR},
- user_name = #{userName,jdbcType=VARCHAR},
- longitude = #{longitude,jdbcType=VARCHAR},
- latitude = #{latitude,jdbcType=VARCHAR},
- `status` = #{status,jdbcType=INTEGER},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- clock_in = #{clockIn,jdbcType=INTEGER},
- clock_in_time = #{clockInTime,jdbcType=TIMESTAMP},
- photo_url = #{photoUrl,jdbcType=VARCHAR},
- pid = #{pid,jdbcType=VARCHAR},
- pname = #{pname,jdbcType=VARCHAR},
- ufid = #{ufid,jdbcType=VARCHAR},
- duration = #{duration,jdbcType=DOUBLE},
- valid_date = #{validDate,jdbcType=VARCHAR},
- new_user = #{newUser,jdbcType=INTEGER},
- sign_sum = #{signSum,jdbcType=INTEGER},
- main_status = #{mainStatus,jdbcType=INTEGER},
- supplement = #{supplement,jdbcType=VARCHAR},
- audit_info = #{auditInfo,jdbcType=VARCHAR},
- `plan` = #{plan,jdbcType=VARCHAR},
- expected_effect = #{expectedEffect,jdbcType=VARCHAR},
- next_plan = #{nextPlan,jdbcType=VARCHAR},
- `type` = #{type,jdbcType=INTEGER},
- order_no = #{orderNo,jdbcType=VARCHAR},
- update_time = #{updateTime,jdbcType=TIMESTAMP},
- update_status = #{updateStatus,jdbcType=INTEGER}
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateSignByAidAndUid">
- update public_release a ,(select max(create_time)create_time from public_release
- where aid= #{aid} and uid=#{uid} and main_status =1 group by aid,uid)b
- set a.sign_sum =a.sign_sum +1
- where a.aid =#{aid} and a.uid =#{uid} and a.main_status =1 and a.create_time =b.create_time
- </update>
- <select id="listPublicRelease" resultType="com.goafanti.weChat.bo.OutPublicReleaseList">
- select a.id,b.nickname ,c.name aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.user_name userName,
- 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.latitude ,a.longitude ,a.clock_in clockIn
- from public_release a left join `user` b on a.uid =b.id left join admin c on a.aid =c.id
- <if test="type==2">
- left join department d on c.department_id =d.id
- </if>
- where 1=1
- <if test="type==0">
- and a.aid= #{aid}
- </if>
- <if test="type==1">
- and c.reviewer = #{aid}
- </if>
- <if test="type==2">
- and d.manager_id = #{aid}
- </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 b.nickname like CONCAT('%',#{userName},'%')
- </if>
- <if test="status !=null">
- and a.status = #{status}
- </if>
- <if test="clockIn !=null">
- and a.clock_in = #{clockIn}
- </if>
- ORDER BY (case when a.status=1 then 1 else 2 end),a.status ,a.create_time desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
- <select id="countPublicRelease" resultType="java.lang.Integer">
- select count(*)
- from public_release a left join `user` b on a.uid =b.id left join admin c on a.aid =c.id
- <if test="type==2">
- left join department d on c.department_id =d.id
- </if>
- where 1=1
- <if test="type==0">
- and a.aid= #{aid}
- </if>
- <if test="type==1">
- and c.reviewer = #{aid}
- </if>
- <if test="type==2">
- and d.manager_id = #{aid}
- </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 b.nickname like CONCAT('%',#{userName},'%')
- </if>
- <if test="status !=null">
- and a.status = #{status}
- </if>
- <if test="clockIn !=null">
- and a.clock_in = #{clockIn}
- </if>
- </select>
- <select id="selectDtails" resultType="com.goafanti.weChat.bo.OutPublicRelease">
- select a.id,b.nickname ,c.name aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.user_name userName,
- 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.latitude ,a.longitude ,a.aid ,c.superior_id suprId,a.uid,
- a.clock_in clockIn ,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
- from public_release a left join `user` b on a.uid =b.id left join admin c on a.aid =c.id
- 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>
- <if test="ufid !=null">
- and a.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 if(a.status=0,1,0)bh ,if(a.status=1,1,0)wsh,if(a.status=2,1,0)tg,if(a.clock_in=1,1,0) dk,a.aid
- ,if(a.status=2,a.duration,0)duration from public_release a left join admin b on a.aid=b.id
- where 1=1
- <if test="aid != null">
- and a.aid= #{aid}
- </if>
- <if test="clockStart != null and clockEnd != null">
- and a.clock_in_time between #{clockStart} and #{clockEnd}
- </if>
- <if test="createStart != null and createEnd !=null">
- and a.create_time between #{createStart} and #{createEnd}
- </if>
- <if test="depId != null">
- and b.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 left join admin b on a.aid=b.id
- where 1=1
- <if test="aid != null">
- and a.aid= #{aid}
- </if>
- <if test="clockStart != null and clockEnd != null">
- and a.clock_in_time between #{clockStart} and #{clockEnd}
- </if>
- <if test="createStart != null and createEnd !=null">
- and a.create_time between #{createStart} and #{createEnd}
- </if>
- <if test="depId != null">
- and b.department_id = #{depId}
- </if>
- group by aid)x
- </select>
- <select id="listPublicDtails" resultType="com.goafanti.weChat.bo.OutPublicDtails">
- select a.id,b.nickname ,a.user_name userName,c.name aname,a.duration ,a.status,a.annex_url annexUrl,a.photo_url photoUrl,
- date_format(a.clock_in_time ,'%Y-%m-%d %H:%i:%S') clockInTimes,a.clock_in clockIn,a.remarks,a.supplement,a.type,
- date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,a.audit_info auditInfo,d.name sname,
- date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,
- a.plan ,a.next_plan nextPlan ,a.expected_effect expectedEffect,a.update_status updateStatus
- from public_release a left join `user` b on a.uid=b.id left join admin c on a.aid =c.id
- left join admin d on b.aid=d.id where 1=1
- <if test="publicType != null">
- and a.type= #{publicType}
- </if>
- <if test="aid != null">
- and a.aid= #{aid}
- </if>
- <if test="sid != null">
- and d.id= #{sid}
- </if>
- <if test="depId != null">
- and c.department_id = #{depId}
- </if>
- <if test="type==1 and deps !=null">
- and c.department_id in
- <foreach close=")" collection="deps" item="deps" open="(" separator=",">
- #{deps.id}
- </foreach>
- </if>
- <if test="uid != null">
- and a.uid = #{uid}
- </if>
- <if test="releaseStart != null and releaseEnd != null">
- and (a.release_start between #{releaseStart} and #{releaseEnd} or a.release_end between #{releaseStart} and #{releaseEnd})
- </if>
- <if test="status != null">
- and a.status = #{status}
- </if>
- <if test="clockIn !=null">
- and a.clock_in= #{clockIn}
- </if>
- order by a.status,a.create_time desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
- <select id="countPublicDtails" resultType="java.lang.Integer">
- select count(*)
- from public_release a left join `user` b on a.uid=b.id left join admin c on a.aid =c.id
- left join admin d on b.aid=d.id
- where 1=1
- <if test="publicType != null">
- and a.type= #{publicType}
- </if>
- <if test="aid != null">
- and a.aid= #{aid}
- </if>
- <if test="sid != null">
- and d.id= #{sid}
- </if>
- <if test="depId != null">
- and c.department_id = #{depId}
- </if>
- <if test="type==1 and deps !=null">
- and c.department_id in
- <foreach close=")" collection="deps" item="deps" open="(" separator=",">
- #{deps.id}
- </foreach>
- </if>
- <if test="uid != null">
- and a.uid = #{uid}
- </if>
- <if test="releaseStart != null and releaseEnd != null">
- and (a.release_start between #{releaseStart} and #{releaseEnd} or a.release_end between #{releaseStart} and #{releaseEnd})
- </if>
- <if test="status != null">
- and a.status = #{status}
- </if>
- <if test="clockIn !=null">
- and a.clock_in= #{clockIn}
- </if>
- </select>
- <select id="checkTime" resultType="java.lang.Integer">
- select count(*) 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 aid,uid,new_user from public_release
- where main_status =1 and create_time between #{date} and #{now}
- group by aid,uid,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,a.aid,b.nickname ,c.name aname,a.duration ,a.user_name userName,
- date_format(a.release_start,'%Y-%m-%d %H:%i:%S')releaseStarts,
- date_format(a.release_end ,'%Y-%m-%d %H:%i:%S')releaseEnds,
- date_format(a.clock_in_time ,'%Y-%m-%d %H:%i:%S')clockInTimes,
- a.remarks
- from public_release a left join user b on a.uid=b.id
- left join admin c on a.aid =c.id
- where a.order_no = #{orderNo}
- </select>
- </mapper>
|