|
|
@@ -23,14 +23,16 @@
|
|
|
<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" />
|
|
|
</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
|
|
|
+ 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
|
|
|
</sql>
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
- select
|
|
|
+ select
|
|
|
<include refid="Base_Column_List" />
|
|
|
from public_release
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
@@ -40,20 +42,22 @@
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</delete>
|
|
|
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicRelease" useGeneratedKeys="true">
|
|
|
- insert into public_release (`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)
|
|
|
- values (#{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})
|
|
|
+ insert into public_release (`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)
|
|
|
+ values (#{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})
|
|
|
</insert>
|
|
|
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicRelease" useGeneratedKeys="true">
|
|
|
insert into public_release
|
|
|
@@ -118,6 +122,12 @@
|
|
|
<if test="newUser != null">
|
|
|
new_user,
|
|
|
</if>
|
|
|
+ <if test="signSum != null">
|
|
|
+ sign_sum,
|
|
|
+ </if>
|
|
|
+ <if test="mainStatus != null">
|
|
|
+ main_status,
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="uid != null">
|
|
|
@@ -180,6 +190,12 @@
|
|
|
<if test="newUser != null">
|
|
|
#{newUser,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
+ <if test="signSum != null">
|
|
|
+ #{signSum,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="mainStatus != null">
|
|
|
+ #{mainStatus,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PublicRelease">
|
|
|
@@ -245,34 +261,48 @@
|
|
|
<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>
|
|
|
</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}
|
|
|
+ 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}
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
- <insert id="insertSelectiveGetId" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicRelease" useGeneratedKeys="true">
|
|
|
+ <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>
|
|
|
+ <insert id="insertSelectiveGetId" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicRelease" useGeneratedKeys="true">
|
|
|
insert into public_release
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
<if test="uid != null">
|
|
|
@@ -335,6 +365,12 @@
|
|
|
<if test="newUser != null">
|
|
|
new_user,
|
|
|
</if>
|
|
|
+ <if test="signSum != null">
|
|
|
+ sign_sum,
|
|
|
+ </if>
|
|
|
+ <if test="mainStatus != null">
|
|
|
+ main_status,
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="uid != null">
|
|
|
@@ -397,6 +433,12 @@
|
|
|
<if test="newUser != null">
|
|
|
#{newUser,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
+ <if test="signSum != null">
|
|
|
+ #{signSum,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="mainStatus != null">
|
|
|
+ #{mainStatus,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
<selectKey keyProperty="id" order="AFTER" resultType="int">
|
|
|
SELECT LAST_INSERT_ID()
|