<?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.panzhihua.service_dangjian.dao.NewFightIntegratingTaskDao">
|
|
<resultMap type="com.panzhihua.service_dangjian.entity.IntegratingTask" id="itemMap">
|
<result property="id" column="id" />
|
<result property="isDraw" column="is_draw" />
|
<result property="status" column="status" />
|
<result property="userId" column="user_id" />
|
<result property="communityId" column="community_id" />
|
<result property="creationTime" column="creation_time" />
|
</resultMap>
|
|
|
<!-- 分页查询 -->
|
<select id="getList" resultMap="itemMap">
|
select
|
id,
|
is_draw,
|
status,
|
user_id,
|
community_id,
|
creation_time
|
from new_strive_integrating_task
|
<where>
|
1=1
|
<if test="communityId !=null and communityId !='' ">
|
and community_id=#{communityId}
|
</if>
|
<if test="userId !=null and userId !='' ">
|
and user_id=#{userId}
|
</if>
|
</where>
|
</select>
|
|
<!-- 分页查询 -->
|
<select id="getDetails" resultMap="itemMap">
|
select
|
id,
|
is_draw,
|
status,
|
user_id,
|
community_id,
|
creation_time
|
from new_strive_integrating_task
|
<where>
|
1=1
|
<if test="communityId !=null and communityId !='' ">
|
and community_id=#{communityId}
|
</if>
|
<if test="userId !=null and userId !='' ">
|
and user_id=#{userId}
|
</if>
|
<if test="status !=null and status !='' ">
|
and status=#{status}
|
</if>
|
</where>
|
LIMIT 1
|
</select>
|
|
|
|
<insert id="addData">
|
insert into new_strive_integrating_task
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="item.id != null and item.id != '' ">
|
id,
|
</if>
|
<if test="item.isDraw != null and item.isDraw != '' ">
|
is_draw,
|
</if>
|
<if test="item.status != null and item.status != '' ">
|
status,
|
</if>
|
<if test="item.userId != null and item.userId != '' ">
|
user_id,
|
</if>
|
<if test="item.communityId !=null and item.communityId !='' ">
|
community_id,
|
</if>
|
creation_time
|
</trim>
|
values
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="item.id != null and item.id != '' ">
|
#{item.id},
|
</if>
|
<if test="item.isDraw != null and item.isDraw != '' ">
|
#{item.isDraw},
|
</if>
|
<if test="item.status != null and item.status != '' ">
|
#{item.status},
|
</if>
|
<if test="item.userId != null and item.userId != '' ">
|
#{item.userId},
|
</if>
|
<if test="item.communityId !=null and item.communityId !='' ">
|
#{item.communityId},
|
</if>
|
sysdate()
|
</trim>
|
</insert>
|
|
|
|
<update id="editData">
|
update new_strive_integrating_task
|
<set>
|
<if test="item.id != null and item.id != '' ">
|
id=#{item.id},
|
</if>
|
<if test="item.isDraw != null and item.isDraw != '' ">
|
is_draw=#{item.isDraw},
|
</if>
|
<if test="item.status != null and item.status != '' ">
|
status=#{item.status},
|
</if>
|
<if test="item.userId != null and item.userId != '' ">
|
user_id=#{item.userId},
|
</if>
|
<if test="item.communityId !=null and item.communityId !='' ">
|
community_id=#{item.communityId},
|
</if>
|
update_time=sysdate()
|
</set>
|
where id = #{item.id}
|
</update>
|
|
<delete id="expurgateData" parameterType="String">
|
delete from new_strive_integrating_task where id=#{id}
|
</delete>
|
|
|
<delete id="truncateData">
|
truncate new_strive_integrating_task
|
</delete>
|
|
|
|
|
|
|
|
|
|
<!-- 分页查询 -->
|
<select id="getEverydayList" resultMap="itemMap">
|
select
|
id,
|
user_id,
|
community_id,
|
creation_time
|
from new_strive_everyday_register
|
<where>
|
1=1
|
<if test="communityId !=null and communityId !='' ">
|
and community_id=#{communityId}
|
</if>
|
<if test="userId !=null and userId !='' ">
|
and user_id=#{userId}
|
</if>
|
</where>
|
order by creation_time desc
|
LIMIT 15
|
</select>
|
|
|
|
|
<insert id="addEverydayData">
|
insert into new_strive_everyday_register
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="item.id != null and item.id != '' ">
|
id,
|
</if>
|
<if test="item.isDraw != null and item.isDraw != '' ">
|
is_draw,
|
</if>
|
<if test="item.status != null and item.status != '' ">
|
status,
|
</if>
|
<if test="item.userId != null and item.userId != '' ">
|
user_id,
|
</if>
|
<if test="item.communityId !=null and item.communityId !='' ">
|
community_id,
|
</if>
|
creation_time
|
</trim>
|
values
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="item.id != null and item.id != '' ">
|
#{item.id},
|
</if>
|
<if test="item.isDraw != null and item.isDraw != '' ">
|
#{item.isDraw},
|
</if>
|
<if test="item.status != null and item.status != '' ">
|
#{item.status},
|
</if>
|
<if test="item.userId != null and item.userId != '' ">
|
#{item.userId},
|
</if>
|
<if test="item.communityId !=null and item.communityId !='' ">
|
#{item.communityId},
|
</if>
|
sysdate()
|
</trim>
|
</insert>
|
|
|
|
|
|
|
|
|
|
</mapper>
|