微信小程序--嘟嘟会议--会议发布和我的会议查看

2021/7/5 22:21:11

本文主要是介绍微信小程序--嘟嘟会议--会议发布和我的会议查看,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

微信小程序–嘟嘟会议–会议发布和我的会议查看

meetingPubAdd.html

<!DOCTYPE html>
<html  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta http-equiv="Cache-Control" content="no-cache,must-revalidate">
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta name="format-detection" content="telephone=no, address=no">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black-translucent" name="apple-mobile-web-app-status-bar-style">
    <title></title>
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css">
    <link href="https://cdn.bootcss.com/jquery-mobile/1.4.5/jquery.mobile.theme.css" rel="stylesheet">
    <script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
    <script src="/weixin/js/jquerymobile_popup.js"></script>
    <script type="text/javascript">
        $(function (){
            //加载可用课题类别列表数据
            $.ajax({
                type:"get",
                url:"/meetingtype/list",
                success:function (msg){
                    if (msg.code==2003){
                        //没加载数据
                        // openPopup('!','提示',undefined,true,undefined,'error','cn');
                    }else if (msg.code==2000){
                        var dataObj = msg.data;
                        var appendHtml = "<option value='0'>请选择类别</option>";
                        for (var i=0;i<dataObj.length;i++){
                            appendHtml+="<option value='"+dataObj[i].id+"'>"+dataObj[i].name+"</option>";
                        }
                        $("#tid").append(appendHtml);
                        //<option value="数据库">数据库</option>
                    }
                }
            })
        })

        function showPubDiv() {
            $("#two_line").css("border-top", "5px solid #4E90C7");
            //$("#two_tab").css("color","#777777");
            $("#one_line").css("border-top", "5px solid white");
            //$("#one_tab").css("color","white");
            $("#two").css("display", "none");
            $("#one").css("display", "block");
        }
        function showMyMeetings() {
            $.mobile.loading( "show", {
                text: "加载中...",
                textVisible: true,
            });

            $("#two_line").css("border-top", "5px solid white");
            $("#one_line").css("border-top", "5px solid #4E90C7");

            $("#one").css("display", "none");
            $("#two").css("display", "block");

            $("#two").empty();
            var uid=$("#uid").val();

            $.ajax({
                type:"get",
                url:"/meetingPub/meetingPubByUid",
                data:{"uid":uid},
                success:function (msg){
                    if (msg.code==2000){
                        var dataObj = msg.data;
                        var appendHtml = "<font style='padding: 10px 10px 10px 15px;display: block;color: #777777;'>您共发布了"+dataObj.length+"场会议</font>";
                        for (var i = 0; i < dataObj.length; i++) {
                            var mname=dataObj[i].ptitle;
                            var remark=dataObj[i].meetingtype.name;
                            var dateCurr=dataObj[i].pcode;

                            appendHtml += "<div style='width: 100%;background-color: white;margin-top: -3px;padding:10px 10px 10px 15px;display: inline-block;'>" +
                                "<div style='width: 70%;float: left;' οnclick='showMeetingInfo(\"" + 1 + "\");'>" +
                                "<div style='white-space: nowrap;overflow: hidden;text-overflow:ellipsis;display: block;font-size:18px;'>" +
                                mname + "</div>" +
                                "<div style='white-space: nowrap;overflow: hidden;text-overflow:ellipsis;display: block;color: #777777;font-size:16px;padding-top:1px'>" +
                                remark + " / " + dateCurr + "</div></div>" +
                                "<div style='width: 30%;float: right;'>" +
                                "<button class='able-btn' οnclick='chooseMeetingGrab(\""+dataObj[i].id+"\")'>选择讲者</button></div></div>";
                        }
                        $("#two").append(appendHtml);
                        $.mobile.loading( "hide" );
                    }
                }
            });
        }
        //选择讲者
        function chooseMeetingGrab(pid) {
               window.location.href="/meetingPub/meetingGrabToPage?pid="+pid;
        }

        function subMeetingPub(){
            var ptime=$("#ptime").val();
            if (ptime.length<1){
                openPopup('会议召开日期不能为空','提示',undefined,true,undefined,'error','cn');
                return;
            }

            var tid=$("#tid").val();
            if (tid==0){
                openPopup('请选择课题类别','提示',undefined,true,undefined,'error','cn');
                return;
            }

            var ptitle=$("#ptitle").val();
            if (ptitle.length<1){
                openPopup('会议主题不能为空','提示',undefined,true,undefined,'error','cn');
                return;
            }

            var remark=$("#remark").val();
            if (remark.length<1){
                openPopup('会议描述不能为空','提示',undefined,true,undefined,'error','cn');
                return;
            }

            var dataObj=$("#pubForm").serialize();
            $.ajax({
                type: "post",
                url: "/meetingPub/addMeetingPub",
                data:dataObj,
                success:function (msg){
                    if(msg.code=="2000"){
                        openPopup('会议发布成功','提示',undefined,true,undefined,'error','cn');
                        $("#ptime").val("");
                        $("#ptitle").val("");
                        $("#remark").val("");
                    }else {
                        openPopup('会议发布失败','提示',undefined,true,undefined,'error','cn');

                    }
                }

            })
        }
    </script>
