项目涉及技能点二

1.模糊查询:

SELECT proj_id,emp_id,emp_name,schedule_date,briefing,proj_name,task_name,work_hours FROM
			 (SELECT a.proj_id,
			 a.emp_id,
			 (SELECT b.emp_name from emp_info b where a.emp_id = b.emp_id) emp_name,
			 a.schedule_date,
			 a.briefing,
			 (SELECT c.proj_name from proj_info c WHERE a.proj_id = c.proj_id) proj_name,
			 (SELECT d.task_name from proj_task d where a.task_id = d.task_id) task_name,
			 (SELECT SUM(e.work_hours) from emp_schedule e GROUP BY e.emp_id) work_hours
        from emp_schedule a GROUP BY a.emp_id) t
		<where>
			<if test="fuzzy !=null and fuzzy!=''">
				t.emp_name LIKE concat(concat('%',#{fuzzy}),'%') or t.proj_name LIKE concat(concat('%',#{fuzzy}),'%') or t.task_name LIKE concat(concat('%',#{fuzzy}),'%') or
				t.work_hours LIKE concat(concat('%',#{fuzzy}),'%') or t.schedule_date LIKE concat(concat('%',#{fuzzy}),'%') or t.briefing LIKE concat(concat('%',#{fuzzy}),'%')
			</if>
			<if test="projName !=null and projName!=''">
				t.proj_name = #{projName}
			</if>
		</where>

2.String转List

String idlist = "123,234,435,121,126"
List <String> idsList= Arrays.asList(idlist .split(","));
        idsList.stream().forEach(
                ids -> {
                    custQuestionRecordDto.setRecordId(ids);
                    int result = custQuestionRecordDao.reDistribution(custQuestionRecordDto);
                    if (result <= 0) {
                        throw new ServiceException("99", "内部异常");
                    }
                }
        );

3.map.toString() 和 JSONObject.toJSONString( map )区别:

Map<String, Integer> map = new HashMap<>();
map.put( "a", 1 );
map.put( "b", 2 );

System.out.println( map.toString() );    // 结果是 {a=1, b=2}   

// JSONObject 是 com.alibaba.fastjson.JSONObject
System.out.println( JSONObject.toJSONString( map ) );    // 结果是 {"a":1,"b":2}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

菜鸟驿站ㅤ

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值