Prechádzať zdrojové kódy

发票管理模块代码sql语句

ZhangWenQiang 5 rokov pred
rodič
commit
719b0a8db1

+ 69 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwinvoice/mapper/xml/HlwDutyApplyMapper.xml

@@ -2,4 +2,73 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="org.jeecg.modules.hlwinvoice.mapper.HlwDutyApplyMapper">
 
+    <sql id="hlwDutyApplyColumns">
+		a.id AS "id",
+		a.duty_paid_id AS "dutyPaidId",
+		a.amount AS "amount",
+		a.apply_time AS "applyTime",
+		a.apply_by AS "applyBy"
+	</sql>
+
+    <sql id="hlwDutyApplyJoins">
+
+    </sql>
+
+
+    <select id="get" resultType="org.jeecg.modules.hlwinvoice.entity.HlwDutyApply" >
+        SELECT
+        <include refid="hlwDutyApplyColumns"/>
+        FROM hlw_duty_apply a
+        <include refid="hlwDutyApplyJoins"/>
+        WHERE a.id = #{id}
+    </select>
+
+    <select id="findList" resultType="org.jeecg.modules.hlwinvoice.entity.HlwDutyApply" >
+        SELECT
+        <include refid="hlwDutyApplyColumns"/>
+        FROM hlw_duty_apply a
+        <include refid="hlwDutyApplyJoins"/>
+        <where>
+
+
+        </where>
+    </select>
+
+    <insert id="saveApply">
+		INSERT INTO hlw_duty_apply(
+			duty_paid_id,
+			amount,
+			apply_time,
+			apply_by
+		) VALUES (
+			#{dutyPaidId},
+			#{amount},
+			#{applyTime},
+			#{applyBy}
+		)
+	</insert>
+
+    <update id="updateApply">
+		UPDATE hlw_duty_apply SET
+			duty_paid_id = #{dutyPaidId},
+			amount = #{amount},
+			apply_time = #{applyTime},
+			apply_by = #{applyBy}
+		WHERE id = #{id}
+	</update>
+
+
+    <!--物理删除-->
+    <update id="delete">
+		DELETE FROM hlw_duty_apply
+		WHERE id = #{id}
+	</update>
+
+    <!--逻辑删除-->
+    <update id="deleteByLogic">
+		UPDATE hlw_duty_apply SET
+			del_flag = #{DEL_FLAG_DELETE}
+		WHERE id = #{id}
+	</update>
+
 </mapper>

+ 73 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwinvoice/mapper/xml/HlwDutyPaidMapper.xml

@@ -2,4 +2,77 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="org.jeecg.modules.hlwinvoice.mapper.HlwDutyPaidMapper">
 
+    <sql id="hlwDutyPaidColumns">
+		a.id AS "id",
+		a.total_amount AS "totalAmount",
+		a.receipt_number AS "receiptNumber",
+		a.tax_payment_receipt AS "taxPaymentReceipt",
+		a.upload_time AS "uploadTime",
+		a.upload_by AS "uploadBy"
+	</sql>
+
+    <sql id="hlwDutyPaidJoins">
+
+    </sql>
+
+
+    <select id="get" resultType="org.jeecg.modules.hlwinvoice.entity.HlwDutyPaid" >
+        SELECT
+        <include refid="hlwDutyPaidColumns"/>
+        FROM hlw_duty_paid a
+        <include refid="hlwDutyPaidJoins"/>
+        WHERE a.id = #{id}
+    </select>
+
+    <select id="findList" resultType="org.jeecg.modules.hlwinvoice.entity.HlwDutyPaid" >
+        SELECT
+        <include refid="hlwDutyPaidColumns"/>
+        FROM hlw_duty_paid a
+        <include refid="hlwDutyPaidJoins"/>
+        <where>
+
+
+        </where>
+    </select>
+
+    <insert id="savePaid">
+		INSERT INTO hlw_duty_paid(
+			total_amount,
+			receipt_number,
+			tax_payment_receipt,
+			upload_time,
+			upload_by
+		) VALUES (
+			#{totalAmount},
+			#{receiptNumber},
+			#{taxPaymentReceipt},
+			#{uploadTime},
+			#{uploadBy}
+		)
+	</insert>
+
+    <update id="updatePaid">
+		UPDATE hlw_duty_paid SET
+			total_amount = #{totalAmount},
+			receipt_number = #{receiptNumber},
+			tax_payment_receipt = #{taxPaymentReceipt},
+			upload_time = #{uploadTime},
+			upload_by = #{uploadBy}
+		WHERE id = #{id}
+	</update>
+
+
+    <!--物理删除-->
+    <update id="delete">
+		DELETE FROM hlw_duty_paid
+		WHERE id = #{id}
+	</update>
+
+    <!--逻辑删除-->
+    <update id="deleteByLogic">
+		UPDATE hlw_duty_paid SET
+			del_flag = #{DEL_FLAG_DELETE}
+		WHERE id = #{id}
+	</update>
+
 </mapper>

+ 77 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwinvoice/mapper/xml/HlwInvoiceMapper.xml

@@ -2,4 +2,81 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="org.jeecg.modules.hlwinvoice.mapper.HlwInvoiceMapper">
 
+    <sql id="hlwInvoiceColumns">
+		a.id AS "id",
+		a.amount AS "amount",
+		a.invoice_number AS "invoiceNumber",
+		a.invoice AS "invoice",
+		a.sys_org_code AS "sysOrgCode",
+		a.upload_time AS "uploadTime",
+		a.upload_by AS "uploadBy"
+	</sql>
+
+    <sql id="hlwInvoiceJoins">
+
+    </sql>
+
+
+    <select id="get" resultType="org.jeecg.modules.hlwinvoice.entity.HlwInvoice" >
+        SELECT
+        <include refid="hlwInvoiceColumns"/>
+        FROM hlw_invoice a
+        <include refid="hlwInvoiceJoins"/>
+        WHERE a.id = #{id}
+    </select>
+
+    <select id="findList" resultType="org.jeecg.modules.hlwinvoice.entity.HlwInvoice" >
+        SELECT
+        <include refid="hlwInvoiceColumns"/>
+        FROM hlw_invoice a
+        <include refid="hlwInvoiceJoins"/>
+        <where>
+
+
+        </where>
+    </select>
+
+    <insert id="saveInvoice">
+		INSERT INTO hlw_invoice(
+			amount,
+			invoice_number,
+			invoice,
+			sys_org_code,
+			upload_time,
+			upload_by
+		) VALUES (
+			#{amount},
+			#{invoiceNumber},
+			#{invoice},
+			#{sysOrgCode},
+			#{uploadTime},
+			#{uploadBy}
+		)
+	</insert>
+
+    <update id="updateInvoice">
+		UPDATE hlw_invoice SET
+			amount = #{amount},
+			invoice_number = #{invoiceNumber},
+			invoice = #{invoice},
+			sys_org_code = #{sysOrgCode},
+			upload_time = #{uploadTime},
+			upload_by = #{uploadBy}
+		WHERE id = #{id}
+	</update>
+
+
+    <!--物理删除-->
+    <update id="delete">
+		DELETE FROM hlw_invoice
+		WHERE id = #{id}
+	</update>
+
+    <!--逻辑删除-->
+    <update id="deleteByLogic">
+		UPDATE hlw_invoice SET
+			del_flag = #{DEL_FLAG_DELETE}
+		WHERE id = #{id}
+	</update>
+
 </mapper>