</head>
<body>

<div data-role="page" id="pageDetail">
    <div style="padding:0px;background-color: #4E90C7;width: 100%;height:40px;line-height:40px;font-size:18px;text-align: center;cursor: pointer;" data-role="none">
        <div style="width: 50%;float: left;color: white;" onclick="showPubDiv();" id="one_tab">
            发布
            <div style="border-right: 1px solid white;float: right;margin-top: 10px;height: 20px;"></div>
        </div>
        <div style="width: 50%;float: left;color: white;" onclick="showMyMeetings();" id="two_tab">我的会议</div>
        <div style="border-top:5px solid white;width: 50%;float: left;" id="one_line"></div>
        <div style="border-top:5px solid #4E90C7;width: 50%;float: left;" id="two_line"></div>
    </div>
    <div id="one" class="ui-body-d ui-content" style="padding:0;display: block;width: 100%;">
        <font style="padding:10px 10px 10px 15px;display: block;color: #777777;">请填写会议相关信息</font>
        <div style="width: 100%;background-color: white;padding:10px 0 10px 0;">

            <form id="pubForm" method="post">
                <input type="hidden" name="uid" id="uid" th:value="${uid}"/>
                <div style="padding-right:15px;padding-left:15px">
                    <label for="ptitle" class="font-label">会议名称:</label>
                    <input name="ptitle" id="ptitle" placeholder="请输入会议名称" ></input>
                </div>
                <div  style="padding-right:15px;padding-left:15px">
                    <label for="ptime" class="font-label">会议日期</label>
                    <input type="datetime-local" name="ptime" id="ptime" />
                </div>
                <div style="padding-right:15px;padding-left:15px">
                    <label for="tid" class="font-label">类别:</label>
                    <select name="tid" id="tid">

                    </select>
                </div>
                <div style="padding-right:15px;padding-left:15px">
                    <label for="pzone" class="font-label">讲者区域:</label>
                    <select name="pzone" id="pzone">
                        <option value="全国" selected="selected">全国</option>
                        <option value="东区">东区</option>
                        <option value="南区">南区</option>
                        <option value="西区">西区</option>
                        <option value="北区">北区</option>
                    </select>
                </div>
                <div style="padding-right:15px;padding-left:15px">
                    <label for="remark" class="font-label">备注(选填,100字以内)</label>
                    <textarea name="remark" id="remark" placeholder="请输入会议备注" maxlength="100" class="font-blue input-lightblue" style="box-shadow: none;"></textarea>
                </div>
                <div style="padding-right:15px;padding-left:15px">
                    <input type="button" value="发布会议"  onclick="subMeetingPub()" id="btnId" />
                </div>
            </form>
        </div>
    </div>
    <div id="two" class="ui-body-d ui-content" style="padding: 0;display: none;width: 100%;">
    </div>
    </div>
</body>
</html>

meetingPubController.java

package com.qfjy.project.meeting.controller;

