SELECT distinct ${column} FROM ${table}
where ${column} is not null and ${column} !=''
and level=#{level}
and parent=#{parent}
select
b.index_name as mc,
count(*) as total
from ${table1} a left join ${table2} b
on a.${column1} = b.code_index
where b.dic_code = #{column1}
group by ${column1}
SELECT * FROM ${table} where ${column}=#{columnValue}
UPDATE ${table} set sfsh=#{sfsh} where id=#{id}
SELECT count(1) FROM ${table}
where 1=1
and ${column} >= #{remindstart}
and ${column} <= #{remindend}
and ${column} >= str_to_date(#{remindstart},'%Y-%m-%d')
and ${column} <= str_to_date(#{remindend},'%Y-%m-%d')
SELECT sum(${column}) sum,max(${column}) max,min(${column}) min,avg(${column}) avg FROM ${table}
SELECT ${column} , count(1) total FROM ${table} group by ${column}
SELECT ${xColumn}, sum(${yColumn}) total FROM ${table} group by ${xColumn}
select
d.index_name as name,
a.${groupColumn} as groupColumn, -- 这一列页面无用,用于排查问题
sum(a.${sumColumn}) as value
from ${tableName} a
LEFT JOIN dictionary d ON a.${groupColumn}=d.code_index where d.dic_code= #{groupColumn}
GROUP BY a.${groupColumn}
SELECT
avg(a.${average}) as value
FROM
${tableName} a
WHERE
a.${condition1} = #{condition1Value}
select
d.index_name as name,
a.${groupColumn} as groupColumn, -- 这一列页面无用,用于排查问题
count(*) as value
from ${tableName} a
LEFT JOIN dictionary d ON a.${groupColumn}=d.code_index where d.dic_code= #{groupColumn}
GROUP BY a.${groupColumn}
--
select
date_format(${groupColumn}, #{dateFormat}) as name,
sum(${sumColumn}) as value
from ${tableName}
group by date_format(${groupColumn}, #{dateFormat});
select
date_format(${groupColumn}, #{dateFormat}) as name,
count(*) as value
from ${tableName}
group by date_format(${groupColumn}, #{dateFormat});
update ${tableName}
set #{column} = #{column}+#{number}
where
id = #{id}
update ${tableName}
set #{column} = #{column}-#{number}
where
id = #{id}
update ${tableName}
set #{column} = #{value}
where
id = #{id}
select
date_format(thisTableName.${item}, '%Y-%m') as thisDate${index}
date_format(joinTableName.${item}, '%Y-%m') as joinDate${index}
thisTableName.${item} as thisString${index}
joinTableName.${item} as joinString${index}
${item}.index_name as thisTypes${index}
${item}.index_name as joinTypes${index}
sum(thisTableName.${thisTable.sumColum}) as value
from ${thisTable.tableName} thisTableName
LEFT JOIN ${joinTable.tableName} joinTableName on thisTableName.${joinTable.tableName}_id = joinTableName.id
LEFT JOIN dictionary ${item} ON thisTableName.${item}=${item}.code_index
WHERE ${item}.dic_code= #{item}
AND date_format(thisTableName.insert_time, #{dateFormat}) = #{riqi}
LEFT JOIN dictionary ${item} ON joinTableName.${item}=${item}.code_index
WHERE ${item}.dic_code= #{item}
AND date_format(thisTableName.insert_time, #{dateFormat}) = #{riqi}
WHERE date_format(thisTableName.insert_time, #{dateFormat}) = #{riqi}
GROUP BY
date_format(thisTableName.${item}, '%Y-%m')
,
date_format(joinTableName.${item}, '%Y-%m')
,
thisTableName.${item}
,
joinTableName.${item}
,
thisTableName.${item}
,
joinTableName.${item}
ORDER BY value DESC
select
date_format(thisTableName.${item}, '%Y-%m') as thisDate${index}
date_format(joinTableName.${item}, '%Y-%m') as joinDate${index}
thisTableName.${item} as thisString${index}
joinTableName.${item} as joinString${index}
${item}.index_name as thisTypes${index}
${item}.index_name as joinTypes${index}
count(*) as value
from ${thisTable.tableName} thisTableName
LEFT JOIN ${joinTable.tableName} joinTableName on thisTableName.${joinTable.tableName}_id = joinTableName.id
LEFT JOIN dictionary ${item} ON thisTableName.${item}=${item}.code_index
WHERE ${item}.dic_code= #{item}
AND date_format(thisTableName.insert_time, #{dateFormat}) = #{riqi}
LEFT JOIN dictionary ${item} ON joinTableName.${item}=${item}.code_index
WHERE ${item}.dic_code= #{item}
AND date_format(thisTableName.insert_time, #{dateFormat}) = #{riqi}
WHERE date_format(thisTableName.insert_time, #{dateFormat}) = #{riqi}
GROUP BY
date_format(thisTableName.${item}, '%Y-%m')
,
date_format(joinTableName.${item}, '%Y-%m')
,
thisTableName.${item}
,
joinTableName.${item}
,
thisTableName.${item}
,
joinTableName.${item}
ORDER BY value DESC