build/classes/com/xx/supermarket/xml/CategoryMapper.xml

(开头部分) 9KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?xml version="1.0" encoding="UTF-8" ?>   
    <!DOCTYPE mapper   
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"   
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!-- 不使用namespace的话sql搜索定位会比较方便 -->
<mapper namespace="com.xx.supermarket.entity.Category">

     <!-- 实体类与数据库映射字段部分  start -->
	<resultMap id="ResultMapCategory" type="com.xx.supermarket.entity.Category">
        <result property="id" column="id"  jdbcType="INTEGER"/>
        <result property="cname" column="cname"  jdbcType="VARCHAR"/>
        <result property="isDelete" column="isDelete"  jdbcType="INTEGER"/>
	</resultMap>
	 <!-- 实体类与数据库映射字段部分  end -->
	 
	 <!-- 声明数据库字段 -->
	<sql id="Category_field">
           id,
           cname,
           isDelete
	</sql>
	
	<!-- 实体类属性  -->
	<sql id="Category_insert">
        	#{id} ,
        	#{cname} ,
        	#{isDelete} 
	</sql>
	
	<!-- 执行修改时 数据库字段和表字段比较 -->
	<sql id="Category_update">
		    <if test="cname != null" >
	            cname = #{cname} ,
	        </if>
		    <if test="isDelete != null" >
	            isDelete = #{isDelete} 
	        </if>
	</sql>
	
	<!-- 查询时条件 -->
	<sql id="Category_where">
	        <if test="id != null " >
	            and id =#{id}
	        </if>
	        <if test="cname != null " >
	            and cname =#{cname}
	        </if>
	        <if test="isDelete != null " >
	            and isDelete =#{isDelete}
	        </if>
	</sql>
	
	<!-- 以下是sql执行语句 
	     注意:1)参数类型和返回值类型,通用查询 xxBySqlId 注意将默认的 id修改为方法需要的。
	      2)非自定义的方法已经是basedao注明的。方法名一定要和id相同
	      3)自定义类的方法注意是否和共有方法重名id
	      4)执行sql出现顺序和baseDao方法一致,便于查询请勿随意添加,自定义的sql一律放在自定义sql区域
	 -->
	
	<!-- 
后面还有 271 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。