import com.qfjy.entity.po.Meetingpub;
import com.qfjy.entity.po.User;
import com.qfjy.service.MeetingGrabService;
import com.qfjy.service.MeetingPubService;
import com.qfjy.service.UserService;
import com.qfjy.util.result.ResultCode;
import com.qfjy.util.result.ResultJson;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Controller
@RequestMapping("meetingPub")
@Slf4j
public class MeetingPubController {

    @Autowired
    private MeetingPubService meetingPubService;
    @Autowired
    private UserService userService;
    @Autowired
    private MeetingGrabService meetingGrabService;

    @ResponseBody
    @PostMapping("addMeetingPub")
    public ResultJson addMeetingPub(Meetingpub meetingpub){
        int num=meetingPubService.insert(meetingpub);
        if(num>0){
            log.info("会议发布成功"+meetingpub);
            return new ResultJson(num, ResultCode.SUCCESS);
        }
        return new ResultJson(null, ResultCode.FAIL);
    }
        @GetMapping("test")
   public String test(){
        return "weixin/meetingPub/meetingPubAdd";
   }

   @ResponseBody
   @GetMapping("meetingPubByUid")
   public ResultJson selectMeetingPubByUid(@RequestParam("uid") int uid){
       List<Meetingpub> list = meetingPubService.selectMeetingPubByUid(uid);
       log.info("查询我的会议列表"+uid+"\t"+list);
       return new ResultJson(list,ResultCode.SUCCESS);
   }

    /**
     * 会议选择---我的会议---选择讲者
     * */

    @GetMapping("meetingGrabToPage")
    public String meetingGrabToPage(HttpServletRequest request){
        request.setAttribute("pid", request.getParameter("pid"));
        return "weixin/meetingGrab/meetingGrabList";
    }

    /**
     * 会议发单--我的发单列表---选择讲者(按钮)--->抢单者列表数据加载
     * */
    @ResponseBody
    @GetMapping("meetingGrabListByPid")
    public Object meetingGrabListByPid(@RequestParam("pid") String pid){
        List<User> list=userService.selectMeetingGrabUserByPid(pid);
        return new ResultJson(list,ResultCode.SUCCESS);
    }

    /**
     * 就选你功能
     * */
    @ResponseBody
    @PostMapping("chooserGrabByUid")
    public Object chooserGrabByUid(@RequestParam("uid") final int uid,
                                   @RequestParam("pid") final String pid){

       int num=0;
        try {
           num=meetingGrabService.chooseGrabByUid(uid,pid);
        }catch (RuntimeException re){
             log.info(re.getMessage());
            return new ResultJson(num,ResultCode.FAIL);
        }catch (Exception e){

        }
        return new ResultJson(num,ResultCode.SUCCESS);
    }
}

meetingPubService.java

package com.qfjy.service;
import com.qfjy.entity.po.Meetingpub;
import java.util.List;
public interface MeetingPubService {
     /**会议发布*/
     int insertSelective(Meetingpub meetingpub);
     int insert(Meetingpub meetingpub);
     //会议编号生成
     String generCode(String ptime);
     /**我发布的会议列表*/
     List<Meetingpub> selectMeetingPubByUid(int uid);
     /**
      * 会议i抢单---》可见抢单 列表页面 根据抢单人uid
      * @param tid 课题类别
      * @param uid 抢单人uid
      * */
     List<Meetingpub> selectMetingGrabByUid(int uid,int tid);
}

meetingPubServiceImpl.java

package com.qfjy.service.impl;

import com.qfjy.entity.po.Meetingpub;
import com.qfjy.mapper.MeetingpubMapper;
import com.qfjy.service.MeetingPubService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.util.Date;
import java.util.List;
import java.util.UUID;

@Service
@Slf4j
public class MeetingPubServiceImpl implements MeetingPubService {

