a.id AS "id",
a.dog_id AS "dogId",
a.show_code AS "showCode",
a.referee AS "referee",
a.pedigree_certified AS "pedigreeCertified",
a.other_certified AS "otherCertified",
a.race_lap AS "raceLap",
a.dog_breed_group AS "dogBreedGroup",
a.age_group AS "ageGroup",
a.dog_gender AS "dogGender",
a.fci_code AS "fciCode",
a.dog_owner_name_cn AS "dogOwnerNameCn",
a.dog_owner_name_en AS "dogOwnerNameEn",
a.dog_owner_member_code AS "dogOwnerMemberCode",
a.show_result AS "showResult",
a.show_breed_result AS "showBreedResult",
a.order_code AS "orderCode",
a.appraisal AS "appraisal",
a.result_cc AS "resultCc",
a.remarks_cc AS "remarksCc",
a.result_bob AS "resultBob",
a.result_bow AS "resultBow",
a.result_wb AS "resultWb",
a.result_biss AS "resultBiss",
a.rankings AS "rankings",
a.formatcode AS "formatcode",
a.create_by AS "createBy.id",
a.create_date AS "createDate",
a.update_by AS "updateBy.id",
a.update_date AS "updateDate",
a.remarks AS "remarks",
a.year AS "year",
a.del_flag AS "delFlag"
INSERT INTO show_results_bov(
id,
dog_id,
show_code,
year,
referee,
pedigree_certified,
other_certified,
race_lap,
dog_breed_group,
age_group,
dog_gender,
fci_code,
dog_owner_name_cn,
dog_owner_name_en,
dog_owner_member_code,
show_result,
order_code,
appraisal,
result_cc,
remarks_cc,
result_bob,
result_bow,
result_wb,
result_biss,
rankings,
formatcode,
create_by,
create_date,
update_by,
update_date,
remarks,
del_flag
) VALUES (
#{id},
#{dogId},
#{showCode},
#{year},
#{referee},
#{pedigreeCertified},
#{otherCertified},
#{raceLap},
#{dogBreedGroup},
#{ageGroup},
#{dogGender},
#{fciCode},
#{dogOwnerNameCn},
#{dogOwnerNameEn},
#{dogOwnerMemberCode},
#{showResult},
#{orderCode},
#{appraisal},
#{resultCc},
#{remarksCc},
#{resultBob},
#{resultBow},
#{resultWb},
#{resultBiss},
#{rankings},
#{formatcode},
#{createBy.id},
#{createDate},
#{updateBy.id},
#{updateDate},
#{remarks},
#{delFlag}
)
UPDATE show_results_bov SET
dog_id = #{dogId},
show_code = #{showCode},
referee = #{referee},
pedigree_certified = #{pedigreeCertified},
other_certified = #{otherCertified},
race_lap = #{raceLap},
dog_breed_group = #{dogBreedGroup},
age_group = #{ageGroup},
dog_gender = #{dogGender},
fci_code = #{fciCode},
dog_owner_name_cn = #{dogOwnerNameCn},
dog_owner_name_en = #{dogOwnerNameEn},
dog_owner_member_code = #{dogOwnerMemberCode},
show_result = #{showResult},
show_breed_result = #{showBreedResult},
order_code = #{orderCode},
appraisal = #{appraisal},
result_cc = #{resultCc},
remarks_cc = #{remarksCc},
result_bob = #{resultBob},
result_bow = #{resultBow},
result_wb = #{resultWb},
result_biss = #{resultBiss},
rankings = #{rankings},
formatcode = #{formatcode},
update_by = #{updateBy.id},
update_date = #{updateDate},
remarks = #{remarks}
WHERE id = #{id}
UPDATE show_results_bov SET
remarks = concat(IFNULL(remarks,''),#{remarks}),
del_flag = #{DEL_FLAG_DELETE}
WHERE id = #{id}
UPDATE show_results_bov SET show_result = '0', show_breed_result = '0' WHERE show_code = #{_parameter} AND del_flag = '0'
UPDATE
show_results_bov tb
RIGHT JOIN
( SELECT
fci_code AS fcicode,
(COUNT(fci_code) - 1) AS classNum
FROM
show_results_bov
WHERE
show_code = #{_parameter}
AND age_group IN ('5','6','7','8','9','10','13','14','15','16','17','18')
AND del_flag = '0'
GROUP BY
fci_code
HAVING
COUNT(fci_code) - 1 > 0 ) ta
ON
tb.fci_code = ta.fcicode
SET
tb.show_breed_result = tb.show_breed_result + ta.classnum,
tb.show_result = tb.show_result + ta.classnum
WHERE
show_code = #{_parameter}
AND age_group IN ('12','13','14')
AND result_biss = 'BISS'
AND result_bob = 'BOV'
AND remarks_cc NOT LIKE '成绩取消%'
AND del_flag = '0'
UPDATE
show_results_bov tb
RIGHT JOIN
( SELECT
fci_code AS fcicode,
(COUNT(fci_code) - 1) AS classNum
FROM
show_results_bov
WHERE
show_code = #{_parameter}
AND age_group IN ('3','4','5','6','7','8','9','10','13','14','15','16','17','18')
AND del_flag = '0'
GROUP BY
fci_code
HAVING
COUNT(fci_code) - 1 > 0 ) ta
ON
tb.fci_code = ta.fcicode
SET
tb.show_breed_result = tb.show_breed_result + ta.classnum,
tb.show_result = tb.show_result + ta.classnum
WHERE
show_code = #{_parameter}
AND age_group IN ('12','13','14')
AND result_biss = 'BISS'
AND (result_bob is null OR result_bob != 'BOV')
AND remarks_cc NOT LIKE '成绩取消%'
AND del_flag = '0'
UPDATE
show_results_bov tb
RIGHT JOIN
( SELECT
fci_code AS fcicode,
(COUNT(fci_code) - 1) AS classNum
FROM
show_results_bov
WHERE
show_code = #{_parameter}
AND age_group IN ('5','6','7','8','9','10','13','14','15','16','17','18')
AND del_flag = '0'
GROUP BY
fci_code
HAVING
COUNT(fci_code) - 1 > 0 ) ta
ON
tb.fci_code = ta.fcicode
SET
tb.show_breed_result = tb.show_breed_result + ta.classnum,
tb.show_result = tb.show_result + ta.classnum
WHERE
show_code = #{_parameter}
AND age_group IN ('5','6','7','8','9','10','13','14','15','16','17','18')
AND result_bob = 'BOB'
AND remarks_cc NOT LIKE '成绩取消%'
AND del_flag = '0'
UPDATE
show_results_bov tb
RIGHT JOIN
( SELECT
fci_code AS fci_code,
(COUNT(fci_code) - 1) AS classNum
FROM
show_results_bov
WHERE
show_code = #{_parameter}
AND age_group IN ('5','6','7','8','9','10','13','14','15','16','17','18')
AND del_flag = '0'
GROUP BY
fci_code
HAVING
COUNT(fci_code) - 1 > 0 ) ta
ON
tb.fci_code = ta.fci_code
SET
tb.show_breed_result = tb.show_breed_result + ta.classnum,
tb.show_result = tb.show_result + ta.classnum
WHERE
show_code = #{_parameter}
AND age_group IN ('12','13','14')
AND result_bob = 'BOV'
AND result_biss != 'BISS'
AND remarks_cc NOT LIKE '成绩取消%'
AND del_flag = '0'
UPDATE
show_results_bov t1
LEFT JOIN
( SELECT
a.id,
( SELECT
COUNT(*)-1
FROM
show_results_bov
WHERE
show_code = a.show_code
AND dog_breed_group = a.dog_breed_group
AND age_group IN ('5','6','7','8','9','10','13','14','15','16','17','18')
AND del_flag = '0'
AND fci_code NOT IN
( SELECT
fci_code
FROM
show_results_bov
WHERE
show_code=a.show_code
AND result_big IS NOT NULL
AND result_big!=''
AND result_big a.result_big
AND dog_breed_group = a.dog_breed_group) ) AS 'show_result_js'
FROM
show_results_bov a
WHERE
del_flag = '0'
AND age_group IN ('5','6','7','8','9','10','13','14','15','16','17','18')
AND a.show_code = #{_parameter}
AND a.result_big LIKE 'BIG%' )t2
ON
t1.id=t2.id
SET
t1.show_result = t2.show_result_js
WHERE
t1.del_flag = '0'
AND t1.age_group IN ('5','6','7','8','9','10','13','14','15','16','17','18')
AND t1.show_code = #{_parameter}
AND t1.result_big LIKE 'BIG%'
AND t1.remarks_cc NOT LIKE '成绩取消%'
UPDATE
show_results_bov tb
RIGHT JOIN
( SELECT
fci_code AS fcicode,
(COUNT(fci_code) - 1) AS classNum
FROM
show_results_bov
WHERE
show_code = #{showCode}
AND age_group IN ('1','2')
AND age_group IN ('3','4')
AND del_flag = '0'
GROUP BY
fci_code
HAVING
COUNT(fci_code) - 1 > 0) ta
ON
tb.fci_code = ta.fcicode
SET
tb.show_result = ta.classnum
WHERE
show_code = #{showCode}
AND age_group IN ('1','2')
AND age_group IN ('3','4')
AND result_bob = #{resultBob}
AND remarks_cc NOT LIKE '成绩取消%'
AND del_flag = '0'