初始化项目
This commit is contained in:
1 parent
45a1702948
commit
934b8aad40
155 files changed
+2649
-68
No files matched your search
@@ -0,0 +1,59 @@
|
||||
<?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.bycrm.mapper.SchoolMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.bycrm.entity.School">
|
||||
<id column="id" property="id"/>
|
||||
<result column="school_code" property="schoolCode"/>
|
||||
<result column="school_name" property="schoolName"/>
|
||||
<result column="location" property="location"/>
|
||||
<result column="created_at" property="createdAt"/>
|
||||
<result column="updated_at" property="updatedAt"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="insert" parameterType="com.bycrm.entity.School" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO crm_school (school_code, school_name, location, created_at, updated_at)
|
||||
VALUES (#{schoolCode}, #{schoolName}, #{location}, #{createdAt}, #{updatedAt})
|
||||
</insert>
|
||||
|
||||
<insert id="batchInsert" parameterType="java.util.List">
|
||||
INSERT INTO crm_school (school_code, school_name, location, created_at, updated_at)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.schoolCode}, #{item.schoolName}, #{item.location}, #{item.createdAt}, #{item.updatedAt})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="searchByName" resultMap="BaseResultMap">
|
||||
SELECT id, school_code, school_name, location, created_at, updated_at
|
||||
FROM crm_school
|
||||
WHERE school_name LIKE CONCAT('%', #{keyword}, '%')
|
||||
ORDER BY school_name
|
||||
LIMIT 50
|
||||
</select>
|
||||
|
||||
<select id="findByCode" resultMap="BaseResultMap">
|
||||
SELECT id, school_code, school_name, location, created_at, updated_at
|
||||
FROM crm_school
|
||||
WHERE school_code = #{schoolCode}
|
||||
</select>
|
||||
|
||||
<select id="findAll" resultMap="BaseResultMap">
|
||||
SELECT id, school_code, school_name, location, created_at, updated_at
|
||||
FROM crm_school
|
||||
ORDER BY school_name
|
||||
</select>
|
||||
|
||||
<select id="findByPage" resultMap="BaseResultMap">
|
||||
SELECT id, school_code, school_name, location, created_at, updated_at
|
||||
FROM crm_school
|
||||
ORDER BY school_name
|
||||
LIMIT #{offset}, #{limit}
|
||||
</select>
|
||||
|
||||
<select id="count" resultType="int">
|
||||
SELECT COUNT(*) FROM crm_school
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in new issue
Block a user