    @Autowired
    private MeetingpubMapper meetingpubMapper;
    @Override
    public int insertSelective(Meetingpub meetingpub) {
        String id = UUID.randomUUID().toString();
        // System.out.println(id);
        meetingpub.setId(id);
        meetingpub.setPcode("");//会议编号 内部规则
        meetingpub.setCreatedate(new Date());
        meetingpub.setStatus((short) 1);
        return meetingpubMapper.insertSelective(meetingpub);
    }
    @Override
    public int insert(Meetingpub meetingpub) {
        String id = UUID.randomUUID().toString();
        // System.out.println(id);
        meetingpub.setId(id);
        meetingpub.setPcode(this.generCode(meetingpub.getPtime()));//会议编号 内部规则
        meetingpub.setCreatedate(new Date());
        meetingpub.setStatus((short) 1);
        return meetingpubMapper.insert(meetingpub);
    }
    /**
     * 会议编号生成规则 需求逻辑:
     *   根据会议召开日期生成会议编号。
     *   例如: 2021-07-02T12:01
     *    会议编号:  20210702001
     *    如果再次发表一个会议,  2021-07-02T08:01
     *    会议编号:  20210702002
     *    依次类推--》生成会议编号。
     * @return
     */
    /**
     * 实现逻辑:
     * 1.根据会议召开时间 进行字符串截取
     * 2.查询MYSQL  select max(pcode) from meetingpub where LEFT(pcode,8)='20210702';
     * 3.判断查询结果是否为空
     * @return
     */
    @Override
    public String generCode(String ptime) {
        //1.根据会议召开时间 进行字符串截取
        String time = ptime.substring(0, 10).replaceAll("-", "");
        //2.查询MYSQL

        String result = meetingpubMapper.selectMaxPcodeByPtime(time);
        if (StringUtils.isEmpty(result)){
            result=time+"001";
            return result;
        }else {
            long num = Long.parseLong(result)+1;
            result = num+"";
            return result;
        }
    }
    @Override
    public List<Meetingpub> selectMeetingPubByUid(int uid) {
        return meetingpubMapper.selectMeetingPubByUid(uid);
    }
    @Override
    public List<Meetingpub> selectMetingGrabByUid(int uid, int tid) {
        return meetingpubMapper.selectMetingGrabByUid(uid,tid);
    }
}

meetingPubMapper.java

package com.qfjy.mapper;

import com.qfjy.entity.po.Meetingpub;
import com.qfjy.entity.po.MeetingpubExample;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface MeetingpubMapper {
    long countByExample(MeetingpubExample example);

    int deleteByExample(MeetingpubExample example);

    int deleteByPrimaryKey(String id);

    int insert(Meetingpub meetingpub);

    int insertSelective(Meetingpub meetingpub);

    List<Meetingpub> selectByExample(MeetingpubExample example);

    Meetingpub selectByPrimaryKey(String id);

    int updateByExampleSelective(@Param("record") Meetingpub record, @Param("example") MeetingpubExample example);

    int updateByExample(@Param("record") Meetingpub record, @Param("example") MeetingpubExample example);

    int updateByPrimaryKeySelective(Meetingpub record);

    int updateByPrimaryKey(Meetingpub record);

    @Select("select max(pcode) from meetingpub where LEFT(pcode,8)=#{time}")
    String selectMaxPcodeByPtime(String time);

    /**根据用户ID查询发布的会议*/
    List<Meetingpub> selectMeetingPubByUid(int uid);

    /**
     * 会议i抢单---》可见抢单 列表页面 根据抢单人uid
     * @param tid 课题类别
     * @param uid 抢单人uid
     * */
    List<Meetingpub> selectMetingGrabByUid(int uid,int tid);
}

meetingPubMapper.xml

