Commit 7cabc39a authored by qiankunpingtai's avatar qiankunpingtai
Browse files

切换到jsh的版本

parent 9182e734
...@@ -19,30 +19,7 @@ resource=src/main/resources ...@@ -19,30 +19,7 @@ resource=src/main/resources
web.front.baseDir=erp_web web.front.baseDir=erp_web
mybatis.type-aliases-package=com.jsh.erp.datasource.entities.* mybatis.type-aliases-package=com.jsh.erp.datasource.entities.*
mybatis.mapper-locations=classpath:./mapper_xml/*.xml mybatis.mapper-locations=classpath:./mapper_xml/*.xml
#开启sql打印
logging.level.com.jsh.erp.datasource.mappers=DEBUG
#日志
logging.config=classpath:logback-spring.xml
logging.level.com.didispace=DEBUG
logging.level.com.jsh.erp=debug
#pagehelper配置
pagehelper.helperDialect=mysql
pagehelper.offsetAsPageNum=true
pagehelper.rowBoundsWithCount=true
pagehelper.pageSizeZero=true
pagehelper.reasonable=false
pagehelper.params=pageNum=pageHelperStart;pageSize=pageHelperRows;
pagehelper.supportMethodsArguments=false
#mybatis-plus配置 #mybatis-plus配置
mybatis-plus.mapper-locations=classpath:./mapper_xml/*.xml mybatis-plus.mapper-locations=classpath:./mapper_xml/*.xml
#跳过某些方法过滤配置 #租户对应的角色id
mybatis-plus.global-config.sql-parser-cache=true manage.roleId=10
#获取管理系统信息 \ No newline at end of file
manage.roleId=10
<?xml version="1.0" encoding="UTF-8"?> <configuration>
<!-- 日志级别从低到高分为TRACE < DEBUG < INFO < WARN < ERROR < FATAL,如果设置为WARN,则低于WARN的信息都不会输出 --> <property name="LOG_FILE" value="${logs.home}/jshERP"/>
<!-- scan:当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true --> <property name="LOG_PATTERN" value="%d{yyyy/MM/dd-HH:mm:ss} %-5level [%thread] %logger - %msg%n"/>
<!-- scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。 -->
<!-- debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 -->
<configuration scan="true" scanPeriod="10 seconds">
<!--<include resource="org/springframework/boot/logging/logback/base.xml" />-->
<contextName>logback</contextName>
<!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义变量后,可以使“${}”来使用变量。 -->
<property name="log.path" value="../logs/jshERP" />
<!-- 彩色日志 -->
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
<!-- 彩色日志格式 -->
<property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
<!--输出到控制台-->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息-->
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>debug</level>
</filter>
<encoder>
<Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
<!-- 设置字符集 -->
<charset>UTF-8</charset>
</encoder>
</appender>
<!--输出到文件-->
<!-- 时间滚动输出 level为 DEBUG 日志 -->
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${log.path}/log_debug.log</file>
<!--日志文件输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志归档 -->
<fileNamePattern>${log.path}/debug/log-debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录debug级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>debug</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 时间滚动输出 level为 INFO 日志 -->
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${log.path}/log_info.log</file>
<!--日志文件输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset>
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 每天日志归档路径以及格式 -->
<fileNamePattern>${log.path}/info/log-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录info级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>info</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 时间滚动输出 level为 WARN 日志 -->
<appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${log.path}/log_warn.log</file>
<!--日志文件输出格式-->
<encoder> <encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> <pattern>${LOG_PATTERN}</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder> </encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/warn/log-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录warn级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>warn</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender> </appender>
<appender name="TIME_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 时间滚动输出 level为 ERROR 日志 --> <file>${LOG_FILE}.log</file>
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${log.path}/log_error.log</file>
<!--日志文件输出格式-->
<encoder> <encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> <pattern>${LOG_PATTERN}</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder> </encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/error/log-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern> <fileNamePattern>${LOG_FILE}.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<maxHistory>10</maxHistory>
<totalSizeCap>1GB</totalSizeCap>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize> <maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy> </timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy> </rollingPolicy>
<!-- 此日志文件只记录ERROR级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender> </appender>
<!-- <root level="ERROR">
<logger>用来设置某一个包或者具体的某一个类的日志打印级别、 <appender-ref ref="CONSOLE"/>
以及指定<appender>。<logger>仅有一个name属性, <appender-ref ref="TIME_FILE"/>
一个可选的level和一个可选的addtivity属性。
name:用来指定受此logger约束的某一个包或者具体的某一个类。
level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF,
还有一个特俗值INHERITED或者同义词NULL,代表强制执行上级的级别。
如果未设置此属性,那么当前logger将会继承上级的级别。
addtivity:是否向上级logger传递打印信息。默认是true。
-->
<!--<logger name="org.springframework.web" level="info"/>-->
<!--<logger name="org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor" level="INFO"/>-->
<!--
使用mybatis的时候,sql语句是debug下才会打印,而这里我们只配置了info,所以想要查看sql语句的话,有以下两种操作:
第一种把<root level="info">改成<root level="DEBUG">这样就会打印sql,不过这样日志那边会出现很多其他消息
第二种就是单独给dao下目录配置debug模式,代码如下,这样配置sql语句会打印,其他还是正常info级别:
-->
<!--
root节点是必选节点,用来指定最基础的日志输出级别,只有一个level属性
level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF,
不能设置为INHERITED或者同义词NULL。默认是DEBUG
可以包含零个或多个元素,标识这个appender将会添加到这个logger。
-->
<!--开发环境:打印控制台
<springProfile name="dev">
<logger name="com.nmys.view" level="debug"/>
</springProfile>
-->
<root level="info">
<appender-ref ref="CONSOLE" />
<appender-ref ref="DEBUG_FILE" />
<appender-ref ref="INFO_FILE" />
<appender-ref ref="WARN_FILE" />
<appender-ref ref="ERROR_FILE" />
</root> </root>
<logger name="com.jsh" additivity="false" level="DEBUG">
<!--生产环境:输出到文件--> <appender-ref ref="CONSOLE"/>
<!--<springProfile name="pro">--> <appender-ref ref="TIME_FILE"/>
<!--<root level="info">--> </logger>
<!--<appender-ref ref="CONSOLE" />-->
<!--<appender-ref ref="DEBUG_FILE" />-->
<!--<appender-ref ref="INFO_FILE" />-->
<!--<appender-ref ref="ERROR_FILE" />-->
<!--<appender-ref ref="WARN_FILE" />-->
<!--</root>-->
<!--</springProfile>-->
</configuration> </configuration>
\ No newline at end of file
...@@ -15,18 +15,17 @@ ...@@ -15,18 +15,17 @@
left join jsh_person p on ah.HandsPersonId=p.id and ifnull(p.delete_Flag,'0') !='1' left join jsh_person p on ah.HandsPersonId=p.id and ifnull(p.delete_Flag,'0') !='1'
left join jsh_account a on ah.AccountId=a.id and ifnull(a.delete_Flag,'0') !='1' left join jsh_account a on ah.AccountId=a.id and ifnull(a.delete_Flag,'0') !='1'
where 1=1 where 1=1
<if test="billNo != null and billNo != ''"> <if test="billNo != null">
<bind name="billNo" value="'%' + _parameter.billNo + '%'"/> and ah.BillNo like '%${billNo}%'
and ah.BillNo like #{billNo}
</if> </if>
<if test="type != null and type != ''"> <if test="type != null">
and ah.Type= #{type} and ah.Type='${type}'
</if> </if>
<if test="beginTime != null and beginTime != ''"> <if test="beginTime != null">
and ah.BillTime &gt;= #{beginTime} and ah.BillTime &gt;= '${beginTime}'
</if> </if>
<if test="endTime != null and endTime != ''"> <if test="endTime != null">
and ah.BillTime &lt;= #{endTime} and ah.BillTime &lt;= '${endTime}'
</if> </if>
and ifnull(ah.delete_Flag,'0') !='1' and ifnull(ah.delete_Flag,'0') !='1'
order by ah.Id desc order by ah.Id desc
...@@ -41,27 +40,29 @@ ...@@ -41,27 +40,29 @@
COUNT(id) COUNT(id)
FROM jsh_accounthead FROM jsh_accounthead
WHERE 1=1 WHERE 1=1
<if test="billNo != null and billNo != ''"> <if test="billNo != null">
<bind name="billNo" value="'%' + _parameter.billNo + '%'"/> and BillNo like '%${billNo}%'
and BillNo like #{billNo}
</if> </if>
<if test="type != null and type != ''"> <if test="type != null">
and Type=#{type} and Type='${type}'
</if> </if>
<if test="beginTime != null and beginTime != ''"> <if test="beginTime != null">
and BillTime &gt;= #{beginTime} and BillTime &gt;= '${beginTime}'
</if> </if>
<if test="endTime != null and endTime != ''"> <if test="endTime != null">
and BillTime &lt;= #{endTime} and BillTime &lt;= '${endTime}'
</if> </if>
and ifnull(delete_Flag,'0') !='1' and ifnull(delete_Flag,'0') !='1'
</select> </select>
<select id="getMaxId" resultType="java.lang.Long">
select max(Id) as Id from jsh_accounthead
</select>
<select id="findAllMoney" resultType="java.math.BigDecimal"> <select id="findAllMoney" resultType="java.math.BigDecimal">
select sum(#{modeName}) as allMoney from jsh_accounthead select sum(${modeName}) as allMoney from jsh_accounthead
where Type=#{type} where Type='${type}'
and OrganId =#{supplierId} and BillTime <![CDATA[ <=#{endTime}]]> and OrganId =${supplierId} and BillTime <![CDATA[ <='${endTime}']]>
and ifnull(delete_Flag,'0') !='1' and ifnull(delete_Flag,'0') !='1'
</select> </select>
...@@ -73,7 +74,7 @@ ...@@ -73,7 +74,7 @@
left join jsh_account a on ah.AccountId=a.id and ifnull(a.delete_Flag,'0') !='1' left join jsh_account a on ah.AccountId=a.id and ifnull(a.delete_Flag,'0') !='1'
where 1=1 where 1=1
<if test="billNo != null"> <if test="billNo != null">
and ah.BillNo = #{billNo} and ah.BillNo = '${billNo}'
</if> </if>
and ifnull(ah.delete_Flag,'0') !='1' and ifnull(ah.delete_Flag,'0') !='1'
</select> </select>
...@@ -123,56 +124,4 @@ ...@@ -123,56 +124,4 @@
) )
and ifnull(delete_Flag,'0') !='1' and ifnull(delete_Flag,'0') !='1'
</select> </select>
<insert id="addAccountHead" parameterType="com.jsh.erp.datasource.entities.AccountHead"
useGeneratedKeys="true" keyProperty="id" keyColumn="id">
insert into jsh_accounthead (Id, Type, OrganId,
HandsPersonId, ChangeAmount, TotalPrice,
AccountId, BillNo, BillTime,
Remark, tenant_id, delete_Flag
)
values (#{id,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR}, #{organid,jdbcType=BIGINT},
#{handspersonid,jdbcType=BIGINT}, #{changeamount,jdbcType=DECIMAL}, #{totalprice,jdbcType=DECIMAL},
#{accountid,jdbcType=BIGINT}, #{billno,jdbcType=VARCHAR}, #{billtime,jdbcType=TIMESTAMP},
#{remark,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}
)
</insert>
<update id="updateAccountHead" parameterType="com.jsh.erp.datasource.entities.AccountHead">
update jsh_accounthead
<set>
<if test="type != null">
Type = #{type,jdbcType=VARCHAR},
</if>
<if test="organid != null">
OrganId = #{organid,jdbcType=BIGINT},
</if>
<if test="handspersonid != null">
HandsPersonId = #{handspersonid,jdbcType=BIGINT},
</if>
<if test="changeamount != null">
ChangeAmount = #{changeamount,jdbcType=DECIMAL},
</if>
<if test="totalprice != null">
TotalPrice = #{totalprice,jdbcType=DECIMAL},
</if>
<if test="accountid != null">
AccountId = #{accountid,jdbcType=BIGINT},
</if>
<if test="billno != null">
BillNo = #{billno,jdbcType=VARCHAR},
</if>
<if test="billtime != null">
BillTime = #{billtime,jdbcType=TIMESTAMP},
</if>
<if test="remark != null">
Remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="tenantId != null">
tenant_id = #{tenantId,jdbcType=BIGINT},
</if>
<if test="deleteFlag != null">
delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
</if>
</set>
where Id = #{id,jdbcType=BIGINT}
</update>
</mapper> </mapper>
\ No newline at end of file
...@@ -11,16 +11,14 @@ ...@@ -11,16 +11,14 @@
select * select *
FROM jsh_accountitem FROM jsh_accountitem
where 1=1 where 1=1
<if test="name != null and name != ''"> <if test="name != null">
<bind name="name" value="'%' + _parameter.name + '%'"/> and name like '%${name}%'
and name like #{name}
</if> </if>
<if test="type != null"> <if test="type != null">
and type=#{type} and type=${type}
</if> </if>
<if test="remark != null and remark != ''"> <if test="remark != null">
<bind name="remark" value="'%' + _parameter.remark + '%'"/> and remark like '%${remark}%'
and remark like #{remark}
</if> </if>
and ifnull(delete_Flag,'0') !='1' and ifnull(delete_Flag,'0') !='1'
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
...@@ -32,16 +30,14 @@ ...@@ -32,16 +30,14 @@
COUNT(id) COUNT(id)
FROM jsh_accountitem FROM jsh_accountitem
WHERE 1=1 WHERE 1=1
<if test="name != null and name != ''"> <if test="name != null">
<bind name="name" value="'%' + _parameter.name + '%'"/> and name like '%${name}%'
and name like #{name}
</if> </if>
<if test="type != null"> <if test="type != null">
and type=#{type} and type=${type}
</if> </if>
<if test="remark != null and remark != ''"> <if test="remark != null">
<bind name="remark" value="'%' + _parameter.remark + '%'"/> and remark like '%${remark}%'
and remark like #{remark}
</if> </if>
and ifnull(delete_Flag,'0') !='1' and ifnull(delete_Flag,'0') !='1'
</select> </select>
...@@ -50,7 +46,7 @@ ...@@ -50,7 +46,7 @@
select ai.*,a.Name AccountName,ioi.Name InOutItemName select ai.*,a.Name AccountName,ioi.Name InOutItemName
from jsh_accountitem ai left join jsh_account a on ai.AccountId=a.id and ifnull(a.delete_Flag,'0') !='1' from jsh_accountitem ai left join jsh_account a on ai.AccountId=a.id and ifnull(a.delete_Flag,'0') !='1'
left join jsh_inoutitem ioi on ai.InOutItemId = ioi.id and ifnull(ioi.delete_Flag,'0') !='1' left join jsh_inoutitem ioi on ai.InOutItemId = ioi.id and ifnull(ioi.delete_Flag,'0') !='1'
where ai.HeaderId = #{headerId} where ai.HeaderId = ${headerId}
and ifnull(ai.delete_Flag,'0') !='1' and ifnull(ai.delete_Flag,'0') !='1'
order by ai.id asc order by ai.id asc
</select> </select>
......
...@@ -19,17 +19,14 @@ ...@@ -19,17 +19,14 @@
select * select *
FROM jsh_account FROM jsh_account
where 1=1 where 1=1
<if test="name != null and name != ''"> <if test="name != null">
<bind name="name" value="'%' + _parameter.name + '%'"/> and name like '%${name}%'
and name like #{name}
</if> </if>
<if test="serialNo != null and serialNo != ''"> <if test="serialNo != null">
<bind name="serialNo" value="'%' + _parameter.serialNo + '%'"/> and SerialNo like '%${serialNo}%'
and SerialNo like #{serialNo}
</if> </if>
<if test="remark != null and remark != ''"> <if test="remark != null">
<bind name="remark" value="'%' + _parameter.remark + '%'"/> and remark like '%${remark}%'
and remark like #{remark}
</if> </if>
and ifnull(delete_Flag,'0') !='1' and ifnull(delete_Flag,'0') !='1'
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
...@@ -42,17 +39,14 @@ ...@@ -42,17 +39,14 @@
COUNT(id) COUNT(id)
FROM jsh_account FROM jsh_account
WHERE 1=1 WHERE 1=1
<if test="name != null and name != ''"> <if test="name != null">
<bind name="name" value="'%' + _parameter.name + '%'"/> and name like '%${name}%'
and name like #{name}
</if> </if>
<if test="serialNo != null and serialNo != ''"> <if test="serialNo != null">
<bind name="serialNo" value="'%' + _parameter.serialNo + '%'"/> and SerialNo like '%${serialNo}%'
and SerialNo like #{serialNo}
</if> </if>
<if test="remark != null and remark != ''"> <if test="remark != null">
<bind name="remark" value="'%' + _parameter.remark + '%'"/> and remark like '%${remark}%'
and remark like #{remark}
</if> </if>
and ifnull(delete_Flag,'0') !='1' and ifnull(delete_Flag,'0') !='1'
</select> </select>
...@@ -63,7 +57,7 @@ ...@@ -63,7 +57,7 @@
from jsh_depothead dh inner join jsh_supplier s on dh.OrganId = s.id and ifnull(s.delete_Flag,'0') !='1' from jsh_depothead dh inner join jsh_supplier s on dh.OrganId = s.id and ifnull(s.delete_Flag,'0') !='1'
where 1=1 where 1=1
<if test="accountId != null"> <if test="accountId != null">
and dh.AccountId=#{accountId} and dh.AccountId=${accountId}
</if> </if>
and ifnull(dh.delete_Flag,'0') !='1' and ifnull(dh.delete_Flag,'0') !='1'
...@@ -73,7 +67,7 @@ ...@@ -73,7 +67,7 @@
from jsh_accounthead ah inner join jsh_supplier s on ah.OrganId=s.id and ifnull(s.delete_Flag,'0') !='1' from jsh_accounthead ah inner join jsh_supplier s on ah.OrganId=s.id and ifnull(s.delete_Flag,'0') !='1'
where 1=1 where 1=1
<if test="accountId != null"> <if test="accountId != null">
and ah.AccountId=#{accountId} and ah.AccountId=${accountId}
</if> </if>
and ifnull(ah.delete_Flag,'0') !='1' and ifnull(ah.delete_Flag,'0') !='1'
<!--明细中涉及的账户(收款,付款,收预付款) --> <!--明细中涉及的账户(收款,付款,收预付款) -->
...@@ -83,7 +77,7 @@ ...@@ -83,7 +77,7 @@
inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1' inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1'
where ah.Type in ('收款','付款','收预付款') where ah.Type in ('收款','付款','收预付款')
<if test="accountId != null"> <if test="accountId != null">
and ai.AccountId=#{accountId} and ai.AccountId=${accountId}
</if> </if>
and ifnull(ah.delete_Flag,'0') !='1' and ifnull(ah.delete_Flag,'0') !='1'
<!--主表中转出的账户 --> <!--主表中转出的账户 -->
...@@ -92,7 +86,7 @@ ...@@ -92,7 +86,7 @@
from jsh_accounthead ah inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1' from jsh_accounthead ah inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1'
where ah.Type='转账' where ah.Type='转账'
<if test="accountId != null"> <if test="accountId != null">
and ah.AccountId=#{accountId} and ah.AccountId=${accountId}
</if> </if>
and ifnull(ah.delete_Flag,'0') !='1' and ifnull(ah.delete_Flag,'0') !='1'
<!--明细中被转入的账户 --> <!--明细中被转入的账户 -->
...@@ -101,7 +95,7 @@ ...@@ -101,7 +95,7 @@
from jsh_accounthead ah inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1' from jsh_accounthead ah inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1'
where ah.Type='转账' where ah.Type='转账'
<if test="accountId != null"> <if test="accountId != null">
and ai.AccountId=#{accountId} and ai.AccountId=${accountId}
</if> </if>
and ifnull(ah.delete_Flag,'0') !='1' and ifnull(ah.delete_Flag,'0') !='1'
<!--多账户的情况 --> <!--多账户的情况 -->
...@@ -111,8 +105,7 @@ ...@@ -111,8 +105,7 @@
from jsh_depothead dh inner join jsh_supplier s on dh.OrganId = s.id and ifnull(s.delete_Flag,'0') !='1' from jsh_depothead dh inner join jsh_supplier s on dh.OrganId = s.id and ifnull(s.delete_Flag,'0') !='1'
where 1=1 where 1=1
<if test="accountId != null"> <if test="accountId != null">
<bind name="accountId" value="'%' + _parameter.accountId + '%'"/> and dh.AccountIdList like '%${accountId}%'
and dh.AccountIdList like #{accountId}
</if> </if>
and ifnull(dh.delete_Flag,'0') !='1' and ifnull(dh.delete_Flag,'0') !='1'
ORDER BY oTime desc ORDER BY oTime desc
...@@ -129,7 +122,7 @@ ...@@ -129,7 +122,7 @@
from jsh_depothead dh inner join jsh_supplier s on dh.OrganId = s.id and ifnull(s.delete_Flag,'0') !='1' from jsh_depothead dh inner join jsh_supplier s on dh.OrganId = s.id and ifnull(s.delete_Flag,'0') !='1'
where 1=1 where 1=1
<if test="accountId != null"> <if test="accountId != null">
and dh.AccountId=#{accountId} and dh.AccountId=${accountId}
</if> </if>
and ifnull(dh.delete_Flag,'0') !='1' and ifnull(dh.delete_Flag,'0') !='1'
<!--主表收入和支出涉及的账户 --> <!--主表收入和支出涉及的账户 -->
...@@ -138,7 +131,7 @@ ...@@ -138,7 +131,7 @@
from jsh_accounthead ah inner join jsh_supplier s on ah.OrganId=s.id and ifnull(s.delete_Flag,'0') !='1' from jsh_accounthead ah inner join jsh_supplier s on ah.OrganId=s.id and ifnull(s.delete_Flag,'0') !='1'
where 1=1 where 1=1
<if test="accountId != null"> <if test="accountId != null">
and ah.AccountId=#{accountId} and ah.AccountId=${accountId}
</if> </if>
and ifnull(ah.delete_Flag,'0') !='1' and ifnull(ah.delete_Flag,'0') !='1'
<!--明细中涉及的账户(收款,付款,收预付款) --> <!--明细中涉及的账户(收款,付款,收预付款) -->
...@@ -148,7 +141,7 @@ ...@@ -148,7 +141,7 @@
inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1' inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1'
where ah.Type in ('收款','付款','收预付款') where ah.Type in ('收款','付款','收预付款')
<if test="accountId != null"> <if test="accountId != null">
and ai.AccountId=#{accountId} and ai.AccountId=${accountId}
</if> </if>
and ifnull(ah.delete_Flag,'0') !='1' and ifnull(ah.delete_Flag,'0') !='1'
<!--主表中转出的账户 --> <!--主表中转出的账户 -->
...@@ -157,7 +150,7 @@ ...@@ -157,7 +150,7 @@
from jsh_accounthead ah inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1' from jsh_accounthead ah inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1'
where ah.Type='转账' where ah.Type='转账'
<if test="accountId != null"> <if test="accountId != null">
and ah.AccountId=#{accountId} and ah.AccountId=${accountId}
</if> </if>
and ifnull(ah.delete_Flag,'0') !='1' and ifnull(ah.delete_Flag,'0') !='1'
<!--明细中被转入的账户 --> <!--明细中被转入的账户 -->
...@@ -166,7 +159,7 @@ ...@@ -166,7 +159,7 @@
from jsh_accounthead ah inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1' from jsh_accounthead ah inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1'
where ah.Type='转账' where ah.Type='转账'
<if test="accountId != null"> <if test="accountId != null">
and ai.AccountId=#{accountId} and ai.AccountId=${accountId}
</if> </if>
and ifnull(ah.delete_Flag,'0') !='1' and ifnull(ah.delete_Flag,'0') !='1'
<!--多账户的情况 --> <!--多账户的情况 -->
...@@ -175,8 +168,7 @@ ...@@ -175,8 +168,7 @@
from jsh_depothead dh inner join jsh_supplier s on dh.OrganId = s.id and ifnull(s.delete_Flag,'0') !='1' from jsh_depothead dh inner join jsh_supplier s on dh.OrganId = s.id and ifnull(s.delete_Flag,'0') !='1'
where 1=1 where 1=1
<if test="accountId != null"> <if test="accountId != null">
<bind name="accountId" value="'%' + _parameter.accountId + '%'"/> and dh.AccountIdList like '%${accountId}%'
and dh.AccountIdList like #{accountId}
</if> </if>
and ifnull(dh.delete_Flag,'0') !='1' and ifnull(dh.delete_Flag,'0') !='1'
) cc ) cc
......
...@@ -42,8 +42,9 @@ ...@@ -42,8 +42,9 @@
</resultMap> </resultMap>
<select id="selectByConditionDepotHead" parameterType="com.jsh.erp.datasource.entities.DepotHeadExample" resultMap="ResultMapEx"> <select id="selectByConditionDepotHead" parameterType="com.jsh.erp.datasource.entities.DepotHeadExample" resultMap="ResultMapEx">
select dh.*, s.supplier OrganName, p.name HandsPersonName, a.name AccountName select distinct dh.*, d.name ProjectName, s.supplier OrganName, p.name HandsPersonName, a.name AccountName, dd.name AllocationProjectName
from jsh_depothead dh from jsh_depothead dh
left join jsh_depot d on dh.ProjectId=d.id and ifnull(d.delete_Flag,'0') !='1'
left join jsh_supplier s on dh.OrganId=s.id and ifnull(s.delete_Flag,'0') !='1' left join jsh_supplier s on dh.OrganId=s.id and ifnull(s.delete_Flag,'0') !='1'
left join jsh_person p on dh.HandsPersonId=p.id and ifnull(p.delete_Flag,'0') !='1' left join jsh_person p on dh.HandsPersonId=p.id and ifnull(p.delete_Flag,'0') !='1'
left join jsh_account a on dh.AccountId=a.id and ifnull(a.delete_Flag,'0') !='1' left join jsh_account a on dh.AccountId=a.id and ifnull(a.delete_Flag,'0') !='1'
...@@ -51,41 +52,28 @@ ...@@ -51,41 +52,28 @@
left join jsh_depotitem di on dh.Id = di.HeaderId and ifnull(di.delete_Flag,'0') !='1' left join jsh_depotitem di on dh.Id = di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
left join jsh_material m on di.MaterialId = m.Id and ifnull(m.delete_Flag,'0') !='1' left join jsh_material m on di.MaterialId = m.Id and ifnull(m.delete_Flag,'0') !='1'
where 1=1 where 1=1
<if test="type != null and type != ''"> <if test="type != null">
and dh.Type=#{type} and dh.Type='${type}'
</if> </if>
<if test="subType != null and subType != ''"> <if test="subType != null">
and dh.SubType=#{subType} and dh.SubType='${subType}'
</if> </if>
<if test="number != null and number != ''"> <if test="number != null">
<bind name="number" value="'%' + _parameter.number + '%'"/> and dh.Number like '%${number}%'
and dh.Number like #{number}
</if> </if>
<if test="beginTime != null and beginTime != ''"> <if test="beginTime != null">
and dh.OperTime >= #{beginTime} and dh.OperTime >= '${beginTime}'
</if> </if>
<if test="endTime != null and endTime != ''"> <if test="endTime != null">
and dh.OperTime &lt;= #{endTime} and dh.OperTime &lt;= '${endTime}'
</if> </if>
and ifnull(dh.delete_Flag,'0') !='1' <if test="materialParam != null">
and exists ( and (m.`Name` like '%${materialParam}%' or m.Model like '%${materialParam}%')
select 0 from jsh_depotitem di
left join jsh_material m on di.MaterialId = m.Id and ifnull(m.delete_Flag,'0') !='1' and di.tenant_id=m.tenant_id
where 1=1
and dh.Id = di.HeaderId
and dh.tenant_id=di.tenant_id
and ifnull(di.delete_Flag,'0') !='1'
<if test="materialParam != null and materialParam != ''">
<bind name="materialParam" value="'%' + _parameter.materialParam + '%'"/>
and (m.Name like #{materialParam} or m.Model like #{materialParam})
</if>
<if test="depotIds != null and depotIds != ''">
and di.DepotId in
<foreach item="did" index="index" collection="depotIds.split(',')" open="(" separator="," close=")">
#{did}
</foreach>
</if> </if>
) <if test="depotIds != null">
and di.DepotId in (${depotIds})
</if>
and ifnull(dh.delete_Flag,'0') !='1'
order by dh.Id desc order by dh.Id desc
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
limit #{offset},#{rows} limit #{offset},#{rows}
...@@ -93,48 +81,35 @@ ...@@ -93,48 +81,35 @@
</select> </select>
<select id="countsByDepotHead" resultType="java.lang.Long"> <select id="countsByDepotHead" resultType="java.lang.Long">
SELECT SELECT
COUNT(dh.id) COUNT(1) from
FROM jsh_depothead dh (select distinct jsh_depothead.* FROM jsh_depothead
left join jsh_supplier s on dh.OrganId=s.id and ifnull(s.delete_Flag,'0') !='1' left join jsh_depotitem di on jsh_depothead.Id = di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
left join jsh_person p on dh.HandsPersonId=p.id and ifnull(p.delete_Flag,'0') !='1' left join jsh_material m on di.MaterialId = m.Id and ifnull(m.delete_Flag,'0') !='1'
left join jsh_account a on dh.AccountId=a.id and ifnull(a.delete_Flag,'0') !='1'
WHERE 1=1 WHERE 1=1
<if test="type != null and type != ''"> <if test="type != null">
and dh.Type=#{type} and Type='${type}'
</if>
<if test="subType != null">
and SubType='${subType}'
</if> </if>
<if test="subType != null and subType != ''"> <if test="number != null">
and dh.SubType=#{subType} and Number like '%${number}%'
</if> </if>
<if test="number != null and number != ''"> <if test="beginTime != null">
<bind name="number" value="'%' + _parameter.number + '%'"/> and OperTime >= '${beginTime}'
and dh.Number like #{number}
</if> </if>
<if test="beginTime != null and beginTime != ''"> <if test="endTime != null">
and dh.OperTime >= #{beginTime} and OperTime &lt;= '${endTime}'
</if> </if>
<if test="endTime != null and endTime != ''"> <if test="materialParam != null">
and dh.OperTime &lt;= #{endTime} and (m.`Name` like '%${materialParam}%' or m.Model like '%${materialParam}%')
</if> </if>
and ifnull(dh.delete_Flag,'0') !='1' <if test="depotIds != null">
and exists ( and di.DepotId in (${depotIds})
select 0 from jsh_depotitem di
left join jsh_material m on di.MaterialId = m.Id and ifnull(m.delete_Flag,'0') !='1' and di.tenant_id=m.tenant_id
where 1=1
and dh.Id = di.HeaderId
and dh.tenant_id=di.tenant_id
and ifnull(di.delete_Flag,'0') !='1'
<if test="materialParam != null and materialParam != ''">
<bind name="materialParam" value="'%' + _parameter.materialParam + '%'"/>
and (m.Name like #{materialParam} or m.Model like #{materialParam})
</if>
<if test="depotIds != null and depotIds != ''">
and di.DepotId in
<foreach item="did" index="index" collection="depotIds.split(',')" open="(" separator="," close=")">
#{did}
</foreach>
</if> </if>
) and ifnull(jsh_depothead.delete_Flag,'0') !='1') tb
</select> </select>
<select id="getMaxId" resultType="java.lang.Long"> <select id="getMaxId" resultType="java.lang.Long">
select max(Id) as Id from jsh_depothead select max(Id) as Id from jsh_depothead
</select> </select>
...@@ -143,7 +118,7 @@ ...@@ -143,7 +118,7 @@
select group_concat(concat(jsh_material.`Name`,' ',jsh_material.Model)) as mName select group_concat(concat(jsh_material.`Name`,' ',jsh_material.Model)) as mName
from jsh_depotitem from jsh_depotitem
inner join jsh_material on jsh_depotitem.MaterialId = jsh_material.Id and ifnull(jsh_material.delete_Flag,'0') !='1' inner join jsh_material on jsh_depotitem.MaterialId = jsh_material.Id and ifnull(jsh_material.delete_Flag,'0') !='1'
where jsh_depotitem.HeaderId = #{id} where jsh_depotitem.HeaderId = ${id}
and ifnull(jsh_depotitem.delete_Flag,'0') !='1' and ifnull(jsh_depotitem.delete_Flag,'0') !='1'
</select> </select>
...@@ -155,21 +130,18 @@ ...@@ -155,21 +130,18 @@
inner join jsh_material m on m.id=di.MaterialId and ifnull(m.delete_Flag,'0') !='1' inner join jsh_material m on m.id=di.MaterialId and ifnull(m.delete_Flag,'0') !='1'
inner join jsh_supplier s on s.id=dh.OrganId and ifnull(s.delete_Flag,'0') !='1' inner join jsh_supplier s on s.id=dh.OrganId and ifnull(s.delete_Flag,'0') !='1'
inner join (select id,name as dName,delete_Flag from jsh_depot ) d on d.id=di.DepotId and ifnull(d.delete_Flag,'0') !='1' inner join (select id,name as dName,delete_Flag from jsh_depot ) d on d.id=di.DepotId and ifnull(d.delete_Flag,'0') !='1'
where dh.OperTime >=#{beginTime} and dh.OperTime &lt;=#{endTime} where dh.OperTime >='${beginTime}' and dh.OperTime &lt;='${endTime}'
<if test="oId != null"> <if test="oId != null">
and dh.OrganId = #{oId} and dh.OrganId = ${oId}
</if> </if>
<if test="pid != null"> <if test="pid != null">
and di.DepotId = #{pid} and di.DepotId = ${pid}
</if> </if>
<if test="pid == null and dids != null and dids != ''"> <if test="pid == null">
and di.DepotId in and di.DepotId in (${dids})
<foreach item="did" index="index" collection="dids.split(',')" open="(" separator="," close=")">
#{did}
</foreach>
</if> </if>
<if test="type != null and type != ''"> <if test="type != null">
and dh.Type=#{type} and dh.Type='${type}'
</if> </if>
and ifnull(dh.delete_Flag,'0') !='1' and ifnull(dh.delete_Flag,'0') !='1'
ORDER BY OperTime DESC,Number desc ORDER BY OperTime DESC,Number desc
...@@ -185,21 +157,18 @@ ...@@ -185,21 +157,18 @@
inner join jsh_material m on m.id=di.MaterialId and ifnull(m.delete_Flag,'0') !='1' inner join jsh_material m on m.id=di.MaterialId and ifnull(m.delete_Flag,'0') !='1'
inner join jsh_supplier s on s.id=dh.OrganId and ifnull(s.delete_Flag,'0') !='1' inner join jsh_supplier s on s.id=dh.OrganId and ifnull(s.delete_Flag,'0') !='1'
inner join (select id,name as dName,delete_Flag from jsh_depot) d on d.id=di.DepotId and ifnull(d.delete_Flag,'0') !='1' inner join (select id,name as dName,delete_Flag from jsh_depot) d on d.id=di.DepotId and ifnull(d.delete_Flag,'0') !='1'
where dh.OperTime >=#{beginTime} and dh.OperTime &lt;=#{endTime} where dh.OperTime >='${beginTime}' and dh.OperTime &lt;='${endTime}'
<if test="oId != null"> <if test="oId != null">
and dh.OrganId = #{oId} and dh.OrganId = ${oId}
</if> </if>
<if test="pid != null"> <if test="pid != null">
and di.DepotId = #{pid} and di.DepotId = ${pid}
</if> </if>
<if test="pid == null and dids != null and dids != ''"> <if test="pid == null">
and di.DepotId in and di.DepotId in (${dids})
<foreach item="did" index="index" collection="dids.split(',')" open="(" separator="," close=")">
#{did}
</foreach>
</if> </if>
<if test="type != null and type != ''"> <if test="type != null">
and dh.Type=#{type} and dh.Type='${type}'
</if> </if>
and ifnull(dh.delete_Flag,'0') !='1' and ifnull(dh.delete_Flag,'0') !='1'
ORDER BY OperTime DESC,Number desc ORDER BY OperTime DESC,Number desc
...@@ -211,18 +180,15 @@ ...@@ -211,18 +180,15 @@
(select sum(jdi.BasicNumber) numSum from jsh_depothead jdh (select sum(jdi.BasicNumber) numSum from jsh_depothead jdh
INNER JOIN jsh_depotitem jdi on jdh.id=jdi.HeaderId and ifnull(jdi.delete_Flag,'0') !='1' INNER JOIN jsh_depotitem jdi on jdh.id=jdi.HeaderId and ifnull(jdi.delete_Flag,'0') !='1'
where jdi.MaterialId=di.MaterialId where jdi.MaterialId=di.MaterialId
and jdh.type=#{type} and jdh.OperTime >=#{beginTime} and jdh.OperTime &lt;=#{endTime} and jdh.type='${type}' and jdh.OperTime >='${beginTime}' and jdh.OperTime &lt;='${endTime}'
<if test="oId != null"> <if test="oId != null">
and jdh.OrganId = #{oId} and jdh.OrganId = ${oId}
</if> </if>
<if test="pid != null"> <if test="pid != null">
and jdi.DepotId= #{pid} and jdi.DepotId= ${pid}
</if> </if>
<if test="pid == null and dids != null and dids != ''"> <if test="pid == null">
and jdi.DepotId in and jdi.DepotId in (${dids})
<foreach item="did" index="index" collection="dids.split(',')" open="(" separator="," close=")">
#{did}
</foreach>
</if> </if>
and ifnull(jdh.delete_Flag,'0') !='1' and ifnull(jdh.delete_Flag,'0') !='1'
) numSum, ) numSum,
...@@ -230,18 +196,15 @@ ...@@ -230,18 +196,15 @@
(select sum(jdi.AllPrice) priceSum from jsh_depothead jdh (select sum(jdi.AllPrice) priceSum from jsh_depothead jdh
INNER JOIN jsh_depotitem jdi on jdh.id=jdi.HeaderId and ifnull(jdi.delete_Flag,'0') !='1' INNER JOIN jsh_depotitem jdi on jdh.id=jdi.HeaderId and ifnull(jdi.delete_Flag,'0') !='1'
where jdi.MaterialId=di.MaterialId where jdi.MaterialId=di.MaterialId
and jdh.type=#{type} and jdh.OperTime >=#{beginTime} and jdh.OperTime &lt;=#{endTime} and jdh.type='${type}' and jdh.OperTime >='${beginTime}' and jdh.OperTime &lt;='${endTime}'
<if test="oId != null"> <if test="oId != null">
and jdh.OrganId = #{oId} and jdh.OrganId = ${oId}
</if> </if>
<if test="pid != null"> <if test="pid != null">
and jdi.DepotId= #{pid} and jdi.DepotId= ${pid}
</if> </if>
<if test="pid == null and dids != null and dids != ''"> <if test="pid == null">
and jdi.DepotId in and jdi.DepotId in (${dids})
<foreach item="did" index="index" collection="dids.split(',')" open="(" separator="," close=")">
#{did}
</foreach>
</if> </if>
and ifnull(jdh.delete_Flag,'0') !='1' and ifnull(jdh.delete_Flag,'0') !='1'
) priceSum ) priceSum
...@@ -252,18 +215,15 @@ ...@@ -252,18 +215,15 @@
LEFT JOIN jsh_materialcategory on jsh_material.CategoryId=jsh_materialcategory.Id and ifnull(jsh_materialcategory.status,'0') !='2' LEFT JOIN jsh_materialcategory on jsh_material.CategoryId=jsh_materialcategory.Id and ifnull(jsh_materialcategory.status,'0') !='2'
where ifnull(jsh_material.delete_Flag,'0') !='1' where ifnull(jsh_material.delete_Flag,'0') !='1'
) m ) m
on m.Id=di.MaterialId where dh.type=#{type} and dh.OperTime >=#{beginTime} and dh.OperTime &lt;=#{endTime} on m.Id=di.MaterialId where dh.type='${type}' and dh.OperTime >='${beginTime}' and dh.OperTime &lt;='${endTime}'
<if test="oId != null"> <if test="oId != null">
and dh.OrganId = #{oId} and dh.OrganId = ${oId}
</if> </if>
<if test="pid != null"> <if test="pid != null">
and di.DepotId= #{pid} and di.DepotId= ${pid}
</if> </if>
<if test="pid == null and dids != null and dids != ''"> <if test="pid == null">
and di.DepotId in and di.DepotId in (${dids})
<foreach item="did" index="index" collection="dids.split(',')" open="(" separator="," close=")">
#{did}
</foreach>
</if> </if>
and ifnull(dh.delete_Flag,'0') !='1' and ifnull(dh.delete_Flag,'0') !='1'
GROUP BY di.MaterialId,m.mName,m.Model,m.categoryName GROUP BY di.MaterialId,m.mName,m.Model,m.categoryName
...@@ -280,18 +240,15 @@ ...@@ -280,18 +240,15 @@
from jsh_material from jsh_material
LEFT JOIN jsh_materialcategory on jsh_material.CategoryId=jsh_materialcategory.Id and ifnull(jsh_materialcategory.status,'0') !='2' LEFT JOIN jsh_materialcategory on jsh_material.CategoryId=jsh_materialcategory.Id and ifnull(jsh_materialcategory.status,'0') !='2'
where ifnull(jsh_material.delete_Flag,'0') !='1' where ifnull(jsh_material.delete_Flag,'0') !='1'
) m on m.Id=di.MaterialId where dh.type=#{type} and dh.OperTime >=#{beginTime} and dh.OperTime &lt;=#{endTime} ) m on m.Id=di.MaterialId where dh.type='${type}' and dh.OperTime >='${beginTime}' and dh.OperTime &lt;='${endTime}'
<if test="oId != null"> <if test="oId != null">
and dh.OrganId = #{oId} and dh.OrganId = ${oId}
</if> </if>
<if test="pid != null"> <if test="pid != null">
and di.DepotId= #{pid} and di.DepotId= ${pid}
</if> </if>
<if test="pid == null and dids != null and dids != ''"> <if test="pid == null">
and di.DepotId in and di.DepotId in (${dids})
<foreach item="did" index="index" collection="dids.split(',')" open="(" separator="," close=")">
#{did}
</foreach>
</if> </if>
and ifnull(dh.delete_Flag,'0') !='1' and ifnull(dh.delete_Flag,'0') !='1'
GROUP BY di.MaterialId,m.mName,m.Model,m.categoryName) a GROUP BY di.MaterialId,m.mName,m.Model,m.categoryName) a
...@@ -301,20 +258,20 @@ ...@@ -301,20 +258,20 @@
select dh.Number,concat(dh.SubType,dh.Type) as type,dh.DiscountLastMoney,dh.ChangeAmount,s.supplier supplierName, select dh.Number,concat(dh.SubType,dh.Type) as type,dh.DiscountLastMoney,dh.ChangeAmount,s.supplier supplierName,
date_format(dh.OperTime,'%Y-%m-%d %H:%i:%S') as oTime from jsh_depothead dh date_format(dh.OperTime,'%Y-%m-%d %H:%i:%S') as oTime from jsh_depothead dh
inner join jsh_supplier s on s.id=dh.OrganId and ifnull(s.delete_Flag,'0') !='1' inner join jsh_supplier s on s.id=dh.OrganId and ifnull(s.delete_Flag,'0') !='1'
where s.type=#{supType} and (dh.SubType!='其它' and dh.SubType!='采购订单' and dh.SubType!='销售订单') where s.type='${supType}' and (dh.SubType!='其它' and dh.SubType!='采购订单' and dh.SubType!='销售订单')
and dh.OperTime >=#{beginTime} and dh.OperTime &lt;=#{endTime} and dh.OperTime >='${beginTime}' and dh.OperTime &lt;='${endTime}'
<if test="organId != null"> <if test="organId != null">
and dh.OrganId=#{organId} and dh.OrganId=${organId}
</if> </if>
and ifnull(dh.delete_Flag,'0') !='1' and ifnull(dh.delete_Flag,'0') !='1'
UNION ALL UNION ALL
select ah.BillNo Number,ah.Type as newType,ah.TotalPrice DiscountLastMoney,ah.ChangeAmount,s.supplier supplierName, select ah.BillNo Number,ah.Type as newType,ah.TotalPrice DiscountLastMoney,ah.ChangeAmount,s.supplier supplierName,
date_format(ah.BillTime,'%Y-%m-%d %H:%i:%S') as oTime from jsh_accounthead ah date_format(ah.BillTime,'%Y-%m-%d %H:%i:%S') as oTime from jsh_accounthead ah
inner join jsh_supplier s on s.id=ah.OrganId and ifnull(s.delete_Flag,'0') !='1' inner join jsh_supplier s on s.id=ah.OrganId and ifnull(s.delete_Flag,'0') !='1'
where s.type=#{supType} where s.type='${supType}'
and ah.BillTime >=#{beginTime} and ah.BillTime &lt;=#{endTime} and ah.BillTime >='${beginTime}' and ah.BillTime &lt;='${endTime}'
<if test="organId != null"> <if test="organId != null">
and ah.OrganId=#{organId} and ah.OrganId=${organId}
</if> </if>
and ifnull(ah.delete_Flag,'0') !='1' and ifnull(ah.delete_Flag,'0') !='1'
ORDER BY oTime ORDER BY oTime
...@@ -328,27 +285,27 @@ ...@@ -328,27 +285,27 @@
( (
select count(1) a from jsh_depothead dh select count(1) a from jsh_depothead dh
inner join jsh_supplier s on s.id=dh.OrganId and ifnull(s.delete_Flag,'0') !='1' inner join jsh_supplier s on s.id=dh.OrganId and ifnull(s.delete_Flag,'0') !='1'
where s.type=#{supType} and (dh.SubType!='其它' and dh.SubType!='采购订单' and dh.SubType!='销售订单') where s.type='${supType}' and (dh.SubType!='其它' and dh.SubType!='采购订单' and dh.SubType!='销售订单')
and dh.OperTime >=#{beginTime} and dh.OperTime &lt;=#{endTime} and dh.OperTime >='${beginTime}' and dh.OperTime &lt;='${endTime}'
<if test="organId != null"> <if test="organId != null">
and dh.OrganId=#{organId} and dh.OrganId=${organId}
</if> </if>
and ifnull(dh.delete_Flag,'0') !='1' and ifnull(dh.delete_Flag,'0') !='1'
UNION ALL UNION ALL
select count(1) a from jsh_accounthead ah select count(1) a from jsh_accounthead ah
inner join jsh_supplier s on s.id=ah.OrganId and ifnull(s.delete_Flag,'0') !='1' inner join jsh_supplier s on s.id=ah.OrganId and ifnull(s.delete_Flag,'0') !='1'
where s.type=#{supType} where s.type='${supType}'
and ah.BillTime >=#{beginTime} and ah.BillTime &lt;=#{endTime} and ah.BillTime >='${beginTime}' and ah.BillTime &lt;='${endTime}'
<if test="organId != null"> <if test="organId != null">
and ah.OrganId=#{organId} and ah.OrganId=${organId}
</if> </if>
and ifnull(ah.delete_Flag,'0') !='1' and ifnull(ah.delete_Flag,'0') !='1'
) cc ) cc
</select> </select>
<select id="findAllMoney" resultType="java.math.BigDecimal"> <select id="findAllMoney" resultType="java.math.BigDecimal">
select sum(#{modeName}) as allMoney from jsh_depothead where Type=#{type} and SubType = #{subType} select sum(${modeName}) as allMoney from jsh_depothead where Type='${type}' and SubType = '${subType}'
and OrganId =#{supplierId} and OperTime &lt;=#{endTime} and OrganId =${supplierId} and OperTime &lt;='${endTime}'
and ifnull(delete_Flag,'0') !='1' and ifnull(delete_Flag,'0') !='1'
</select> </select>
...@@ -362,7 +319,7 @@ ...@@ -362,7 +319,7 @@
left join jsh_depot dd on dh.AllocationProjectId=dd.id and ifnull(dd.delete_Flag,'0') !='1' left join jsh_depot dd on dh.AllocationProjectId=dd.id and ifnull(dd.delete_Flag,'0') !='1'
where 1=1 where 1=1
<if test="number != null"> <if test="number != null">
and dh.Number=#{number} and dh.Number='${number}'
</if> </if>
and ifnull(dh.delete_Flag,'0') !='1' and ifnull(dh.delete_Flag,'0') !='1'
</select> </select>
...@@ -477,8 +434,13 @@ ...@@ -477,8 +434,13 @@
</set> </set>
where Id = #{id,jdbcType=BIGINT} where Id = #{id,jdbcType=BIGINT}
</update> </update>
<update id="updateBuildOnlyNumber">
update tbl_sequence set current_val = current_val + 1 where seq_name = 'depot_number_seq'
</update>
<select id="getBuildOnlyNumber" resultType="java.lang.Long"> <select id="getBuildOnlyNumber" resultType="java.lang.Long">
select _nextval(#{seq_name}) from dual; select current_val from tbl_sequence where seq_name = 'depot_number_seq'
</select> </select>
<update id="batchDeleteDepotHeadByIds"> <update id="batchDeleteDepotHeadByIds">
......
...@@ -7,8 +7,6 @@ ...@@ -7,8 +7,6 @@
<result column="newType" jdbcType="VARCHAR" property="newtype" /> <result column="newType" jdbcType="VARCHAR" property="newtype" />
<result column="b_num" jdbcType="BIGINT" property="bnum" /> <result column="b_num" jdbcType="BIGINT" property="bnum" />
<result column="oTime" jdbcType="TIMESTAMP" property="otime" /> <result column="oTime" jdbcType="TIMESTAMP" property="otime" />
<result column="depotName" jdbcType="VARCHAR" property="depotName" />
<result column="depotInName" jdbcType="VARCHAR" property="depotInName" />
</resultMap> </resultMap>
<resultMap extends="com.jsh.erp.datasource.mappers.DepotItemMapper.BaseResultMap" id="ResultAndMaterialMap" type="com.jsh.erp.datasource.entities.DepotItemVo4Material"> <resultMap extends="com.jsh.erp.datasource.mappers.DepotItemMapper.BaseResultMap" id="ResultAndMaterialMap" type="com.jsh.erp.datasource.entities.DepotItemVo4Material">
...@@ -65,16 +63,14 @@ ...@@ -65,16 +63,14 @@
select * select *
FROM jsh_depotitem FROM jsh_depotitem
where 1=1 where 1=1
<if test="name != null and name != ''"> <if test="name != null">
<bind name="name" value="'%' + _parameter.name + '%'"/> and name like '%${name}%'
and name like #{name}
</if> </if>
<if test="type != null"> <if test="type != null">
and type=#{type} and type=${type}
</if> </if>
<if test="remark != null and remark != ''"> <if test="remark != null">
<bind name="remark" value="'%' + _parameter.remark + '%'"/> and remark like '%${remark}%'
and remark like #{remark}
</if> </if>
and ifnull(delete_Flag,'0') !='1' and ifnull(delete_Flag,'0') !='1'
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
...@@ -87,32 +83,20 @@ ...@@ -87,32 +83,20 @@
COUNT(id) COUNT(id)
FROM jsh_depotitem FROM jsh_depotitem
WHERE 1=1 WHERE 1=1
<if test="name != null and name != ''"> <if test="name != null">
<bind name="name" value="'%' + _parameter.name + '%'"/> and name like '%${name}%'
and name like #{name}
</if> </if>
<if test="type != null"> <if test="type != null">
and type=#{type} and type=${type}
</if> </if>
<if test="remark != null and remark != ''"> <if test="remark != null">
<bind name="remark" value="'%' + _parameter.remark + '%'"/> and remark like '%${remark}%'
and remark like #{remark}
</if> </if>
and ifnull(delete_Flag,'0') !='1' and ifnull(delete_Flag,'0') !='1'
</select> </select>
<select id="findDetailByTypeAndMaterialIdList" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="DetailByTypeAndMIdResultMap"> <select id="findDetailByTypeAndMaterialIdList" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="DetailByTypeAndMIdResultMap">
select dh.Number,concat(dh.SubType,dh.Type) as newType, select dh.Number,concat(dh.SubType,dh.Type) as newType,
case when dh.type='入库' then ifnull(di.BasicNumber,0)
when dh.type='出库' and dh.SubType!='调拨' then 0 - ifnull(di.BasicNumber,0)
when dh.SubType='组装单' and di.MType='组合件' then ifnull(di.BasicNumber,0)
when dh.SubType='组装单' and di.MType='普通子件' then 0-ifnull(di.BasicNumber,0)
when dh.SubType='拆卸单' and di.MType='普通子件' then ifnull(di.BasicNumber,0)
when dh.SubType='拆卸单' and di.MType='组合件' then 0-ifnull(di.BasicNumber,0)
when dh.SubType='调拨' then 0-ifnull(di.BasicNumber,0)
else 0 end as b_num,
date_format(dh.OperTime,'%Y-%m-%d %H:%i:%S') as oTime,
depot.name as depotName,depotIn.name as depotInName
case case
when type='入库' then ifnull(di.BasicNumber,0) when type='入库' then ifnull(di.BasicNumber,0)
when type='出库' then 0-di.BasicNumber when type='出库' then 0-di.BasicNumber
...@@ -126,11 +110,6 @@ ...@@ -126,11 +110,6 @@
date_format(dh.OperTime,'%Y-%m-%d %H:%i:%S') as oTime date_format(dh.OperTime,'%Y-%m-%d %H:%i:%S') as oTime
from jsh_depothead dh from jsh_depothead dh
INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1' INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
left join jsh_depot depot on depot.id=di.depotId and ifnull(depot.delete_Flag,'0') !='1'
left join jsh_depot depotIn on depotIn.id=di.AnotherDepotId and ifnull(depotIn.delete_Flag,'0') !='1'
where 1=1
and dh.SubType not in('采购订单','销售订单')
and di.MaterialId =#{mId}
where ((dh.type!='其它' and dh.SubType!='调拨') where ((dh.type!='其它' and dh.SubType!='调拨')
or (dh.type='其它' and dh.SubType='组装单') or (dh.type='其它' and dh.SubType='组装单')
or (dh.type='其它' and dh.SubType='拆卸单')) or (dh.type='其它' and dh.SubType='拆卸单'))
...@@ -146,28 +125,12 @@ ...@@ -146,28 +125,12 @@
select count(1) select count(1)
from jsh_depothead dh from jsh_depothead dh
INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1' INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
left join jsh_depot depot on depot.id=di.depotId and ifnull(depot.delete_Flag,'0') !='1' where dh.type!='其它'
left join jsh_depot depotIn on depotIn.id=di.AnotherDepotId and ifnull(depotIn.delete_Flag,'0') !='1'
where 1=1
and dh.SubType not in('采购订单','销售订单')
and di.MaterialId =#{mId}
and ifnull(dh.delete_Flag,'0') !='1'
</select>
<select id="findByTypeAndDepotIdAndMaterialIdIn" resultType="java.lang.Integer">
select ifnull(sum(BasicNumber),0) as BasicNumber from jsh_depothead dh
INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
where dh.type='入库'
and di.MaterialId = #{mId} and di.DepotId = #{depotId}
and ifnull(dh.delete_Flag,'0') !='1'
</select>
<select id="findByTypeAndDepotIdAndMaterialIdOut" resultType="java.lang.Integer">
select ifnull(sum(BasicNumber),0) as BasicNumber from jsh_depothead dh
INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
where dh.type='出库'
and dh.SubType!='调拨' and dh.SubType!='调拨'
and di.MaterialId = #{mId} and di.DepotId = #{depotId} and di.MaterialId =${mId}
and ifnull(dh.delete_Flag,'0') !='1' and ifnull(dh.delete_Flag,'0') !='1'
</select> </select>
<select id="getDetailList" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultWithInfoExMap"> <select id="getDetailList" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultWithInfoExMap">
select di.*,m.Name MName,m.Model MModel,m.Unit MaterialUnit,m.Color MColor,m.Standard MStandard,m.Mfrs MMfrs, select di.*,m.Name MName,m.Model MModel,m.Unit MaterialUnit,m.Color MColor,m.Standard MStandard,m.Mfrs MMfrs,
m.OtherField1 MOtherField1,m.OtherField2 MOtherField2,m.OtherField3 MOtherField3, m.OtherField1 MOtherField1,m.OtherField2 MOtherField2,m.OtherField3 MOtherField3,
...@@ -177,31 +140,26 @@ ...@@ -177,31 +140,26 @@
left join jsh_unit u on m.UnitId = u.id and ifnull(u.delete_Flag,'0') !='1' left join jsh_unit u on m.UnitId = u.id and ifnull(u.delete_Flag,'0') !='1'
left join jsh_depot dp1 on di.DepotId=dp1.id and ifnull(dp1.delete_Flag,'0') !='1' left join jsh_depot dp1 on di.DepotId=dp1.id and ifnull(dp1.delete_Flag,'0') !='1'
left join jsh_depot dp2 on di.AnotherDepotId=dp2.id and ifnull(dp2.delete_Flag,'0') !='1' left join jsh_depot dp2 on di.AnotherDepotId=dp2.id and ifnull(dp2.delete_Flag,'0') !='1'
where di.HeaderId = #{headerId} where di.HeaderId = ${headerId}
and ifnull(di.delete_Flag,'0') !='1' and ifnull(di.delete_Flag,'0') !='1'
order by di.id asc order by di.id asc
</select> </select>
<select id="findByAll" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultByMaterial"> <select id="findByAll" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultByMaterial">
select m.id MId, m.Name MName, m.Model MModel, m.Unit MaterialUnit, m.Color MColor select m.id MId, m.Name MName, m.Model MModel, m.Unit MaterialUnit, m.Color MColor,
m.PresetPriceOne, m.PriceStrategy, u.UName UName
from jsh_depotitem di from jsh_depotitem di
inner join jsh_material m on di.MaterialId=m.id and ifnull(m.delete_Flag,'0') !='1' inner join jsh_material m on di.MaterialId=m.id and ifnull(m.delete_Flag,'0') !='1'
left join jsh_unit u on m.UnitId=u.id and ifnull(u.delete_Flag,'0') !='1' left join jsh_unit u on m.UnitId=u.id and ifnull(u.delete_Flag,'0') !='1'
where 1=1 where 1=1
<if test="headIds != null and headIds != ''"> <if test="headIds != null">
and di.HeaderId in and di.HeaderId in (${headIds})
<foreach item="headId" index="index" collection="headIds.split(',')" open="(" separator="," close=")">
#{headId}
</foreach>
</if> </if>
<if test="materialIds != null and materialIds != ''"> <if test="materialIds != null">
and di.MaterialId in and di.MaterialId in (${materialIds})
<foreach item="materialId" index="index" collection="materialIds.split(',')" open="(" separator="," close=")">
#{materialId}
</foreach>
</if> </if>
and ifnull(di.delete_Flag,'0') !='1' and ifnull(di.delete_Flag,'0') !='1'
group by m.id,m.Name, m.Model, m.Unit, m.Color group by m.id,m.Name, m.Model, m.Unit, m.Color, m.PresetPriceOne, m.PriceStrategy, u.UName
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
limit #{offset},#{rows} limit #{offset},#{rows}
</if> </if>
...@@ -212,17 +170,11 @@ ...@@ -212,17 +170,11 @@
from jsh_depotitem di from jsh_depotitem di
inner join jsh_material m on di.MaterialId=m.id and ifnull(m.delete_Flag,'0') !='1' inner join jsh_material m on di.MaterialId=m.id and ifnull(m.delete_Flag,'0') !='1'
where 1=1 where 1=1
<if test="headIds != null and headIds != ''"> <if test="headIds != null">
and di.HeaderId in and di.HeaderId in (${headIds})
<foreach item="headId" index="index" collection="headIds.split(',')" open="(" separator="," close=")">
#{headId}
</foreach>
</if> </if>
<if test="materialIds != null and materialIds != ''"> <if test="materialIds != null">
and di.MaterialId in and di.MaterialId in (${materialIds})
<foreach item="materialId" index="index" collection="materialIds.split(',')" open="(" separator="," close=")">
#{materialId}
</foreach>
</if> </if>
and ifnull(di.delete_Flag,'0') !='1' and ifnull(di.delete_Flag,'0') !='1'
group by m.id) cc group by m.id) cc
...@@ -242,14 +194,10 @@ ...@@ -242,14 +194,10 @@
<select id="buyOrSalePrice" resultType="java.math.BigDecimal"> <select id="buyOrSalePrice" resultType="java.math.BigDecimal">
select ifnull(sum(AllPrice),0) as AllPrice from jsh_depotitem di,jsh_depothead dh select ifnull(sum(AllPrice),0) as AllPrice from jsh_depotitem di,jsh_depothead dh
where di.HeaderId = dh.id where di.HeaderId = dh.id
and dh.type=#{type} and dh.subType=#{subType} and dh.type='${type}' and dh.subType='${subType}'
and di.MaterialId =#{MId} and di.MaterialId =${MId}
<if test="MonthTime != null and MonthTime != ''"> and dh.OperTime &gt;= '${MonthTime}-01 00:00:00'
<bind name="MonthTimeStart" value="_parameter.MonthTime + '-01 00:00:00'"/> and dh.OperTime &lt;= '${MonthTime}-31 23:59:59'
and dh.OperTime &gt;= #{MonthTimeStart}
<bind name="MonthTimeEnd" value="_parameter.MonthTime + '-31 23:59:59'"/>
and dh.OperTime &lt;= #{MonthTimeEnd}
</if>
and ifnull(dh.delete_Flag,'0') !='1' and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1' and ifnull(di.delete_Flag,'0') !='1'
</select> </select>
...@@ -407,7 +355,7 @@ ...@@ -407,7 +355,7 @@
WHERE WHERE
dh.type = '入库' dh.type = '入库'
<if test="pid != null"> <if test="pid != null">
and di.DepotId= #{pid} and di.DepotId= ${pid}
</if> </if>
AND ifnull(dh.delete_Flag, '0') != '1' group by di.MaterialId AND ifnull(dh.delete_Flag, '0') != '1' group by di.MaterialId
) intype ON intype.MaterialId = m.id ) intype ON intype.MaterialId = m.id
...@@ -423,7 +371,7 @@ ...@@ -423,7 +371,7 @@
dh.type = '出库' dh.type = '出库'
AND dh.SubType != '调拨' AND dh.SubType != '调拨'
<if test="pid != null"> <if test="pid != null">
and di.DepotId= #{pid} and di.DepotId= ${pid}
</if> </if>
AND ifnull(dh.delete_Flag, '0') != '1' group by di.MaterialId AND ifnull(dh.delete_Flag, '0') != '1' group by di.MaterialId
) outtype ON outtype.MaterialId = m.id ) outtype ON outtype.MaterialId = m.id
...@@ -452,7 +400,7 @@ ...@@ -452,7 +400,7 @@
WHERE WHERE
dh.type = '入库' dh.type = '入库'
<if test="pid != null"> <if test="pid != null">
and di.DepotId= #{pid} and di.DepotId= ${pid}
</if> </if>
AND ifnull(dh.delete_Flag, '0') != '1' group by di.MaterialId AND ifnull(dh.delete_Flag, '0') != '1' group by di.MaterialId
) intype ON intype.MaterialId = m.id ) intype ON intype.MaterialId = m.id
...@@ -462,28 +410,6 @@ ...@@ -462,28 +410,6 @@
AND ifnull(m.delete_Flag, '0') != '1' AND ifnull(m.delete_Flag, '0') != '1'
AND intype.BasicInNumber > 0 AND intype.BasicInNumber > 0
</select> </select>
<select id="getCurrentRepByMaterialIdAndDepotId" resultType="java.math.BigDecimal">
select ((curep.inTotal+curep.transfInTotal+curep.assemInTotal+curep.disAssemInTotal)
-(curep.transfOutTotal+curep.outTotal+curep.assemOutTotal+curep.disAssemOutTotal)) as currentRepo
from
(select sum(if(dh.type='入库' <if test="depotId != null">and di.DepotId=#{depotId}</if>, di.BasicNumber,0)) as inTotal,
sum(if(dh.SubType='调拨' <if test="depotId != null">and di.AnotherDepotId=#{depotId}</if>,di.BasicNumber,0)) as transfInTotal,
sum(if(dh.SubType='调拨' <if test="depotId != null">and di.DepotId=#{depotId}</if>,di.BasicNumber,0)) as transfOutTotal,
sum(if(dh.type='出库' and dh.SubType!='调拨' <if test="depotId != null">and di.DepotId=#{depotId}</if>,di.BasicNumber,0)) as outTotal,
sum(if(dh.SubType='组装单' and di.MType='组合件' <if test="depotId != null">and di.DepotId=#{depotId}</if>,di.BasicNumber,0)) as assemInTotal,
sum(if(dh.SubType='组装单' and di.MType='普通子件' <if test="depotId != null">and di.DepotId=#{depotId}</if>,di.BasicNumber,0)) as assemOutTotal,
sum(if(dh.SubType='拆卸单' and di.MType='普通子件' <if test="depotId != null">and di.DepotId=#{depotId}</if>,di.BasicNumber,0)) as disAssemInTotal,
sum(if(dh.SubType='拆卸单' and di.MType='组合件' <if test="depotId != null"> and di.DepotId=#{depotId}</if>,di.BasicNumber,0)) as disAssemOutTotal
from
jsh_depothead dh,jsh_depotitem di
where 1=1
and dh.id=di.HeaderId
and dh.tenant_id=#{tenantId}
and di.tenant_id=#{tenantId}
and di.MaterialId=#{materialId}
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1') as curep
</select>
<select id="getFinishNumber" resultType="java.math.BigDecimal"> <select id="getFinishNumber" resultType="java.math.BigDecimal">
select sum(BasicNumber) from jsh_depotitem select sum(BasicNumber) from jsh_depotitem
......
...@@ -9,16 +9,14 @@ ...@@ -9,16 +9,14 @@
select * select *
FROM jsh_depot FROM jsh_depot
where 1=1 where 1=1
<if test="name != null and name != ''"> <if test="name != null">
<bind name="name" value="'%' + _parameter.name + '%'"/> and name like '%${name}%'
and name like #{name}
</if> </if>
<if test="type != null"> <if test="type != null">
and type=#{type} and type=${type}
</if> </if>
<if test="remark != null and remark != ''"> <if test="remark != null">
<bind name="remark" value="'%' + _parameter.remark + '%'"/> and remark like '%${remark}%'
and remark like #{remark}
</if> </if>
and ifnull(delete_Flag,'0') !='1' and ifnull(delete_Flag,'0') !='1'
order by sort asc order by sort asc
...@@ -31,16 +29,14 @@ ...@@ -31,16 +29,14 @@
COUNT(id) COUNT(id)
FROM jsh_depot FROM jsh_depot
WHERE 1=1 WHERE 1=1
<if test="name != null and name != ''"> <if test="name != null">
<bind name="name" value="'%' + _parameter.name + '%'"/> and name like '%${name}%'
and name like #{name}
</if> </if>
<if test="type != null"> <if test="type != null">
and type=#{type} and type=${type}
</if> </if>
<if test="remark != null and remark != ''"> <if test="remark != null">
<bind name="remark" value="'%' + _parameter.remark + '%'"/> and remark like '%${remark}%'
and remark like #{remark}
</if> </if>
and ifnull(delete_Flag,'0') !='1' and ifnull(delete_Flag,'0') !='1'
</select> </select>
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
<result column="PushBtn" jdbcType="VARCHAR" property="pushbtn" /> <result column="PushBtn" jdbcType="VARCHAR" property="pushbtn" />
<result column="icon" jdbcType="VARCHAR" property="icon" /> <result column="icon" jdbcType="VARCHAR" property="icon" />
<result column="delete_Flag" jdbcType="VARCHAR" property="deleteFlag" /> <result column="delete_Flag" jdbcType="VARCHAR" property="deleteFlag" />
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<!-- <!--
...@@ -91,8 +90,7 @@ ...@@ -91,8 +90,7 @@
WARNING - @mbggenerated WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
Id, Number, Name, PNumber, URL, State, Sort, Enabled, Type, PushBtn, icon,delete_Flag, Id, Number, Name, PNumber, URL, State, Sort, Enabled, Type, PushBtn, icon, delete_Flag
tenant_id
</sql> </sql>
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.FunctionsExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.FunctionsExample" resultMap="BaseResultMap">
<!-- <!--
...@@ -148,11 +146,11 @@ ...@@ -148,11 +146,11 @@
insert into jsh_functions (Id, Number, Name, insert into jsh_functions (Id, Number, Name,
PNumber, URL, State, Sort, PNumber, URL, State, Sort,
Enabled, Type, PushBtn, Enabled, Type, PushBtn,
delete_Flag, icon,tenant_id) icon, delete_Flag)
values (#{id,jdbcType=BIGINT}, #{number,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, values (#{id,jdbcType=BIGINT}, #{number,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{pnumber,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, #{state,jdbcType=BIT}, #{sort,jdbcType=VARCHAR}, #{pnumber,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, #{state,jdbcType=BIT}, #{sort,jdbcType=VARCHAR},
#{enabled,jdbcType=BIT}, #{type,jdbcType=VARCHAR}, #{pushbtn,jdbcType=VARCHAR}, #{enabled,jdbcType=BIT}, #{type,jdbcType=VARCHAR}, #{pushbtn,jdbcType=VARCHAR},
#{icon,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}) #{icon,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=VARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.Functions"> <insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.Functions">
<!-- <!--
...@@ -197,9 +195,6 @@ ...@@ -197,9 +195,6 @@
<if test="deleteFlag != null"> <if test="deleteFlag != null">
delete_Flag, delete_Flag,
</if> </if>
<if test="tenantId != null">
tenant_id,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
...@@ -238,9 +233,6 @@ ...@@ -238,9 +233,6 @@
<if test="deleteFlag != null"> <if test="deleteFlag != null">
#{deleteFlag,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=VARCHAR},
</if> </if>
<if test="tenantId != null">
#{tenantId,jdbcType=BIGINT},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="com.jsh.erp.datasource.entities.FunctionsExample" resultType="java.lang.Integer"> <select id="countByExample" parameterType="com.jsh.erp.datasource.entities.FunctionsExample" resultType="java.lang.Integer">
...@@ -296,9 +288,6 @@ ...@@ -296,9 +288,6 @@
<if test="record.deleteFlag != null"> <if test="record.deleteFlag != null">
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}, delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR},
</if> </if>
<if test="record.tenantId != null">
tenant_id = #{record.tenantId,jdbcType=BIGINT},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
...@@ -320,7 +309,6 @@ ...@@ -320,7 +309,6 @@
Enabled = #{record.enabled,jdbcType=BIT}, Enabled = #{record.enabled,jdbcType=BIT},
Type = #{record.type,jdbcType=VARCHAR}, Type = #{record.type,jdbcType=VARCHAR},
PushBtn = #{record.pushbtn,jdbcType=VARCHAR}, PushBtn = #{record.pushbtn,jdbcType=VARCHAR},
tenant_id = #{record.tenantId,jdbcType=BIGINT}
icon = #{record.icon,jdbcType=VARCHAR}, icon = #{record.icon,jdbcType=VARCHAR},
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR} delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
...@@ -367,9 +355,6 @@ ...@@ -367,9 +355,6 @@
<if test="deleteFlag != null"> <if test="deleteFlag != null">
delete_Flag = #{deleteFlag,jdbcType=VARCHAR}, delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
</if> </if>
<if test="tenantId != null">
tenant_id = #{tenantId,jdbcType=BIGINT},
</if>
</set> </set>
where Id = #{id,jdbcType=BIGINT} where Id = #{id,jdbcType=BIGINT}
</update> </update>
...@@ -388,7 +373,6 @@ ...@@ -388,7 +373,6 @@
Enabled = #{enabled,jdbcType=BIT}, Enabled = #{enabled,jdbcType=BIT},
Type = #{type,jdbcType=VARCHAR}, Type = #{type,jdbcType=VARCHAR},
PushBtn = #{pushbtn,jdbcType=VARCHAR}, PushBtn = #{pushbtn,jdbcType=VARCHAR},
tenant_id = #{tenantId,jdbcType=BIGINT}
icon = #{icon,jdbcType=VARCHAR}, icon = #{icon,jdbcType=VARCHAR},
delete_Flag = #{deleteFlag,jdbcType=VARCHAR} delete_Flag = #{deleteFlag,jdbcType=VARCHAR}
where Id = #{id,jdbcType=BIGINT} where Id = #{id,jdbcType=BIGINT}
......
...@@ -5,12 +5,11 @@ ...@@ -5,12 +5,11 @@
select * select *
FROM jsh_functions FROM jsh_functions
where 1=1 where 1=1
<if test="name != null and name != ''"> <if test="name != null">
<bind name="name" value="'%' + _parameter.name + '%'"/> and name like '%${name}%'
and name like #{name}
</if> </if>
<if test="type != null"> <if test="type != null">
and type=#{type} and type='${type}'
</if> </if>
and ifnull(delete_Flag,'0') !='1' and ifnull(delete_Flag,'0') !='1'
order by sort asc order by sort asc
...@@ -23,12 +22,11 @@ ...@@ -23,12 +22,11 @@
COUNT(id) COUNT(id)
FROM jsh_functions FROM jsh_functions
WHERE 1=1 WHERE 1=1
<if test="name != null and name != ''"> <if test="name != null">
<bind name="name" value="'%' + _parameter.name + '%'"/> and name like '%${name}%'
and name like #{name}
</if> </if>
<if test="type != null"> <if test="type != null">
and type=#{type} and type='${type}'
</if> </if>
and ifnull(delete_Flag,'0') !='1' and ifnull(delete_Flag,'0') !='1'
</select> </select>
......
...@@ -5,16 +5,14 @@ ...@@ -5,16 +5,14 @@
select * select *
FROM jsh_inoutitem FROM jsh_inoutitem
where 1=1 where 1=1
<if test="name != null and name != ''"> <if test="name != null">
<bind name="name" value="'%' + _parameter.name + '%'"/> and name like '%${name}%'
and name like #{name}
</if> </if>
<if test="type != null"> <if test="type != null">
and type=#{type} and type='${type}'
</if> </if>
<if test="remark != null and remark != ''"> <if test="remark != null">
<bind name="remark" value="'%' + _parameter.remark + '%'"/> and remark like '%${remark}%'
and remark like #{remark}
</if> </if>
and ifnull(delete_Flag,'0') !='1' and ifnull(delete_Flag,'0') !='1'
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
...@@ -26,16 +24,14 @@ ...@@ -26,16 +24,14 @@
COUNT(id) COUNT(id)
FROM jsh_inoutitem FROM jsh_inoutitem
WHERE 1=1 WHERE 1=1
<if test="name != null and name != ''"> <if test="name != null">
<bind name="name" value="'%' + _parameter.name + '%'"/> and name like '%${name}%'
and name like #{name}
</if> </if>
<if test="type != null"> <if test="type != null">
and type=#{type} and type='${type}'
</if> </if>
<if test="remark != null and remark != ''"> <if test="remark != null">
<bind name="remark" value="'%' + _parameter.remark + '%'"/> and remark like '%${remark}%'
and remark like #{remark}
</if> </if>
and ifnull(delete_Flag,'0') !='1' and ifnull(delete_Flag,'0') !='1'
</select> </select>
......
...@@ -10,29 +10,26 @@ ...@@ -10,29 +10,26 @@
FROM jsh_log l FROM jsh_log l
left join jsh_user u on l.userID = u.id and ifnull(u.status,'0') not in('1','2') left join jsh_user u on l.userID = u.id and ifnull(u.status,'0') not in('1','2')
where 1=1 where 1=1
<if test="operation != null and operation != ''"> <if test="operation != null">
<bind name="operation" value="'%' + _parameter.operation + '%'"/> and l.operation like '%${operation}%'
and l.operation like #{operation}
</if> </if>
<if test="usernameID != null"> <if test="usernameID != null">
and l.userID=#{usernameID} and l.userID=${usernameID}
</if> </if>
<if test="clientIp != null and clientIp != ''"> <if test="clientIp != null">
<bind name="clientIp" value="'%' + _parameter.clientIp + '%'"/> and l.clientIp like '%${clientIp}%'
and l.clientIp like #{clientIp}
</if> </if>
<if test="status != null"> <if test="status != null">
and l.status=#{status} and l.status=${status}
</if> </if>
<if test="beginTime != null"> <if test="beginTime != null">
and l.createtime &gt;= #{beginTime} and l.createtime &gt;= '${beginTime}'
</if> </if>
<if test="endTime != null"> <if test="endTime != null">
and l.createtime &lt;= #{endTime} and l.createtime &lt;= '${endTime}'
</if> </if>
<if test="contentdetails != null and contentdetails != ''"> <if test="contentdetails != null">
<bind name="contentdetails" value="'%' + _parameter.contentdetails + '%'"/> and l.contentdetails like '%${contentdetails}%'
and l.contentdetails like #{contentdetails}
</if> </if>
order by l.createtime desc order by l.createtime desc
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
...@@ -44,29 +41,26 @@ ...@@ -44,29 +41,26 @@
COUNT(id) COUNT(id)
FROM jsh_log FROM jsh_log
WHERE 1=1 WHERE 1=1
<if test="operation != null and operation != ''"> <if test="operation != null">
<bind name="operation" value="'%' + _parameter.operation + '%'"/> and operation like '%${operation}%'
and operation like #{operation}
</if> </if>
<if test="usernameID != null"> <if test="usernameID != null">
and userID=#{usernameID} and userID=${usernameID}
</if> </if>
<if test="clientIp != null and clientIp != ''"> <if test="clientIp != null">
<bind name="clientIp" value="'%' + _parameter.clientIp + '%'"/> and clientIp like '%${clientIp}%'
and clientIp like #{clientIp}
</if> </if>
<if test="status != null"> <if test="status != null">
and status = #{status} and status = ${status}
</if> </if>
<if test="beginTime != null"><![CDATA[ <if test="beginTime != null"><![CDATA[
and createtime >= #{beginTime} and createtime >= '${beginTime}'
]]></if> ]]></if>
<if test="endTime != null"><![CDATA[ <if test="endTime != null"><![CDATA[
and createtime <= #{endTime} and createtime <= '${endTime}'
]]></if> ]]></if>
<if test="contentdetails != null and contentdetails != ''"> <if test="contentdetails != null">
<bind name="contentdetails" value="'%' + _parameter.contentdetails + '%'"/> and contentdetails like '%${contentdetails}%'
and contentdetails like #{contentdetails}
</if> </if>
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -6,12 +6,11 @@ ...@@ -6,12 +6,11 @@
FROM jsh_materialcategory FROM jsh_materialcategory
where 1=1 where 1=1
and ifnull(status,'0') !='2' and ifnull(status,'0') !='2'
<if test="name != null and name != ''"> <if test="name != null">
<bind name="name" value="'%' + _parameter.name + '%'"/> and name like '%${name}%'
and name like #{name}
</if> </if>
<if test="parentId != null"> <if test="parentId != null">
and parentId = #{parentId} and parentId = ${parentId}
</if> </if>
and Id !=1 and Id !=1
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
...@@ -24,12 +23,11 @@ ...@@ -24,12 +23,11 @@
FROM jsh_materialcategory FROM jsh_materialcategory
WHERE 1=1 WHERE 1=1
and ifnull(status,'0') !='2' and ifnull(status,'0') !='2'
<if test="name != null and name != ''"> <if test="name != null">
<bind name="name" value="'%' + _parameter.name + '%'"/> and name like '%${name}%'
and name like #{name}
</if> </if>
<if test="parentId != null"> <if test="parentId != null">
and parentId = #{parentId} and parentId = ${parentId}
</if> </if>
and Id !=1 and Id !=1
</select> </select>
......
...@@ -16,19 +16,14 @@ ...@@ -16,19 +16,14 @@
left JOIN jsh_unit u on m.UnitId = u.id and ifnull(u.delete_Flag,'0') !='1' left JOIN jsh_unit u on m.UnitId = u.id and ifnull(u.delete_Flag,'0') !='1'
left JOIN jsh_materialcategory mc on m.CategoryId = mc.id and ifnull(mc.status,'0') !='2' left JOIN jsh_materialcategory mc on m.CategoryId = mc.id and ifnull(mc.status,'0') !='2'
where 1=1 where 1=1
<if test="name != null and name != ''"> <if test="name != null">
<bind name="name" value="'%' + _parameter.name + '%'"/> and m.name like '%${name}%'
and m.name like #{name}
</if> </if>
<if test="model != null and model != ''"> <if test="model != null">
<bind name="model" value="'%' + _parameter.model + '%'"/> and m.model like '%${model}%'
and m.model like #{model}
</if> </if>
<if test="categoryIds != null and categoryIds != ''"> <if test="categoryIds != null">
and m.CategoryId in and m.CategoryId in (${categoryIds})
<foreach item="did" index="index" collection="categoryIds.split(',')" open="(" separator="," close=")">
#{did}
</foreach>
</if> </if>
and ifnull(m.delete_Flag,'0') !='1' and ifnull(m.delete_Flag,'0') !='1'
order by m.id desc order by m.id desc
...@@ -44,19 +39,14 @@ ...@@ -44,19 +39,14 @@
left JOIN jsh_unit u on m.UnitId = u.id and ifnull(u.delete_Flag,'0') !='1' left JOIN jsh_unit u on m.UnitId = u.id and ifnull(u.delete_Flag,'0') !='1'
left JOIN jsh_materialcategory mc on m.CategoryId = mc.id and ifnull(mc.status,'0') !='2' left JOIN jsh_materialcategory mc on m.CategoryId = mc.id and ifnull(mc.status,'0') !='2'
WHERE 1=1 WHERE 1=1
<if test="name != null and name != ''"> <if test="name != null">
<bind name="name" value="'%' + _parameter.name + '%'"/> and m.name like '%${name}%'
and m.name like #{name}
</if> </if>
<if test="model != null and model != ''"> <if test="model != null">
<bind name="model" value="'%' + _parameter.model + '%'"/> and m.model like '%${model}%'
and m.model like #{model}
</if> </if>
<if test="categoryIds != null and categoryIds != ''"> <if test="categoryIds != null">
and m.CategoryId in and m.CategoryId in (${categoryIds})
<foreach item="did" index="index" collection="categoryIds.split(',')" open="(" separator="," close=")">
#{did}
</foreach>
</if> </if>
and ifnull(m.delete_Flag,'0') !='1' and ifnull(m.delete_Flag,'0') !='1'
</select> </select>
...@@ -64,14 +54,14 @@ ...@@ -64,14 +54,14 @@
<select id="findUnitName" resultType="java.lang.String"> <select id="findUnitName" resultType="java.lang.String">
select u.UName from jsh_unit u select u.UName from jsh_unit u
left join jsh_material m on m.UnitId=u.id and ifnull(m.delete_Flag,'0') !='1' left join jsh_material m on m.UnitId=u.id and ifnull(m.delete_Flag,'0') !='1'
where m.id = #{mId} where m.id = ${mId}
and ifnull(u.delete_Flag,'0') !='1' and ifnull(u.delete_Flag,'0') !='1'
</select> </select>
<select id="findById" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultAndUnitMap"> <select id="findById" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultAndUnitMap">
select m.*,u.UName from jsh_material m select m.*,u.UName from jsh_material m
left join jsh_unit u on m.UnitId=u.id and ifnull(u.delete_Flag,'0') !='1' left join jsh_unit u on m.UnitId=u.id and ifnull(u.delete_Flag,'0') !='1'
where m.id = #{id} where m.id = ${id}
and ifnull(m.delete_Flag,'0') !='1' and ifnull(m.delete_Flag,'0') !='1'
</select> </select>
...@@ -106,19 +96,14 @@ ...@@ -106,19 +96,14 @@
left JOIN jsh_unit u on m.UnitId = u.id and ifnull(u.delete_Flag,'0') !='1' left JOIN jsh_unit u on m.UnitId = u.id and ifnull(u.delete_Flag,'0') !='1'
left JOIN jsh_materialcategory mc on m.CategoryId = mc.id and ifnull(mc.status,'0') !='2' left JOIN jsh_materialcategory mc on m.CategoryId = mc.id and ifnull(mc.status,'0') !='2'
where 1=1 where 1=1
<if test="name != null and name != ''"> <if test="name != null">
<bind name="name" value="'%' + _parameter.name + '%'"/> and m.name like '%${name}%'
and m.name like #{name}
</if> </if>
<if test="model != null and model != ''"> <if test="model != null">
<bind name="model" value="'%' + _parameter.model + '%'"/> and m.model like '%${model}%'
and m.model like #{model}
</if> </if>
<if test="categoryIds != null and categoryIds != ''"> <if test="categoryIds != null">
and m.CategoryId in and m.CategoryId in (${categoryIds})
<foreach item="did" index="index" collection="categoryIds.split(',')" open="(" separator="," close=")">
#{did}
</foreach>
</if> </if>
and ifnull(m.delete_Flag,'0') !='1' and ifnull(m.delete_Flag,'0') !='1'
order by m.id desc order by m.id desc
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
<result column="sort" jdbcType="VARCHAR" property="sort" /> <result column="sort" jdbcType="VARCHAR" property="sort" />
<result column="anotherName" jdbcType="VARCHAR" property="anothername" /> <result column="anotherName" jdbcType="VARCHAR" property="anothername" />
<result column="delete_Flag" jdbcType="VARCHAR" property="deleteFlag" /> <result column="delete_Flag" jdbcType="VARCHAR" property="deleteFlag" />
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<!-- <!--
...@@ -85,7 +84,7 @@ ...@@ -85,7 +84,7 @@
WARNING - @mbggenerated WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
id, nativeName, enabled, sort, anotherName, delete_Flag, tenant_id id, nativeName, enabled, sort, anotherName, delete_Flag
</sql> </sql>
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.MaterialPropertyExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.MaterialPropertyExample" resultMap="BaseResultMap">
<!-- <!--
...@@ -139,11 +138,11 @@ ...@@ -139,11 +138,11 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
insert into jsh_materialproperty (id, nativeName, enabled, insert into jsh_materialproperty (id, nativeName, enabled,
sort, anotherName, delete_Flag, sort, anotherName, delete_Flag
tenant_id) )
values (#{id,jdbcType=BIGINT}, #{nativename,jdbcType=VARCHAR}, #{enabled,jdbcType=BIT}, values (#{id,jdbcType=BIGINT}, #{nativename,jdbcType=VARCHAR}, #{enabled,jdbcType=BIT},
#{sort,jdbcType=VARCHAR}, #{anothername,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=VARCHAR}, #{sort,jdbcType=VARCHAR}, #{anothername,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=VARCHAR}
#{tenantId,jdbcType=BIGINT}) )
</insert> </insert>
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.MaterialProperty"> <insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.MaterialProperty">
<!-- <!--
...@@ -170,9 +169,6 @@ ...@@ -170,9 +169,6 @@
<if test="deleteFlag != null"> <if test="deleteFlag != null">
delete_Flag, delete_Flag,
</if> </if>
<if test="tenantId != null">
tenant_id,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
...@@ -193,9 +189,6 @@ ...@@ -193,9 +189,6 @@
<if test="deleteFlag != null"> <if test="deleteFlag != null">
#{deleteFlag,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=VARCHAR},
</if> </if>
<if test="tenantId != null">
#{tenantId,jdbcType=BIGINT},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="com.jsh.erp.datasource.entities.MaterialPropertyExample" resultType="java.lang.Integer"> <select id="countByExample" parameterType="com.jsh.erp.datasource.entities.MaterialPropertyExample" resultType="java.lang.Integer">
...@@ -233,9 +226,6 @@ ...@@ -233,9 +226,6 @@
<if test="record.deleteFlag != null"> <if test="record.deleteFlag != null">
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}, delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR},
</if> </if>
<if test="record.tenantId != null">
tenant_id = #{record.tenantId,jdbcType=BIGINT},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
...@@ -252,8 +242,7 @@ ...@@ -252,8 +242,7 @@
enabled = #{record.enabled,jdbcType=BIT}, enabled = #{record.enabled,jdbcType=BIT},
sort = #{record.sort,jdbcType=VARCHAR}, sort = #{record.sort,jdbcType=VARCHAR},
anotherName = #{record.anothername,jdbcType=VARCHAR}, anotherName = #{record.anothername,jdbcType=VARCHAR},
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}, delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}
tenant_id = #{record.tenantId,jdbcType=BIGINT}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
...@@ -280,9 +269,6 @@ ...@@ -280,9 +269,6 @@
<if test="deleteFlag != null"> <if test="deleteFlag != null">
delete_Flag = #{deleteFlag,jdbcType=VARCHAR}, delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
</if> </if>
<if test="tenantId != null">
tenant_id = #{tenantId,jdbcType=BIGINT},
</if>
</set> </set>
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
...@@ -296,8 +282,7 @@ ...@@ -296,8 +282,7 @@
enabled = #{enabled,jdbcType=BIT}, enabled = #{enabled,jdbcType=BIT},
sort = #{sort,jdbcType=VARCHAR}, sort = #{sort,jdbcType=VARCHAR},
anotherName = #{anothername,jdbcType=VARCHAR}, anotherName = #{anothername,jdbcType=VARCHAR},
delete_Flag = #{deleteFlag,jdbcType=VARCHAR}, delete_Flag = #{deleteFlag,jdbcType=VARCHAR}
tenant_id = #{tenantId,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
</mapper> </mapper>
\ No newline at end of file
...@@ -5,9 +5,8 @@ ...@@ -5,9 +5,8 @@
select * select *
FROM jsh_materialproperty FROM jsh_materialproperty
where 1=1 where 1=1
<if test="name != null and name != ''"> <if test="name != null">
<bind name="nativeName" value="'%' + _parameter.name + '%'"/> and nativeName like '%${name}%'
and nativeName like #{nativeName}
</if> </if>
and ifnull(delete_Flag,'0') !='1' and ifnull(delete_Flag,'0') !='1'
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
...@@ -19,9 +18,8 @@ ...@@ -19,9 +18,8 @@
COUNT(id) COUNT(id)
FROM jsh_materialproperty FROM jsh_materialproperty
WHERE 1=1 WHERE 1=1
<if test="name != null and name != ''"> <if test="name != null">
<bind name="nativeName" value="'%' + _parameter.name + '%'"/> and nativeName like '%${name}%'
and nativeName like #{nativeName}
</if> </if>
and ifnull(delete_Flag,'0') !='1' and ifnull(delete_Flag,'0') !='1'
</select> </select>
......
...@@ -5,12 +5,11 @@ ...@@ -5,12 +5,11 @@
select * select *
FROM jsh_person FROM jsh_person
where 1=1 where 1=1
<if test="name != null and name != ''"> <if test="name != null">
<bind name="name" value="'%' + _parameter.name + '%'"/> and name like '%${name}%'
and name like #{name}
</if> </if>
<if test="type != null"> <if test="type != null">
and type=#{type} and type='${type}'
</if> </if>
and ifnull(delete_Flag,'0') !='1' and ifnull(delete_Flag,'0') !='1'
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
...@@ -22,12 +21,11 @@ ...@@ -22,12 +21,11 @@
COUNT(id) COUNT(id)
FROM jsh_person FROM jsh_person
WHERE 1=1 WHERE 1=1
<if test="name != null and name != ''"> <if test="name != null">
<bind name="name" value="'%' + _parameter.name + '%'"/> and name like '%${name}%'
and name like #{name}
</if> </if>
<if test="type != null"> <if test="type != null">
and type=#{type} and type='${type}'
</if> </if>
and ifnull(delete_Flag,'0') !='1' and ifnull(delete_Flag,'0') !='1'
</select> </select>
......
...@@ -6,9 +6,8 @@ ...@@ -6,9 +6,8 @@
FROM jsh_role FROM jsh_role
WHERE 1=1 WHERE 1=1
and ifnull(delete_Flag,'0') !='1' and ifnull(delete_Flag,'0') !='1'
<if test="name != null and name != ''"> <if test="name != null">
<bind name="name" value="'%' + _parameter.name + '%'"/> and name like '%${name}%'
and name like #{name}
</if> </if>
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
limit #{offset},#{rows} limit #{offset},#{rows}
...@@ -20,9 +19,8 @@ ...@@ -20,9 +19,8 @@
FROM jsh_role FROM jsh_role
WHERE 1=1 WHERE 1=1
and ifnull(delete_Flag,'0') !='1' and ifnull(delete_Flag,'0') !='1'
<if test="name != null and name != ''"> <if test="name != null">
<bind name="name" value="'%' + _parameter.name + '%'"/> and name like '%${name}%'
and name like #{name}
</if> </if>
</select> </select>
<update id="batchDeleteRoleByIds"> <update id="batchDeleteRoleByIds">
...@@ -35,14 +33,4 @@ ...@@ -35,14 +33,4 @@
</foreach> </foreach>
) )
</update> </update>
<select id="getRoleList" resultMap="com.jsh.erp.datasource.mappers.RoleMapper.BaseResultMap">
SELECT *
FROM jsh_role
WHERE 1=1
and ifnull(delete_Flag,'0') !='1'
<if test="name != null and name != ''">
<bind name="name" value="'%' + _parameter.name + '%'"/>
and name like #{name}
</if>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -5,24 +5,20 @@ ...@@ -5,24 +5,20 @@
select * select *
FROM jsh_supplier FROM jsh_supplier
where 1=1 where 1=1
<if test="supplier != null and supplier != ''"> <if test="supplier != null">
<bind name="supplier" value="'%' + _parameter.supplier + '%'"/> and supplier like '%${supplier}%'
and supplier like #{supplier}
</if> </if>
<if test="type != null"> <if test="type != null">
and type=#{type} and type='${type}'
</if> </if>
<if test="phonenum != null and phonenum != ''"> <if test="phonenum != null">
<bind name="phonenum" value="'%' + _parameter.phonenum + '%'"/> and phonenum like '%${phonenum}%'
and phonenum like #{phonenum}
</if> </if>
<if test="telephone != null and telephone != ''"> <if test="telephone != null">
<bind name="telephone" value="'%' + _parameter.telephone + '%'"/> and telephone like '%${telephone}%'
and telephone like #{telephone}
</if> </if>
<if test="description != null and description != ''"> <if test="description != null">
<bind name="description" value="'%' + _parameter.description + '%'"/> and description like '%${description}%'
and description like #{description}
</if> </if>
and ifnull(delete_Flag,'0') !='1' and ifnull(delete_Flag,'0') !='1'
order by id desc order by id desc
...@@ -35,24 +31,20 @@ ...@@ -35,24 +31,20 @@
COUNT(id) COUNT(id)
FROM jsh_supplier FROM jsh_supplier
WHERE 1=1 WHERE 1=1
<if test="supplier != null and supplier != ''"> <if test="supplier != null">
<bind name="supplier" value="'%' + _parameter.supplier + '%'"/> and supplier like '%${supplier}%'
and supplier like #{supplier}
</if> </if>
<if test="type != null"> <if test="type != null">
and type=#{type} and type='${type}'
</if> </if>
<if test="phonenum != null and phonenum != ''"> <if test="phonenum != null">
<bind name="phonenum" value="'%' + _parameter.phonenum + '%'"/> and phonenum like '%${phonenum}%'
and phonenum like #{phonenum}
</if> </if>
<if test="telephone != null and telephone != ''"> <if test="telephone != null">
<bind name="telephone" value="'%' + _parameter.telephone + '%'"/> and telephone like '%${telephone}%'
and telephone like #{telephone}
</if> </if>
<if test="description != null and description != ''"> <if test="description != null">
<bind name="description" value="'%' + _parameter.description + '%'"/> and description like '%${description}%'
and description like #{description}
</if> </if>
and ifnull(delete_Flag,'0') !='1' and ifnull(delete_Flag,'0') !='1'
</select> </select>
...@@ -61,24 +53,20 @@ ...@@ -61,24 +53,20 @@
select * select *
FROM jsh_supplier FROM jsh_supplier
where 1=1 where 1=1
<if test="supplier != null and supplier != ''"> <if test="supplier != null">
<bind name="supplier" value="'%' + _parameter.supplier + '%'"/> and supplier like '%${supplier}%'
and supplier like #{supplier}
</if> </if>
<if test="type != null"> <if test="type != null">
and type=#{type} and type='${type}'
</if> </if>
<if test="phonenum != null and phonenum != ''"> <if test="phonenum != null">
<bind name="phonenum" value="'%' + _parameter.phonenum + '%'"/> and phonenum like '%${phonenum}%'
and phonenum like #{phonenum}
</if> </if>
<if test="telephone != null and telephone != ''"> <if test="telephone != null">
<bind name="telephone" value="'%' + _parameter.telephone + '%'"/> and telephone like '%${telephone}%'
and telephone like #{telephone}
</if> </if>
<if test="description != null and description != ''"> <if test="description != null">
<bind name="description" value="'%' + _parameter.description + '%'"/> and description like '%${description}%'
and description like #{description}
</if> </if>
and ifnull(delete_Flag,'0') !='1' and ifnull(delete_Flag,'0') !='1'
</select> </select>
......
...@@ -5,9 +5,8 @@ ...@@ -5,9 +5,8 @@
select * select *
FROM jsh_systemconfig FROM jsh_systemconfig
where 1=1 where 1=1
<if test="companyName != null and companyName != ''"> <if test="companyName != null">
<bind name="companyName" value="'%' + _parameter.companyName + '%'"/> and company_name like '%${companyName}%'
and company_name like #{companyName}
</if> </if>
and ifnull(delete_Flag,'0') !='1' and ifnull(delete_Flag,'0') !='1'
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
...@@ -19,9 +18,8 @@ ...@@ -19,9 +18,8 @@
COUNT(id) COUNT(id)
FROM jsh_systemconfig FROM jsh_systemconfig
WHERE 1=1 WHERE 1=1
<if test="companyName != null and companyName != ''"> <if test="companyName != null">
<bind name="companyName" value="'%' + _parameter.companyName + '%'"/> and company_name like '%${companyName}%'
and company_name like #{companyName}
</if> </if>
and ifnull(delete_Flag,'0') !='1' and ifnull(delete_Flag,'0') !='1'
</select> </select>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment