-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
154 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,9 @@ out/ | |
.idea | ||
*.iml | ||
*.zip | ||
*.DS_Store | ||
|
||
build/ | ||
.gradle | ||
.sandbox | ||
gradle.properties | ||
gradle.properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Sun May 05 15:28:40 CST 2019 | ||
#Sun Jul 26 21:46:05 CST 2020 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<idea-plugin> | ||
<id>me.hehaiyang.codegen</id> | ||
<name>CodeGen</name> | ||
<version>1.3.1</version> | ||
<version>1.3.2</version> | ||
<vendor email="[email protected]" url="https://github.com/hykes">hykes</vendor> | ||
|
||
<description><![CDATA[ | ||
|
@@ -39,6 +39,7 @@ | |
<depends>com.intellij.modules.lang</depends> | ||
--> | ||
<depends optional="true" config-file="withDatabase.xml">com.intellij.database</depends> | ||
<depends>com.intellij.modules.java</depends> | ||
<!--<depends optional="true">com.intellij.modules.ultimate</depends>--> | ||
|
||
<extensions defaultExtensionNs="com.intellij"> | ||
|
125 changes: 125 additions & 0 deletions
125
src/main/resources/mapper/AppQuotationProductsMapper.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
<?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"> | ||
<!-- | ||
~ | ||
~ @author [ your email ] | ||
~ @date 2020-10-12 23:14:50 | ||
~ Created by CodeGen . | ||
--> | ||
|
||
<mapper namespace="AppQuotationProducts"> | ||
<resultMap id="AppQuotationProductsMap" type="AppQuotationProducts"> | ||
<id property="id" column="id"/> | ||
<result property="quotationId" column="quotation_id"/> | ||
<result property="productId" column="product_id"/> | ||
<result property="createdAt" column="created_at"/> | ||
<result property="updatedAt" column="updated_at"/> | ||
</resultMap> | ||
|
||
<sql id="table_name"> | ||
app_quotation_products | ||
</sql> | ||
|
||
<sql id="columns_all"> | ||
id, | ||
<include refid="columns_exclude_id"/> | ||
</sql> | ||
|
||
<sql id="columns_exclude_id"> | ||
`quotation_id`, `product_id`, created_at, updated_at | ||
</sql> | ||
|
||
<sql id="values_exclude_id"> | ||
#{quotationId}, #{productId}, now(), now() | ||
</sql> | ||
|
||
<sql id="criteria"> | ||
<where> | ||
<if test="quotationId != null">AND `quotation_id` = #{quotationId}</if> | ||
<if test="productId != null">AND `product_id` = #{productId}</if> | ||
<if test="createdAt != null">AND <![CDATA[created_at >= #{createdAt}]]> </if> | ||
<if test="updatedAt != null">AND <![CDATA[updated_at < #{updatedAt}]]> </if> | ||
</where> | ||
</sql> | ||
|
||
<insert id="create" parameterType="AppQuotationProducts" useGeneratedKeys="true" keyProperty="id"> | ||
INSERT INTO | ||
<include refid="table_name"/> | ||
(<include refid="columns_exclude_id"/>) | ||
VALUES | ||
(<include refid="values_exclude_id"/>) | ||
</insert> | ||
|
||
<insert id="creates" parameterType="AppQuotationProducts" useGeneratedKeys="true"> | ||
INSERT INTO | ||
<include refid="table_name"/> | ||
(<include refid="columns_exclude_id"/>) | ||
VALUES | ||
<foreach collection="list" item="i" index="index" separator=","> | ||
(#{i.quotationId}, #{i.productId}, now(), now()) | ||
</foreach> | ||
</insert> | ||
|
||
<select id="findById" parameterType="long" resultMap="AppQuotationProductsMap"> | ||
SELECT | ||
<include refid="columns_all"/> | ||
FROM | ||
<include refid="table_name"/> | ||
WHERE id = #{id} LIMIT 1 | ||
</select> | ||
|
||
<select id="findByIds" parameterType="list" resultMap="AppQuotationProductsMap"> | ||
SELECT | ||
<include refid="columns_all"/> | ||
FROM | ||
<include refid="table_name"/> | ||
WHERE id IN | ||
<foreach item="id" collection="list" open="(" separator="," close=")"> | ||
#{id} | ||
</foreach> | ||
</select> | ||
|
||
<update id="update" parameterType="AppQuotationProducts"> | ||
UPDATE | ||
<include refid="table_name"/> | ||
<set> | ||
<if test="quotationId != null">`quotation_id` = #{quotationId},</if> | ||
<if test="productId != null">`product_id` = #{productId},</if> | ||
updated_at = now() | ||
</set> | ||
WHERE id = #{id} | ||
</update> | ||
|
||
<delete id="delete" parameterType="long"> | ||
DELETE FROM | ||
<include refid="table_name"/> | ||
WHERE id = #{id} | ||
</delete> | ||
|
||
<select id="count" parameterType="map" resultType="long"> | ||
SELECT COUNT(1) | ||
FROM | ||
<include refid="table_name"/> | ||
<include refid="criteria"/> | ||
</select> | ||
|
||
<select id="paging" parameterType="map" resultMap="AppQuotationProductsMap"> | ||
SELECT | ||
<include refid="columns_all"/> | ||
FROM | ||
<include refid="table_name"/> | ||
<include refid="criteria"/> | ||
ORDER BY `id` DESC | ||
LIMIT #{offset}, #{limit} | ||
</select> | ||
|
||
<select id="list" parameterType="map" resultMap="AppQuotationProductsMap"> | ||
SELECT | ||
<include refid="columns_all"/> | ||
FROM | ||
<include refid="table_name"/> | ||
<include refid="criteria"/> | ||
ORDER BY `id` DESC | ||
</select> | ||
|
||
</mapper> |