今天学习四块技术内容
- 批量删除功能
- 修改功能->回显和修改
- 高级异常
批量删除功能
获取配置文件的值,第二种方式遇到的问题
原因:看报错问题不要慌,看最后一行的问题,点到问题行发现对应注解的变量没写进方法里面,所以获取不到值。放进方法中即可获取到值
修改员工信息功能
1.修改信息时的信息回显功能
第一步:涉及到两张表 emp emp_expr,先设计sql把两张表关联起来一起查询
第二步:两张表的sql关联语句拿到了,接下来将sql语句放入mapper层使数据库中的数据映射到实体类中,配置mapper.xml
其中需要注意两个属性★★★
1.id值为service层传过来的id
2.要接收一个集合,此处不再用resultType而是用resultMap
(1)resultMap集合标签中的 id为自己指定的集合名字 type为修改信息映射的实体类表
(2)主键id属性column是字段,property属性是实体类表的成员变量,一一对应
(3)主键id较为特殊用<id>
,其余全用<result>
(4)EmpExpr是封装成集合放在Emp中一起回显,所以要特殊处理
mapper.xml总结:
两表关联的sql语句不要写错
mapper.xml中的标签记住★★★
第三步:就是三层架构的东西了:
其中需要记住的是->Controller层请求时的路径/{id}和路径参数@PathVariable★★★
中间遇到的问题
高级异常:
俩注解@RestControllerAdvice 和 @ExceptionHandler
1.case流程控制语句语法:
语法一 -> case when cond1 then res1[when cond2 then res2]else res end
如:
SELECT case when job=1 then '班主任' when job=2 then '讲师' when job=3 then '学工主管' when job=4 then '教研主管' when job=5 then '咨询师' ELSE '其他' END job ,COUNT(*) nums FROM emp GROUP BY emp.job ORDER BY nums desc;
语法二(适用于等值匹配) -> case expr when val1 then res1 [when val2 then res2] else res end ;
如:
SELECT case job when 1 then '班主任' when 2 then '讲师' when 3 then '学工主管' when 4 then '教研主管' when 5 then '咨询师' ELSE '其他' END job ,COUNT(*) nums FROM emp GROUP BY emp.job ORDER BY nums desc;
2.当有性别这种的时候直接用 if函数比case流程控制函数更简单
如:
ELECT if(gender=1,'男','女') gender, COUNT(*) nums FROM emp GROUP BY emp.gender;
推荐阅读:
文章有(3)条网友点评
Для лучшей эффективности требуется свежие базы для хрумера <a href=https://www.olx.ua/d/uk/obyavlenie/progon-hrumerom-dr-50-po-ahrefs-uvelichu-reyting-domena-IDXnHrG.html>https://www.olx.ua/d/uk/obyavlenie/progon-hrumerom-dr-50-po-ahrefs-uvelichu-reyting-domena-IDXnHrG.html</a>, обновляемые регулярно.
大模型处理异常,请稍后再试,错误信息:{"refresh_token":"25.36d9a91ac21870ed2f7581a49a2a29e1.315360000.2072640933.282335-119037978","expires_in":2592000,"session_key":"9mzdDZfB9BBdYWHCtkz+mYVA8gic9mQCi6EEvoOjBabtqfim1R4ShQiU3W3j2MS\/eJV4P5Bc5xcVJcWZL21tTFSMAVuEprk=","access_token":"24.6a62c7fb61375e23ea7ad07028a77a3e.2592000.1759872933.282335-119037978","scope":"public ai_custom_qianfan_bloomz_7b_compressed ai_custom_yiyan_com ai_custom_yiyan_com_128k ai_custom_yiyan_com_agent_speed_32k ai_custom_yiyan_com_aquilachat_7b ai_custom_yiyan_com_bce_reranker_base ai_custom_yiyan_com_bloomz7b1 ai_custom_yiyan_com_chatglm2_6b_32k ai_custom_yiyan_com_codellama_7b_ins ai_custom_yiyan_com_eb_pro ai_custom_yiyan_com_eb_turbo_pro ai_custom_yiyan_com_eb_turbo_pro_128k ai_custom_yiyan_com_emb_bge_large_en ai_custom_yiyan_com_emb_bge_large_zh ai_custom_yiyan_com_emb_tao_8k ai_custom_yiyan_com_emb_text ai_custom_yiyan_com_ernie_3.5_128k_preview ai_custom_yiyan_com_ernie_3.5_8k_0701 ai_custom_yiyan_com_ernie_35_8k_0613 ai_custom_yiyan_com_ernie_35_8k_preview ai_custom_yiyan_com_ernie_4.0_turbo_128k ai_custom_yiyan_com_ernie_4.0_turbo_8k_0628 ai_custom_yiyan_com_ernie_4.0_turbo_8k_latest ai_custom_yiyan_com_ernie_40_8k_0613 ai_custom_yiyan_com_ernie_40_8k_beta ai_custom_yiyan_com_ernie_40_8k_preview ai_custom_yiyan_com_ernie_40_turbo_8k(2) ai_custom_yiyan_com_ernie_40_turbo_8k_preview ai_custom_yiyan_com_ernie_char_8k ai_custom_yiyan_com_ernie_char_fiction_8k ai_custom_yiyan_com_ernie_func_8k ai_custom_yiyan_com_ernie_lite_8k ai_custom_yiyan_com_ernie_lite_pro_128k ai_custom_yiyan_com_ernie_novel_8k ai_custom_yiyan_com_ernie_speed_pro_128k ai_custom_yiyan_com_ernie_tiny_8k ai_custom_yiyan_com_fiction_8k_preview ai_custom_yiyan_com_fuyu_8b ai_custom_yiyan_com_gemma_7b_it ai_custom_yiyan_com_llama2_13b ai_custom_yiyan_com_llama2_70b ai_custom_yiyan_com_llama2_7b ai_custom_yiyan_com_llama3_70b ai_custom_yiyan_com_llama3_8b ai_custom_yiyan_com_mixtral_8x7b ai_custom_yiyan_com_qf_chinese_llama_2_13b ai_custom_yiyan_com_qf_chinese_llama_2_70b ai_custom_yiyan_com_qianfan_agent_lite_8k ai_custom_yiyan_com_qianfan_agent_speed_8k ai_custom_yiyan_com_qianfan_chinese_llama_2_7b ai_custom_yiyan_com_qianfan_dynamic_8k ai_custom_yiyan_com_sd_xl ai_custom_yiyan_com_sqlcoder_7b ai_custom_yiyan_com_tokenizer_eb ai_custom_yiyan_com_xuanyuan_70b_chat ai_custom_yiyan_com_yi_34b brain_all_scope wise_adapt lebo_resource_base lightservice_public hetu_basic lightcms_map_poi kaidian_kaidian ApsMisTest_Test\u6743\u9650 vis-classify_flower lpq_\u5f00\u653e cop_helloScope ApsMis_fangdi_permission smartapp_snsapi_base smartapp_mapp_dev_manage iop_autocar oauth_tp_app smartapp_smart_game_openapi oauth_sessionkey smartapp_swanid_verify smartapp_opensource_openapi smartapp_opensource_recapi fake_face_detect_\u5f00\u653eScope vis-ocr_\u865a\u62df\u4eba\u7269\u52a9\u7406 idl-video_\u865a\u62df\u4eba\u7269\u52a9\u7406 smartapp_component smartapp_search_plugin avatar_video_test b2b_tp_openapi b2b_tp_openapi_online smartapp_gov_aladin_to_xcx","session_secret":"a212d3bfe84004bfb2c47bfa6f4a6bc3"}
Hey there!
Welcome to Moviezhive.com, where blockbuster entertainment is just a click away!
Stream a vast collection of Bollywood, Hollywood, and international movies for free—no subscriptions, no hassles.
What Makes Us Special?
✔️ Thousands of movies across all genres
✔️ Zero pop-up ads for seamless viewing
✔️ Advanced zero-buffering tech for smooth playback
✔️ Fresh titles added regularly
Can’t find a movie? Request it, and we’ll upload it fast!
Watch anytime, anywhere. Visit https://moviezhive.com now and start your movie adventure!
Enjoy the Show,
The Moviezhive Team