New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to excute a sql with diesel like the following? #1778

Closed
sunlightboy opened this Issue Jul 6, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@sunlightboy

sunlightboy commented Jul 6, 2018

Setup

Versions

Feature Flags

  • diesel:

Problem Description

UPDATE `t_employee_config` 
SET `c_annual_add_total` = (
CASE
	`c_employee_id` 
	WHEN '769ee022be6b4d61bd9d8428bc0293cf' THEN
	'20.00' 
	WHEN '1a73827cc08f49bf99ee0203df299b89' THEN
	'21.00' 
	WHEN '3d8a244e04b140c6a4a0e42df6386c40' THEN
	'22.00' 
	WHEN '50bfbd7da06d4d38aab9abd711e6fd23' THEN
	'23.00' 
	WHEN 'd53c22e16a7c498b9bd7e99d0c9dc97a' THEN
	'24.00' ELSE `c_annual_add_total` 
END 
	),
	`c_annual_reduce_total` = (
CASE
	`c_employee_id` 
	'14.00' 
	WHEN '3d8a244e04b140c6a4a0e42df6386c40' THEN
	'15.00' 
	WHEN '50bfbd7da06d4d38aab9abd711e6fd23' THEN
	'16.00' 
	WHEN 'd53c22e16a7c498b9bd7e99d0c9dc97a' THEN
	'3.00' ELSE `c_annual_reduce_total` 
END 
	),
	`c_annual_left` = (
CASE
	`c_employee_id` 
	'7.00' 
	WHEN '1a73827cc08f49bf99ee0203df299b89' THEN
	'7.00' 
	WHEN '3d8a244e04b140c6a4a0e42df6386c40' THEN
	'7.00' 
	WHEN '50bfbd7da06d4d38aab9abd711e6fd23' THEN
	'7.00' 
	WHEN 'd53c22e16a7c498b9bd7e99d0c9dc97a' THEN
	'21.00' ELSE `c_annual_left` 
END 
	) 
WHERE
	`c_employee_id` IN (
	'029ee6cfc83f4c9694a92d51efbe1e7f',
	'30fc03f500d84c4fbd5f676fecf5714f',
	'53a8500dc3dd4101ae62111c10b882c5',
	'63f993c0a7544c608e2aa1b39bdcc716',
	)

@sgrif

This comment has been minimized.

Member

sgrif commented Jul 11, 2018

@sgrif sgrif closed this Jul 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment