发表于: 2019-11-25 23:27:39
1 1386
今天完成的事情:
哦呵呵,终于遇到PM改需求了,嗯,也不算改吧,人人都是产品经理不是,提了点建议,然后PM采纳了,笑!
原来的评论,PM把他分开管理了。。现在合在一个页面管理了,少就是好啊!
原来的
现在的
三合一耶!
嗯,剩下的又增加了点搜索条件。这里很重要,我之前在多表查询的时候,用的是toString+toString的方式显示查询出来的数据。后面有多个实体类这么做了以后。要查询的数据里面不一定要其他的。就出现了空指针。。嗯,说着听不懂哦。
这样的
return sb.toString()+user.toString();
但是呢
user那边还有其他的toString,这个时候,我又不需要多出来的那个,就没new出那个对象,显示的时候就报空指针了。不管了,不重要,反正要用的时候,加到toString里,而不是靠+ 网上看别的学院的教程这么做,坑爹!
关联了管理员帐户
private Account account;
sb.append(", account=").append(account);
剩下的就是改代码。
接着另一个更坑的地方
代码写完了,测试也过了,部署后,就是报空指针,转成json不能成功。看来看去都没错。
Could not write JSON: (was java.lang.NullPointerException); nested exception is com.fasterxml.jackson.databind.JsonMappingException: (was java.lang.NullPointerException) (through reference chain: java.util.HashMap[\"data\"]->java.util.ArrayList[0]->com.happynewyear.admin.pojo.Comment[\"user\"]->com.happynewyear.admin.pojo.User[\"userState\"])",
按照这个去看这个属性,也看不出有什么问题。。。不就是个属性吗,测试了以后,返回是null啊。也没什么特别啊。
最后面问了下写这个类的组员,他说他把这个属性的类型改了,前面是基本类型改成包装类了。然后我更新了下代码,很好,可以了。我吐血哦!!非战之罪!
现在的留言查询,长的可真好看。。好像好麻烦啊。
<!--列表查询留言表的留言与对应的学习对象与用户信息-->
<select id="selectSelective" parameterType="com.happynewyear.admin.pojo.Comment" resultMap="BaseResultMap">
SELECT
u.user_id,u.user_name,u.user_img,u.user_class,u.user_tel,u.user_mail,
c.id,c.content,c.star,c.create_at,c.like_count,c.create_by,
o.id as oid,o.type,o.course,o.title,o.grade
FROM
`comment` as c ,
`user` as u ,
study_object as o
<trim prefix="WHERE" prefixOverrides="AND|OR ">
c.create_by = u.user_id
and c.study_object_id=o.id
<if test="id!=null">and c.id=#{id}</if>
<if test="startTime != null and endTime != null ">and c.create_at between #{startTime} and #{endTime}</if>
<if test="studyObject !=null">
<if test="studyObject.title != null and studyObject.title !=''">and o.title LIKE CONCAT('%',#{studyObject.title},'%')</if>
<if test="studyObject.type!=null">and o.type=#{studyObject.type}</if>
<if test="studyObject.grade!=null">and o.grade=#{studyObject.grade}</if>
</if>
<if test="user != null ">
<if test="user.userName != null and user.userName !=''">and u.user_name LIKE CONCAT('%',#{user.userName},'%')</if>
<if test="user.userClass != null and user.userClass !=0">and u.user_class= #{user.userClass}</if>
</if>
</trim>
</select>
有人问到小程序,很简单的点餐外卖功能,师姐说可能要上万,对方在网站上去问过其他公司,也要上万。我一度怀疑人生,不就是一个点餐外卖小程序吗,这就上万了。
回来淘宝了一下。很好,居然有两种,一种是做好给你用,初始600,后期一年200!!一年200!
另一种模板给你,你自己改。400。
一边是1万,一边是400。。软件就是有这个好处。做出了一个以后,后期的拿过来用就行了。成本主要是第一个那里。
然后又看到微信他自己有云开发模式,不用服务器,不用维护。只要写前端代码就好了。我去。用的是mongoDB数据库
明天计划的事情:
看看mongoDB
遇到的问题:
代码测试前,上传前,都要更新下最新代码,你永远不知道这期间其他人做了什么。
收获:
评论