angular.js表单验证
1、引入angular.js可以引入外部链接,也可以本地下载后引用。
实例:
<body>
<form ng-app="" name="myForm" ng-init="myText = '">
Email:
<input type="email" name="myAddress" ng-model="myText" required>

2、<select id="selectListByPage" parameterType="com.etu.jxkh.model.Library" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List" />
FROM T_JXKH_LIBRARY
<trim prefix="where" prefixOverrides="and|or">
<if test ="kpiName!=null and kpiName!=''">
AND KPI_NAME LIKE '%${kpiName}%'
</if>
<if test ="kpiType!=null and kpiType!=''">
AND KPI_TYPE = #{kpiType, jdbcType=VARCHAR }
</if>
<if test ="deep!=null and deep!=''">
AND DEEP = #{deep, jdbcType=INTEGER}
</if>
<if test ="weightType!=null and weightType !=''">
AND WEIGHT_TYPE = #{weightType, jdbcType=VARCHAR}
</if>
<if test ="parentId!=null and parentId !=''">
AND PARENT_ID =#{parentId,jdbcType=VARCHAR}
</if>
<if test ="year!=null and year !=''">
AND YEAR =#{year,jdbcType=INTEGER}
</if>
<if test ="checkType!=null and checkType !=''">
AND CHECK_TYPE =#{checkType,jdbcType=VARCHAR}
</if>
<if test="where != null">
and ${where}
</if>
and state != -1
</trim>
ORDER BY sort_num
</select>

3、protected String getDefaultSqlNamespace() {
Class<?> genericClass = BeanUtils.getGenericClass(this.getClass());
if (getSqlNameSpaceRule() == null) {
return genericClass == null ? null : genericClass.getName()
.replace("model", "dao") + "Mapper";
} else {
return getSqlNameSpaceRule().getSqlNameSpace(genericClass);
}
}

1、<select id="getKpiTypeList" parameterType="com.etu.jxkh.model.Library" resultType="com.etu.jxkh.model.Library">
SELECT
KPI_TYPE as kpiType
FROM T_JXKH_LIBRARY
<trim prefix="where" prefixOverrides="and|or">

2、 <if test ="weightType!=null and weightType !=''">
AND WEIGHT_TYPE = #{weightType, jdbcType=VARCHAR}
</if>
<if test ="year!=null and year !=''">
AND YEAR =#{year,jdbcType=INTEGER}
</if>
</trim>
group by KPI_TYPE
</select>

3、public int deleteByPrimaryKey(String id) {
logger.debug("deleteByPrimaryKey");
try {
return sqlSessionTemplate.delete(getSqlName(SqlStatement.SQL_DELETE_BY_ID), id);
} catch (Exception exception) {
logger.error("删除记录出错", exception);
throw new DaoException("删除记录出错 "+exception.getCause().getMessage(), exception);
}
}

4、public int deleteByPrimaryKey(String id) {
logger.debug("deleteByPrimaryKey");
try {
return sqlSessionTemplate.delete(getSqlName(SqlStatement.SQL_DELETE_BY_ID), id);
} catch (Exception exception) {
logger.error("删除记录出错", exception);
throw new DaoException("删除记录出错 "+exception.getCause().getMessage(), exception);
}
}
