Commit 2caf2fc6 authored by 赵建伟's avatar 赵建伟

add sql format codes

parent b3efe042
...@@ -9,6 +9,10 @@ public class Constants { ...@@ -9,6 +9,10 @@ public class Constants {
public static final String CHECK_UNBLANK = "unblank_check"; public static final String CHECK_UNBLANK = "unblank_check";
// 参照性校验 // 参照性校验
public static final String CHECK_REFER = "refer_check"; public static final String CHECK_REFER = "refer_check";
// 波动性校验
public static final String CHECK_VOLATILITY = "volatility_check";
// 特殊性校验
public static final String CHECK_SPECIAL = "special_check";
// ***************监控指标类型****************** // ***************监控指标类型******************
// 波动性监控-PV // 波动性监控-PV
......
...@@ -23,7 +23,7 @@ public class RuleTemplateController { ...@@ -23,7 +23,7 @@ public class RuleTemplateController {
@ResponseBody @ResponseBody
@RequestMapping(value = "/find", method = RequestMethod.POST) @RequestMapping(value = "/find", method = RequestMethod.POST)
public RuleTemplateVo findRuleTmpls(@RequestBody RuleTemplateVo ruleTemplateVo) { public RuleTemplateVo findRuleTmpls(@RequestBody RuleTemplateVo ruleTemplateVo) {
List<RuleTemplateDto> findRuleTmpls = ruleTemplateService.findRuleTmpls(ruleTemplateVo.getType()); List<RuleTemplateDto> findRuleTmpls = ruleTemplateService.findRuleTmpls(ruleTemplateVo.getCheckType());
return new RuleTemplateVo(findRuleTmpls); return new RuleTemplateVo(findRuleTmpls);
} }
......
...@@ -3,12 +3,12 @@ package com.gmei.data.dqmp.domain; ...@@ -3,12 +3,12 @@ package com.gmei.data.dqmp.domain;
public class TblRuleTemplate { public class TblRuleTemplate {
private Integer id; private Integer id;
private String type; private String checkType;
private String content;
private String comment; private String comment;
private String tpltContent;
public Integer getId() { public Integer getId() {
return id; return id;
} }
...@@ -17,20 +17,12 @@ public class TblRuleTemplate { ...@@ -17,20 +17,12 @@ public class TblRuleTemplate {
this.id = id; this.id = id;
} }
public String getType() { public String getCheckType() {
return type; return checkType;
}
public void setType(String type) {
this.type = type == null ? null : type.trim();
}
public String getContent() {
return content;
} }
public void setContent(String content) { public void setCheckType(String checkType) {
this.content = content == null ? null : content.trim(); this.checkType = checkType == null ? null : checkType.trim();
} }
public String getComment() { public String getComment() {
...@@ -40,4 +32,12 @@ public class TblRuleTemplate { ...@@ -40,4 +32,12 @@ public class TblRuleTemplate {
public void setComment(String comment) { public void setComment(String comment) {
this.comment = comment == null ? null : comment.trim(); this.comment = comment == null ? null : comment.trim();
} }
public String getTpltContent() {
return tpltContent;
}
public void setTpltContent(String tpltContent) {
this.tpltContent = tpltContent == null ? null : tpltContent.trim();
}
} }
\ No newline at end of file
...@@ -164,143 +164,73 @@ public class TblRuleTemplateCriteria { ...@@ -164,143 +164,73 @@ public class TblRuleTemplateCriteria {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andTypeIsNull() { public Criteria andCheckTypeIsNull() {
addCriterion("type is null"); addCriterion("check_type is null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andTypeIsNotNull() { public Criteria andCheckTypeIsNotNull() {
addCriterion("type is not null"); addCriterion("check_type is not null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andTypeEqualTo(String value) { public Criteria andCheckTypeEqualTo(String value) {
addCriterion("type =", value, "type"); addCriterion("check_type =", value, "checkType");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andTypeNotEqualTo(String value) { public Criteria andCheckTypeNotEqualTo(String value) {
addCriterion("type <>", value, "type"); addCriterion("check_type <>", value, "checkType");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andTypeGreaterThan(String value) { public Criteria andCheckTypeGreaterThan(String value) {
addCriterion("type >", value, "type"); addCriterion("check_type >", value, "checkType");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andTypeGreaterThanOrEqualTo(String value) { public Criteria andCheckTypeGreaterThanOrEqualTo(String value) {
addCriterion("type >=", value, "type"); addCriterion("check_type >=", value, "checkType");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andTypeLessThan(String value) { public Criteria andCheckTypeLessThan(String value) {
addCriterion("type <", value, "type"); addCriterion("check_type <", value, "checkType");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andTypeLessThanOrEqualTo(String value) { public Criteria andCheckTypeLessThanOrEqualTo(String value) {
addCriterion("type <=", value, "type"); addCriterion("check_type <=", value, "checkType");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andTypeLike(String value) { public Criteria andCheckTypeLike(String value) {
addCriterion("type like", value, "type"); addCriterion("check_type like", value, "checkType");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andTypeNotLike(String value) { public Criteria andCheckTypeNotLike(String value) {
addCriterion("type not like", value, "type"); addCriterion("check_type not like", value, "checkType");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andTypeIn(List<String> values) { public Criteria andCheckTypeIn(List<String> values) {
addCriterion("type in", values, "type"); addCriterion("check_type in", values, "checkType");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andTypeNotIn(List<String> values) { public Criteria andCheckTypeNotIn(List<String> values) {
addCriterion("type not in", values, "type"); addCriterion("check_type not in", values, "checkType");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andTypeBetween(String value1, String value2) { public Criteria andCheckTypeBetween(String value1, String value2) {
addCriterion("type between", value1, value2, "type"); addCriterion("check_type between", value1, value2, "checkType");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andTypeNotBetween(String value1, String value2) { public Criteria andCheckTypeNotBetween(String value1, String value2) {
addCriterion("type not between", value1, value2, "type"); addCriterion("check_type not between", value1, value2, "checkType");
return (Criteria) this;
}
public Criteria andContentIsNull() {
addCriterion("content is null");
return (Criteria) this;
}
public Criteria andContentIsNotNull() {
addCriterion("content is not null");
return (Criteria) this;
}
public Criteria andContentEqualTo(String value) {
addCriterion("content =", value, "content");
return (Criteria) this;
}
public Criteria andContentNotEqualTo(String value) {
addCriterion("content <>", value, "content");
return (Criteria) this;
}
public Criteria andContentGreaterThan(String value) {
addCriterion("content >", value, "content");
return (Criteria) this;
}
public Criteria andContentGreaterThanOrEqualTo(String value) {
addCriterion("content >=", value, "content");
return (Criteria) this;
}
public Criteria andContentLessThan(String value) {
addCriterion("content <", value, "content");
return (Criteria) this;
}
public Criteria andContentLessThanOrEqualTo(String value) {
addCriterion("content <=", value, "content");
return (Criteria) this;
}
public Criteria andContentLike(String value) {
addCriterion("content like", value, "content");
return (Criteria) this;
}
public Criteria andContentNotLike(String value) {
addCriterion("content not like", value, "content");
return (Criteria) this;
}
public Criteria andContentIn(List<String> values) {
addCriterion("content in", values, "content");
return (Criteria) this;
}
public Criteria andContentNotIn(List<String> values) {
addCriterion("content not in", values, "content");
return (Criteria) this;
}
public Criteria andContentBetween(String value1, String value2) {
addCriterion("content between", value1, value2, "content");
return (Criteria) this;
}
public Criteria andContentNotBetween(String value1, String value2) {
addCriterion("content not between", value1, value2, "content");
return (Criteria) this; return (Criteria) this;
} }
......
...@@ -4,9 +4,9 @@ public class RuleTemplateDto { ...@@ -4,9 +4,9 @@ public class RuleTemplateDto {
private Integer id; private Integer id;
private String type; private String checkType;
private String content; private String tpltContent;
private String comment; private String comment;
...@@ -18,27 +18,28 @@ public class RuleTemplateDto { ...@@ -18,27 +18,28 @@ public class RuleTemplateDto {
this.id = id; this.id = id;
} }
public String getType() { public String getCheckType() {
return type; return checkType;
} }
public void setType(String type) { public void setCheckType(String checkType) {
this.type = type == null ? null : type.trim(); this.checkType = checkType;
} }
public String getContent() { public String getTpltContent() {
return content; return tpltContent;
} }
public void setContent(String content) { public void setTpltContent(String tpltContent) {
this.content = content == null ? null : content.trim(); this.tpltContent = tpltContent;
} }
public String getComment() { public String getComment() {
return comment; return comment;
} }
public void setComment(String comment) {
this.comment = comment;
}
public void setComment(String comment) {
this.comment = comment == null ? null : comment.trim();
}
} }
...@@ -16,15 +16,21 @@ public interface TblRuleTemplateMapper { ...@@ -16,15 +16,21 @@ public interface TblRuleTemplateMapper {
int insertSelective(TblRuleTemplate record); int insertSelective(TblRuleTemplate record);
List<TblRuleTemplate> selectByExampleWithBLOBs(TblRuleTemplateCriteria example);
List<TblRuleTemplate> selectByExample(TblRuleTemplateCriteria example); List<TblRuleTemplate> selectByExample(TblRuleTemplateCriteria example);
TblRuleTemplate selectByPrimaryKey(Integer id); TblRuleTemplate selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") TblRuleTemplate record, @Param("example") TblRuleTemplateCriteria example); int updateByExampleSelective(@Param("record") TblRuleTemplate record, @Param("example") TblRuleTemplateCriteria example);
int updateByExampleWithBLOBs(@Param("record") TblRuleTemplate record, @Param("example") TblRuleTemplateCriteria example);
int updateByExample(@Param("record") TblRuleTemplate record, @Param("example") TblRuleTemplateCriteria example); int updateByExample(@Param("record") TblRuleTemplate record, @Param("example") TblRuleTemplateCriteria example);
int updateByPrimaryKeySelective(TblRuleTemplate record); int updateByPrimaryKeySelective(TblRuleTemplate record);
int updateByPrimaryKeyWithBLOBs(TblRuleTemplate record);
int updateByPrimaryKey(TblRuleTemplate record); int updateByPrimaryKey(TblRuleTemplate record);
} }
\ No newline at end of file
...@@ -7,7 +7,7 @@ import com.gmei.data.dqmp.vo.RuleTemplateVo; ...@@ -7,7 +7,7 @@ import com.gmei.data.dqmp.vo.RuleTemplateVo;
public interface RuleTemplateService { public interface RuleTemplateService {
List<RuleTemplateDto> findRuleTmpls(String tmplType); List<RuleTemplateDto> findRuleTmpls(String checkType);
Integer addRuleTmpl(RuleTemplateVo ruleTemplateVo); Integer addRuleTmpl(RuleTemplateVo ruleTemplateVo);
......
...@@ -25,23 +25,18 @@ public class FormatServiceImpl implements FormatService { ...@@ -25,23 +25,18 @@ public class FormatServiceImpl implements FormatService {
} }
public static void main(String[] args) { public static void main(String[] args) {
String removeNewlineSymbol = new FormatServiceImpl().removeNewlineSymbol("SELECT 'online' AS db_name,\n" + String removeNewlineSymbol = new FormatServiceImpl().removeNewlineSymbol("SELECT '$db_name' AS DB_NAME,\n" +
"\n" + " '$tb_name' AS TB_NAME,\n" +
" 'test' AS tb_name,\n" + " '$time_col_name' AS TIME_COL_NAME,\n" +
"\n" + " '$start_time' AS START_TIME,\n" +
" 'age' AS time_col_name,\n" + " '$end_time' AS END_TIME,\n" +
"\n" + " COUNT(*) AS COUNT_NUM,\n" +
" '23' AS start_time,\n" + " DATE_ADD(from_unixtime(unix_timestamp(), 'yyyy-MM-dd'), -1) AS PARTITION_DATE,\n" +
"\n" + " FROM_UNIXTIME(unix_timestamp(), 'yyyy-MM-dd HH:mm:ss') AS CREATE_TIME\n" +
" '66' AS end_time,\n" + " FROM $db_name.$tb_name\n" +
"\n" + " WHERE $time_col_name >= $start_time\n" +
" COUNT(*) as count_num,date_add(from_unixtime(unix_timestamp(),'yyyy-MM-dd'),-1) as partition_date,from_unixtime(unix_timestamp(),'yyyy-MM-dd HH:mm:ss') as create_time\n" + " AND $time_col_name < $end_time\n" +
"\n" + " $filters");
" FROM online.test\n" +
"\n" +
"WHERE name >=11\n" +
"\n" +
" AND name <=12");
System.out.println(removeNewlineSymbol); System.out.println(removeNewlineSymbol);
} }
} }
...@@ -22,10 +22,10 @@ public class RuleTemplateServiceImpl implements RuleTemplateService { ...@@ -22,10 +22,10 @@ public class RuleTemplateServiceImpl implements RuleTemplateService {
private TblRuleTemplateMapper tblRuleTemplateMapper; private TblRuleTemplateMapper tblRuleTemplateMapper;
@Override @Override
public List<RuleTemplateDto> findRuleTmpls(String tmplType) { public List<RuleTemplateDto> findRuleTmpls(String checkType) {
List<RuleTemplateDto> rsList = new ArrayList<>(); List<RuleTemplateDto> rsList = new ArrayList<>();
TblRuleTemplateCriteria tblDqRuleTemplateCriteria = new TblRuleTemplateCriteria(); TblRuleTemplateCriteria tblDqRuleTemplateCriteria = new TblRuleTemplateCriteria();
tblDqRuleTemplateCriteria.createCriteria().andTypeEqualTo(tmplType); tblDqRuleTemplateCriteria.createCriteria().andCheckTypeEqualTo(checkType);
List<TblRuleTemplate> list = tblRuleTemplateMapper.selectByExample(tblDqRuleTemplateCriteria); List<TblRuleTemplate> list = tblRuleTemplateMapper.selectByExample(tblDqRuleTemplateCriteria);
for(TblRuleTemplate tblDqRuleTemplate : list) { for(TblRuleTemplate tblDqRuleTemplate : list) {
rsList.add(BeanUtils.map(tblDqRuleTemplate, RuleTemplateDto.class)); rsList.add(BeanUtils.map(tblDqRuleTemplate, RuleTemplateDto.class));
......
...@@ -6,59 +6,47 @@ import com.gmei.data.dqmp.dto.RuleTemplateDto; ...@@ -6,59 +6,47 @@ import com.gmei.data.dqmp.dto.RuleTemplateDto;
public class RuleTemplateVo extends BaseVo{ public class RuleTemplateVo extends BaseVo{
private String type; private String checkType;
private String content; private String tpltContent;
private String comment; private String comment;
private List<RuleTemplateDto> ruleTemplates; private List<RuleTemplateDto> ruleTemplates;
public RuleTemplateVo() { public RuleTemplateVo() {
super(); super();
} }
public RuleTemplateVo(Integer status, String msg) { public RuleTemplateVo(Integer status,String msg) {
super(status,msg); super(status,msg);
} }
public RuleTemplateVo(String type) {
super();
this.type = type;
}
public RuleTemplateVo(String type, String content, String comment) { public RuleTemplateVo(List<RuleTemplateDto> ruleTemplates) {
super(); super();
this.type = type; this.ruleTemplates = ruleTemplates;
this.content = content;
this.comment = comment;
} }
public String getType() { public String getCheckType() {
return type; return checkType;
} }
public void setType(String type) { public void setCheckType(String checkType) {
this.type = type; this.checkType = checkType == null ? null : checkType.trim();
} }
public String getContent() {
return content;
}
public void setContent(String content) { public String getTpltContent() {
this.content = content; return tpltContent;
} }
public String getComment() { public void setTpltContent(String tpltContent) {
return comment; this.tpltContent = tpltContent == null ? null : tpltContent.trim();
} }
public void setComment(String comment) { public String getComment() {
this.comment = comment; return comment;
} }
public RuleTemplateVo(List<RuleTemplateDto> ruleTemplates) { public void setComment(String comment) {
super(); this.comment = comment == null ? null : comment.trim();
this.ruleTemplates = ruleTemplates; }
}
public List<RuleTemplateDto> getRuleTemplates() { public List<RuleTemplateDto> getRuleTemplates() {
return ruleTemplates; return ruleTemplates;
...@@ -67,5 +55,5 @@ public class RuleTemplateVo extends BaseVo{ ...@@ -67,5 +55,5 @@ public class RuleTemplateVo extends BaseVo{
public void setRuleTemplates(List<RuleTemplateDto> ruleTemplates) { public void setRuleTemplates(List<RuleTemplateDto> ruleTemplates) {
this.ruleTemplates = ruleTemplates; this.ruleTemplates = ruleTemplates;
} }
} }
...@@ -34,16 +34,19 @@ ...@@ -34,16 +34,19 @@
</javaClientGenerator> </javaClientGenerator>
<!-- 需要生成的数据库表 --> <!-- 需要生成的数据库表 -->
<!-- <table tableName="tbl_rule_template" domainObjectName="TblRuleTemplate"/> --> <!-- <table tableName="tbl_client_version_info" domainObjectName="TblClientVersionInfo"/> -->
<!-- <table tableName="tbl_check_single_sql" domainObjectName="TblCheckSingleSql"/> --> <!-- <table tableName="tbl_check_single_sql" domainObjectName="TblCheckSingleSql"/> -->
<!-- <table tableName="tbl_check_multiple_sql" domainObjectName="TblCheckMultipleSql"/> -->
<!-- <table tableName="tbl_monitor_volatility_sql" domainObjectName="TblMonitorVolatilitySql"/> -->
<!-- <table tableName="tbl_monitor_special_sql" domainObjectName="TblMonitorSpecialSql"/> -->
<!-- <table tableName="tbl_result_check_unique" domainObjectName="TblResultCheckUnique"/> --> <!-- <table tableName="tbl_result_check_unique" domainObjectName="TblResultCheckUnique"/> -->
<!-- <table tableName="tbl_result_check_unblank" domainObjectName="TblResultCheckUnblank"/> --> <!-- <table tableName="tbl_result_check_unblank" domainObjectName="TblResultCheckUnblank"/> -->
<!-- <table tableName="tbl_client_version_info" domainObjectName="TblClientVersionInfo"/> -->
<!-- <table tableName="tbl_result_check_refer" domainObjectName="TblResultCheckRefer"/> --> <!-- <table tableName="tbl_result_check_refer" domainObjectName="TblResultCheckRefer"/> -->
<!-- <table tableName="tbl_check_multiple_sql" domainObjectName="TblCheckMultipleSql"/> -->
<!-- <table tableName="tbl_monitor_volatility_sql" domainObjectName="TblMonitorVolatilitySql"/> -->
<!-- <table tableName="tbl_result_monitor_volatility" domainObjectName="TblResultMonitorVolatility"/> --> <!-- <table tableName="tbl_result_monitor_volatility" domainObjectName="TblResultMonitorVolatility"/> -->
<table tableName="tbl_monitor_special_sql" domainObjectName="TblMonitorSpecialSql"/> <!-- <table tableName="tbl_result_monitor_special" domainObjectName="TblResultMonitorSpecial"/> -->
<table tableName="tbl_result_monitor_special" domainObjectName="TblResultMonitorSpecial"/> <!-- <table tableName="tbl_indicator_operator_info" domainObjectName="TblIndicatorOperatorInfo"/> -->
<!-- <table tableName="tbl_rule_template" domainObjectName="TblRuleTemplate"/> -->
<table tableName="tbl_rule_simple_info" domainObjectName="TblRuleSimpleInfo"/>
<table tableName="tbl_rule_duplex_info" domainObjectName="TblRuleDuplexInfo"/>
</context> </context>
</generatorConfiguration> </generatorConfiguration>
...@@ -3,10 +3,12 @@ ...@@ -3,10 +3,12 @@
<mapper namespace="com.gmei.data.dqmp.mapper.TblRuleTemplateMapper" > <mapper namespace="com.gmei.data.dqmp.mapper.TblRuleTemplateMapper" >
<resultMap id="BaseResultMap" type="com.gmei.data.dqmp.domain.TblRuleTemplate" > <resultMap id="BaseResultMap" type="com.gmei.data.dqmp.domain.TblRuleTemplate" >
<id column="id" property="id" jdbcType="INTEGER" /> <id column="id" property="id" jdbcType="INTEGER" />
<result column="type" property="type" jdbcType="VARCHAR" /> <result column="check_type" property="checkType" jdbcType="VARCHAR" />
<result column="content" property="content" jdbcType="VARCHAR" />
<result column="comment" property="comment" jdbcType="VARCHAR" /> <result column="comment" property="comment" jdbcType="VARCHAR" />
</resultMap> </resultMap>
<resultMap id="ResultMapWithBLOBs" type="com.gmei.data.dqmp.domain.TblRuleTemplate" extends="BaseResultMap" >
<result column="tplt_content" property="tpltContent" jdbcType="LONGVARCHAR" />
</resultMap>
<sql id="Example_Where_Clause" > <sql id="Example_Where_Clause" >
<where > <where >
<foreach collection="oredCriteria" item="criteria" separator="or" > <foreach collection="oredCriteria" item="criteria" separator="or" >
...@@ -66,8 +68,27 @@ ...@@ -66,8 +68,27 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List" > <sql id="Base_Column_List" >
id, type, content, comment id, check_type, comment
</sql>
<sql id="Blob_Column_List" >
tplt_content
</sql> </sql>
<select id="selectByExampleWithBLOBs" resultMap="ResultMapWithBLOBs" parameterType="com.gmei.data.dqmp.domain.TblRuleTemplateCriteria" >
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from tbl_rule_template
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.gmei.data.dqmp.domain.TblRuleTemplateCriteria" > <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.gmei.data.dqmp.domain.TblRuleTemplateCriteria" >
select select
<if test="distinct" > <if test="distinct" >
...@@ -82,9 +103,11 @@ ...@@ -82,9 +103,11 @@
order by ${orderByClause} order by ${orderByClause}
</if> </if>
</select> </select>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" > <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from tbl_rule_template from tbl_rule_template
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</select> </select>
...@@ -99,10 +122,10 @@ ...@@ -99,10 +122,10 @@
</if> </if>
</delete> </delete>
<insert id="insert" parameterType="com.gmei.data.dqmp.domain.TblRuleTemplate" > <insert id="insert" parameterType="com.gmei.data.dqmp.domain.TblRuleTemplate" >
insert into tbl_rule_template (id, type, content, insert into tbl_rule_template (id, check_type, comment,
comment) tplt_content)
values (#{id,jdbcType=INTEGER}, #{type,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR}, values (#{id,jdbcType=INTEGER}, #{checkType,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR},
#{comment,jdbcType=VARCHAR}) #{tpltContent,jdbcType=LONGVARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="com.gmei.data.dqmp.domain.TblRuleTemplate" > <insert id="insertSelective" parameterType="com.gmei.data.dqmp.domain.TblRuleTemplate" >
insert into tbl_rule_template insert into tbl_rule_template
...@@ -110,29 +133,29 @@ ...@@ -110,29 +133,29 @@
<if test="id != null" > <if test="id != null" >
id, id,
</if> </if>
<if test="type != null" > <if test="checkType != null" >
type, check_type,
</if>
<if test="content != null" >
content,
</if> </if>
<if test="comment != null" > <if test="comment != null" >
comment, comment,
</if> </if>
<if test="tpltContent != null" >
tplt_content,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides="," > <trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" > <if test="id != null" >
#{id,jdbcType=INTEGER}, #{id,jdbcType=INTEGER},
</if> </if>
<if test="type != null" > <if test="checkType != null" >
#{type,jdbcType=VARCHAR}, #{checkType,jdbcType=VARCHAR},
</if>
<if test="content != null" >
#{content,jdbcType=VARCHAR},
</if> </if>
<if test="comment != null" > <if test="comment != null" >
#{comment,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR},
</if> </if>
<if test="tpltContent != null" >
#{tpltContent,jdbcType=LONGVARCHAR},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="com.gmei.data.dqmp.domain.TblRuleTemplateCriteria" resultType="java.lang.Integer" > <select id="countByExample" parameterType="com.gmei.data.dqmp.domain.TblRuleTemplateCriteria" resultType="java.lang.Integer" >
...@@ -147,25 +170,34 @@ ...@@ -147,25 +170,34 @@
<if test="record.id != null" > <if test="record.id != null" >
id = #{record.id,jdbcType=INTEGER}, id = #{record.id,jdbcType=INTEGER},
</if> </if>
<if test="record.type != null" > <if test="record.checkType != null" >
type = #{record.type,jdbcType=VARCHAR}, check_type = #{record.checkType,jdbcType=VARCHAR},
</if>
<if test="record.content != null" >
content = #{record.content,jdbcType=VARCHAR},
</if> </if>
<if test="record.comment != null" > <if test="record.comment != null" >
comment = #{record.comment,jdbcType=VARCHAR}, comment = #{record.comment,jdbcType=VARCHAR},
</if> </if>
<if test="record.tpltContent != null" >
tplt_content = #{record.tpltContent,jdbcType=LONGVARCHAR},
</if>
</set> </set>
<if test="_parameter != null" > <if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
</update> </update>
<update id="updateByExampleWithBLOBs" parameterType="map" >
update tbl_rule_template
set id = #{record.id,jdbcType=INTEGER},
check_type = #{record.checkType,jdbcType=VARCHAR},
comment = #{record.comment,jdbcType=VARCHAR},
tplt_content = #{record.tpltContent,jdbcType=LONGVARCHAR}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map" > <update id="updateByExample" parameterType="map" >
update tbl_rule_template update tbl_rule_template
set id = #{record.id,jdbcType=INTEGER}, set id = #{record.id,jdbcType=INTEGER},
type = #{record.type,jdbcType=VARCHAR}, check_type = #{record.checkType,jdbcType=VARCHAR},
content = #{record.content,jdbcType=VARCHAR},
comment = #{record.comment,jdbcType=VARCHAR} comment = #{record.comment,jdbcType=VARCHAR}
<if test="_parameter != null" > <if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
...@@ -174,22 +206,28 @@ ...@@ -174,22 +206,28 @@
<update id="updateByPrimaryKeySelective" parameterType="com.gmei.data.dqmp.domain.TblRuleTemplate" > <update id="updateByPrimaryKeySelective" parameterType="com.gmei.data.dqmp.domain.TblRuleTemplate" >
update tbl_rule_template update tbl_rule_template
<set > <set >
<if test="type != null" > <if test="checkType != null" >
type = #{type,jdbcType=VARCHAR}, check_type = #{checkType,jdbcType=VARCHAR},
</if>
<if test="content != null" >
content = #{content,jdbcType=VARCHAR},
</if> </if>
<if test="comment != null" > <if test="comment != null" >
comment = #{comment,jdbcType=VARCHAR}, comment = #{comment,jdbcType=VARCHAR},
</if> </if>
<if test="tpltContent != null" >
tplt_content = #{tpltContent,jdbcType=LONGVARCHAR},
</if>
</set> </set>
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.gmei.data.dqmp.domain.TblRuleTemplate" >
update tbl_rule_template
set check_type = #{checkType,jdbcType=VARCHAR},
comment = #{comment,jdbcType=VARCHAR},
tplt_content = #{tpltContent,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.gmei.data.dqmp.domain.TblRuleTemplate" > <update id="updateByPrimaryKey" parameterType="com.gmei.data.dqmp.domain.TblRuleTemplate" >
update tbl_rule_template update tbl_rule_template
set type = #{type,jdbcType=VARCHAR}, set check_type = #{checkType,jdbcType=VARCHAR},
content = #{content,jdbcType=VARCHAR},
comment = #{comment,jdbcType=VARCHAR} comment = #{comment,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment