123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- <?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.jeeplus.modules.test.validation.mapper.TestValidationMapper">
-
- <sql id="testValidationColumns">
- a.id AS "id",
- a.num AS "num",
- a.num2 AS "num2",
- a.str AS "str",
- a.email AS "email",
- a.url AS "url",
- a.new_date AS "newDate",
- a.remarks AS "remarks",
- a.c1 AS "c1",
- a.c2 AS "c2",
- a.c3 AS "c3",
- a.c4 AS "c4",
- a.c5 AS "c5",
- a.c6 AS "c6",
- a.en AS "en",
- a.zn AS "zn",
- a.enzn AS "enzn"
- </sql>
-
- <sql id="testValidationJoins">
-
- </sql>
-
-
- <select id="get" resultType="TestValidation" >
- SELECT
- <include refid="testValidationColumns"/>
- FROM test_validation a
- <include refid="testValidationJoins"/>
- WHERE a.id = #{id}
- </select>
-
- <select id="findList" resultType="TestValidation" >
- SELECT
- <include refid="testValidationColumns"/>
- FROM test_validation a
- <include refid="testValidationJoins"/>
- <where>
-
- ${dataScope}
- <if test="num != null and num != ''">
- AND a.num = #{num}
- </if>
- <if test="num2 != null and num2 != ''">
- AND a.num2 = #{num2}
- </if>
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- </otherwise>
- </choose>
- </select>
-
- <select id="findAllList" resultType="TestValidation" >
- SELECT
- <include refid="testValidationColumns"/>
- FROM test_validation a
- <include refid="testValidationJoins"/>
- <where>
-
- ${dataScope}
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- </otherwise>
- </choose>
- </select>
-
- <insert id="insert">
- INSERT INTO test_validation(
- id,
- num,
- num2,
- str,
- email,
- url,
- new_date,
- remarks,
- c1,
- c2,
- c3,
- c4,
- c5,
- c6,
- en,
- zn,
- enzn
- ) VALUES (
- #{id},
- #{num},
- #{num2},
- #{str},
- #{email},
- #{url},
- #{newDate},
- #{remarks},
- #{c1},
- #{c2},
- #{c3},
- #{c4},
- #{c5},
- #{c6},
- #{en},
- #{zn},
- #{enzn}
- )
- </insert>
-
- <update id="update">
- UPDATE test_validation SET
- num = #{num},
- num2 = #{num2},
- str = #{str},
- email = #{email},
- url = #{url},
- new_date = #{newDate},
- remarks = #{remarks},
- c1 = #{c1},
- c2 = #{c2},
- c3 = #{c3},
- c4 = #{c4},
- c5 = #{c5},
- c6 = #{c6},
- en = #{en},
- zn = #{zn},
- enzn = #{enzn}
- WHERE id = #{id}
- </update>
-
-
- <!--物理删除-->
- <update id="delete">
- DELETE FROM test_validation
- WHERE id = #{id}
- </update>
-
- <!--逻辑删除-->
- <update id="deleteByLogic">
- UPDATE test_validation SET
- del_flag = #{DEL_FLAG_DELETE}
- WHERE id = #{id}
- </update>
-
-
- <!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
- <select id="findUniqueByProperty" resultType="TestValidation" statementType="STATEMENT">
- select * FROM test_validation where ${propertyName} = '${value}'
- </select>
-
- </mapper>
|