<?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.qfjy.mapper.MeetingpubMapper">
  <resultMap id="BaseResultMap" type="com.qfjy.entity.po.Meetingpub">
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="pcode" jdbcType="VARCHAR" property="pcode" />
    <result column="ptime" jdbcType="VARCHAR" property="ptime" />
    <result column="tid" jdbcType="INTEGER" property="tid" />
    <result column="ptitle" jdbcType="VARCHAR" property="ptitle" />
    <result column="pzone" jdbcType="VARCHAR" property="pzone" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="uid" jdbcType="INTEGER" property="uid" />
    <result column="createDate" jdbcType="TIMESTAMP" property="createdate" />
    <result column="status" jdbcType="SMALLINT" property="status" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">
    <where>
      <foreach collection="example.oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    id, pcode, ptime, tid, ptitle, pzone, remark, `uid`, createDate, `status`
  </sql>
  <select id="selectByExample" parameterType="com.qfjy.entity.po.MeetingpubExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from meetingpub
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
    <if test="limit != null">
      <if test="offset != null">
        limit ${offset}, ${limit}
      </if>
      <if test="offset == null">
        limit ${limit}
      </if>
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from meetingpub
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from meetingpub
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="com.qfjy.entity.po.MeetingpubExample">
    delete from meetingpub
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.qfjy.entity.po.Meetingpub" useGeneratedKeys="true">
    insert into meetingpub (id,pcode, ptime, tid,
      ptitle, pzone, remark, 
      `uid`, createDate, `status`
      )
    values (#{id},#{pcode,jdbcType=VARCHAR}, #{ptime,jdbcType=VARCHAR}, #{tid,jdbcType=INTEGER},
      #{ptitle,jdbcType=VARCHAR}, #{pzone,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, 
      #{uid,jdbcType=INTEGER}, #{createdate,jdbcType=TIMESTAMP}, #{status,jdbcType=SMALLINT}
      )
  </insert>
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.qfjy.entity.po.Meetingpub" useGeneratedKeys="true">
    insert into meetingpub
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="pcode != null">
        pcode,
      </if>
      <if test="ptime != null">
        ptime,
      </if>
      <if test="tid != null">
        tid,
      </if>
      <if test="ptitle != null">
        ptitle,
      </if>
      <if test="pzone != null">
        pzone,
      </if>
      <if test="remark != null">
        remark,
      </if>
      <if test="uid != null">
        `uid`,
      </if>
      <if test="createdate != null">
        createDate,
      </if>
      <if test="status != null">
        `status`,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="pcode != null">
        #{pcode,jdbcType=VARCHAR},
      </if>
      <if test="ptime != null">
        #{ptime,jdbcType=VARCHAR},
      </if>
      <if test="tid != null">
        #{tid,jdbcType=INTEGER},
      </if>
      <if test="ptitle != null">
        #{ptitle,jdbcType=VARCHAR},
      </if>
      <if test="pzone != null">
        #{pzone,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
      <if test="uid != null">
        #{uid,jdbcType=INTEGER},
      </if>
      <if test="createdate != null">
        #{createdate,jdbcType=TIMESTAMP},
      </if>
      <if test="status != null">
        #{status,jdbcType=SMALLINT},
      </if>
    </trim>
  </insert>

  <!--   * 会议i抢单   可见抢单 列表页面 根据抢单人uid
     * @param tid 课题类别
     * @param uid 抢单人uid-->
  <select id="selectMetingGrabByUid" resultType="com.qfjy.entity.po.Meetingpub" resultMap="selectMetingGrabByUidResultMap">
    select pub.*,type.`name` from meetingpub pub
    LEFT JOIN user u ON (pub.pzone='全国' or pub.pzone=u.zone)
    LEFT JOIN meetingtype type ON pub.tid=type.id
    where u.id=#{param1}
    and pub.id not in (select pid from meetinggrab where uid=#{param1}  or grabstatus=1 )
    <if test="param2!=-1">
      and tid=#{param2}
    </if>
    ORDER BY pub.pcode desc
  </select>
  <resultMap id="selectMetingGrabByUidResultMap" type="com.qfjy.entity.po.Meetingpub" extends="BaseResultMap">
    <association property="meetingtype">
    <result column="name" jdbcType="VARCHAR" property="name" />
    </association>
  </resultMap>




  <select id="countByExample" parameterType="com.qfjy.entity.po.MeetingpubExample" resultType="java.lang.Long">
    select count(*) from meetingpub
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
<!--  会议主题 课题类别/会议编号-->
    <select id="selectMeetingPubByUid" resultType="com.qfjy.entity.po.Meetingpub" resultMap="selectMeetingPubByUidResultMap">
     select pub.*,type.id as id123,type.`name` from meetingpub pub
     LEFT JOIN meetingtype type ON pub.tid=type.id
     where pub.uid=#{uid} ORDER BY pcode desc
   </select>

  <resultMap id="selectMeetingPubByUidResultMap" type="com.qfjy.entity.po.Meetingpub" extends="BaseResultMap">
        <!--MeetingPub属性和字段完成了映射-->
        <association property="meetingtype">
          <id column="id123" jdbcType="INTEGER" property="id" />
          <result column="name" jdbcType="VARCHAR" property="name" />
          <result column="remark" jdbcType="VARCHAR" property="remark" />
          <result column="status" jdbcType="SMALLINT" property="status" />
          <result column="sortnum" jdbcType="INTEGER" property="sortnum" />
          <result column="createDate" jdbcType="TIMESTAMP" property="createdate" />
        </association>
      </resultMap>


    <update id="updateByExampleSelective" parameterType="map">
    update meetingpub
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=VARCHAR},
      </if>
      <if test="record.pcode != null">
        pcode = #{record.pcode,jdbcType=VARCHAR},
      </if>
      <if test="record.ptime != null">
        ptime = #{record.ptime,jdbcType=VARCHAR},
      </if>
      <if test="record.tid != null">
        tid = #{record.tid,jdbcType=INTEGER},
      </if>
      <if test="record.ptitle != null">
        ptitle = #{record.ptitle,jdbcType=VARCHAR},
      </if>
      <if test="record.pzone != null">
        pzone = #{record.pzone,jdbcType=VARCHAR},
      </if>
      <if test="record.remark != null">
        remark = #{record.remark,jdbcType=VARCHAR},
      </if>
      <if test="record.uid != null">
        `uid` = #{record.uid,jdbcType=INTEGER},
      </if>
      <if test="record.createdate != null">
        createDate = #{record.createdate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.status != null">
        `status` = #{record.status,jdbcType=SMALLINT},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update meetingpub
    set id = #{record.id,jdbcType=VARCHAR},
      pcode = #{record.pcode,jdbcType=VARCHAR},
      ptime = #{record.ptime,jdbcType=VARCHAR},
      tid = #{record.tid,jdbcType=INTEGER},
      ptitle = #{record.ptitle,jdbcType=VARCHAR},
      pzone = #{record.pzone,jdbcType=VARCHAR},
      remark = #{record.remark,jdbcType=VARCHAR},
      `uid` = #{record.uid,jdbcType=INTEGER},
      createDate = #{record.createdate,jdbcType=TIMESTAMP},
      `status` = #{record.status,jdbcType=SMALLINT}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.qfjy.entity.po.Meetingpub">
    update meetingpub
    <set>
      <if test="pcode != null">
        pcode = #{pcode,jdbcType=VARCHAR},
      </if>
      <if test="ptime != null">
        ptime = #{ptime,jdbcType=VARCHAR},
      </if>
      <if test="tid != null">
        tid = #{tid,jdbcType=INTEGER},
      </if>
      <if test="ptitle != null">
        ptitle = #{ptitle,jdbcType=VARCHAR},
      </if>
      <if test="pzone != null">
        pzone = #{pzone,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </if>
      <if test="uid != null">
        `uid` = #{uid,jdbcType=INTEGER},
      </if>
      <if test="createdate != null">
        createDate = #{createdate,jdbcType=TIMESTAMP},
      </if>
      <if test="status != null">
        `status` = #{status,jdbcType=SMALLINT},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.qfjy.entity.po.Meetingpub">
    update meetingpub
    set pcode = #{pcode,jdbcType=VARCHAR},
      ptime = #{ptime,jdbcType=VARCHAR},
      tid = #{tid,jdbcType=INTEGER},
      ptitle = #{ptitle,jdbcType=VARCHAR},
      pzone = #{pzone,jdbcType=VARCHAR},
      remark = #{remark,jdbcType=VARCHAR},
      `uid` = #{uid,jdbcType=INTEGER},
      createDate = #{createdate,jdbcType=TIMESTAMP},
      `status` = #{status,jdbcType=SMALLINT}
    where id = #{id,jdbcType=VARCHAR}
  </update>
</mapper>

在这里插入图片描述
在这里插入图片描述



这篇关于微信小程序--嘟嘟会议--会议发布和我的会议查看的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程