Browse Source

模板查询列表,Sql生成初步算法!

周壕 1 year ago
parent
commit
55e4933903
1 changed files with 276 additions and 0 deletions
  1. 276 0
      src/main/resources/mapping/SrTempdimensionMapper.xml

+ 276 - 0
src/main/resources/mapping/SrTempdimensionMapper.xml

@@ -0,0 +1,276 @@
+<?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">
+<mapper namespace="com.bowintek.practice.mapper.SrTempdimensionMapper">
+  <resultMap id="BaseResultMap" type="com.bowintek.practice.model.SrTempdimension">
+    <id column="tempFeildId" jdbcType="VARCHAR" property="tempFeildId" />
+    <result column="tempId" jdbcType="VARCHAR" property="tempId" />
+    <result column="fieldId" jdbcType="VARCHAR" property="fieldId" />
+    <result column="disOrder" jdbcType="DECIMAL" property="disOrder" />
+    <result column="fieldCode" jdbcType="VARCHAR" property="fieldCode" />
+    <result column="fieldName" jdbcType="VARCHAR" property="fieldName" />
+    <result column="fieldAlias" jdbcType="VARCHAR" property="fieldAlias" />
+    <result column="dataType" jdbcType="VARCHAR" property="dataType" />
+    <result column="displayName" jdbcType="VARCHAR" property="displayName" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    tempFeildId, tempId, fieldId, disOrder, fieldCode, fieldName, fieldAlias, dataType, 
+    displayName
+  </sql>
+  <select id="selectByExample" parameterType="com.bowintek.practice.model.SrTempdimensionExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from sr_tempdimension
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from sr_tempdimension
+    where tempFeildId = #{tempFeildId,jdbcType=VARCHAR}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    delete from sr_tempdimension
+    where tempFeildId = #{tempFeildId,jdbcType=VARCHAR}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.bowintek.practice.model.SrTempdimensionExample">
+    delete from sr_tempdimension
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.bowintek.practice.model.SrTempdimension">
+    insert into sr_tempdimension (tempFeildId, tempId, fieldId, 
+      disOrder, fieldCode, fieldName, 
+      fieldAlias, dataType, displayName
+      )
+    values (#{tempFeildId,jdbcType=VARCHAR}, #{tempId,jdbcType=VARCHAR}, #{fieldId,jdbcType=VARCHAR}, 
+      #{disOrder,jdbcType=DECIMAL}, #{fieldCode,jdbcType=VARCHAR}, #{fieldName,jdbcType=VARCHAR}, 
+      #{fieldAlias,jdbcType=VARCHAR}, #{dataType,jdbcType=VARCHAR}, #{displayName,jdbcType=VARCHAR}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.bowintek.practice.model.SrTempdimension">
+    insert into sr_tempdimension
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="tempFeildId != null">
+        tempFeildId,
+      </if>
+      <if test="tempId != null">
+        tempId,
+      </if>
+      <if test="fieldId != null">
+        fieldId,
+      </if>
+      <if test="disOrder != null">
+        disOrder,
+      </if>
+      <if test="fieldCode != null">
+        fieldCode,
+      </if>
+      <if test="fieldName != null">
+        fieldName,
+      </if>
+      <if test="fieldAlias != null">
+        fieldAlias,
+      </if>
+      <if test="dataType != null">
+        dataType,
+      </if>
+      <if test="displayName != null">
+        displayName,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="tempFeildId != null">
+        #{tempFeildId,jdbcType=VARCHAR},
+      </if>
+      <if test="tempId != null">
+        #{tempId,jdbcType=VARCHAR},
+      </if>
+      <if test="fieldId != null">
+        #{fieldId,jdbcType=VARCHAR},
+      </if>
+      <if test="disOrder != null">
+        #{disOrder,jdbcType=DECIMAL},
+      </if>
+      <if test="fieldCode != null">
+        #{fieldCode,jdbcType=VARCHAR},
+      </if>
+      <if test="fieldName != null">
+        #{fieldName,jdbcType=VARCHAR},
+      </if>
+      <if test="fieldAlias != null">
+        #{fieldAlias,jdbcType=VARCHAR},
+      </if>
+      <if test="dataType != null">
+        #{dataType,jdbcType=VARCHAR},
+      </if>
+      <if test="displayName != null">
+        #{displayName,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.bowintek.practice.model.SrTempdimensionExample" resultType="java.lang.Long">
+    select count(*) from sr_tempdimension
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update sr_tempdimension
+    <set>
+      <if test="row.tempFeildId != null">
+        tempFeildId = #{row.tempFeildId,jdbcType=VARCHAR},
+      </if>
+      <if test="row.tempId != null">
+        tempId = #{row.tempId,jdbcType=VARCHAR},
+      </if>
+      <if test="row.fieldId != null">
+        fieldId = #{row.fieldId,jdbcType=VARCHAR},
+      </if>
+      <if test="row.disOrder != null">
+        disOrder = #{row.disOrder,jdbcType=DECIMAL},
+      </if>
+      <if test="row.fieldCode != null">
+        fieldCode = #{row.fieldCode,jdbcType=VARCHAR},
+      </if>
+      <if test="row.fieldName != null">
+        fieldName = #{row.fieldName,jdbcType=VARCHAR},
+      </if>
+      <if test="row.fieldAlias != null">
+        fieldAlias = #{row.fieldAlias,jdbcType=VARCHAR},
+      </if>
+      <if test="row.dataType != null">
+        dataType = #{row.dataType,jdbcType=VARCHAR},
+      </if>
+      <if test="row.displayName != null">
+        displayName = #{row.displayName,jdbcType=VARCHAR},
+      </if>
+    </set>
+    <if test="example != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update sr_tempdimension
+    set tempFeildId = #{row.tempFeildId,jdbcType=VARCHAR},
+      tempId = #{row.tempId,jdbcType=VARCHAR},
+      fieldId = #{row.fieldId,jdbcType=VARCHAR},
+      disOrder = #{row.disOrder,jdbcType=DECIMAL},
+      fieldCode = #{row.fieldCode,jdbcType=VARCHAR},
+      fieldName = #{row.fieldName,jdbcType=VARCHAR},
+      fieldAlias = #{row.fieldAlias,jdbcType=VARCHAR},
+      dataType = #{row.dataType,jdbcType=VARCHAR},
+      displayName = #{row.displayName,jdbcType=VARCHAR}
+    <if test="example != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.bowintek.practice.model.SrTempdimension">
+    update sr_tempdimension
+    <set>
+      <if test="tempId != null">
+        tempId = #{tempId,jdbcType=VARCHAR},
+      </if>
+      <if test="fieldId != null">
+        fieldId = #{fieldId,jdbcType=VARCHAR},
+      </if>
+      <if test="disOrder != null">
+        disOrder = #{disOrder,jdbcType=DECIMAL},
+      </if>
+      <if test="fieldCode != null">
+        fieldCode = #{fieldCode,jdbcType=VARCHAR},
+      </if>
+      <if test="fieldName != null">
+        fieldName = #{fieldName,jdbcType=VARCHAR},
+      </if>
+      <if test="fieldAlias != null">
+        fieldAlias = #{fieldAlias,jdbcType=VARCHAR},
+      </if>
+      <if test="dataType != null">
+        dataType = #{dataType,jdbcType=VARCHAR},
+      </if>
+      <if test="displayName != null">
+        displayName = #{displayName,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where tempFeildId = #{tempFeildId,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.bowintek.practice.model.SrTempdimension">
+    update sr_tempdimension
+    set tempId = #{tempId,jdbcType=VARCHAR},
+      fieldId = #{fieldId,jdbcType=VARCHAR},
+      disOrder = #{disOrder,jdbcType=DECIMAL},
+      fieldCode = #{fieldCode,jdbcType=VARCHAR},
+      fieldName = #{fieldName,jdbcType=VARCHAR},
+      fieldAlias = #{fieldAlias,jdbcType=VARCHAR},
+      dataType = #{dataType,jdbcType=VARCHAR},
+      displayName = #{displayName,jdbcType=VARCHAR}
+    where tempFeildId = #{tempFeildId,jdbcType=VARCHAR}
+  </update>
+</mapper>