Work notes 00

1, mysql query all the tables in a database

SELECT
table_name,
table_comment
FROM
information_schema.tables
WHERE table_schema = 'ysy_cat';

2, mybatis plus query date range

<= IF Test "the beginDate! = null"> 
the AND soo.stock_out_date <! [CDATA [> =]]> the beginDate # {}
</ IF>
<= IF Test "endDate! = null">
the AND soo.stock_out_date <! [CDATA [<=]]> endDate # {}
</ IF>
. 3, MySQL will be converted to a date datetime types:
the SELECT the cONVERT ( 'incoming time', DATE)
. 4, the if-else wording MyBatis
<choose>
   <when test="item.id != null and item.id !=''">
     #{item.id,jdbcType=CHAR},
   </when>
   <otherwise>
     '',
   </otherwise>
</choose>
5、sourcetree錯誤:error: Your local changes to the following files would be overwritten by merge:解決办法
git stash
git pull origin master
git stash pop
6、mybatis中模糊查询
AND u.name LIKE CONCAT(CONCAT('%',#{applicantId},'%'))
7、

<insert id="insertStockOutOrder" parameterType="com.yunsunyun.entity.monitor.po.CaStockOutOrder">
    <selectKey resultType ="java.lang.Long" keyProperty= "id" order= "AFTER">
SELECT LAST_INSERT_ID()
</selectKey >
INSERT INTO ca_stock_out_order (warehouse_id,code,create_id,create_time)
VALUE (#{warehouseId},#{code},#{createId},#{createTime})
</insert>

<insert id="insertStockOutOrderItem" parameterType="java.util.List">
<selectKey resultType ="java.lang.Long" keyProperty= "id" order= "AFTER">
SELECT LAST_INSERT_ID()
</selectKey >
INSERT INTO ca_stock_out_order_item (stock_out_order_id,asset_id,quantity,in_order_item_type)
values
<foreach collection ="list" item="orderItemVos" index= "index" separator =",">
(
#{orderItemVos.stockOutOrderId}, #{orderItemVos.assetId},
#{orderItemVos.quantity},
#{orderItemVos.orderItemType}
)
</foreach >
</insert>
---------
select STR_TO_DATE (# {startTime}, '% H:% i:% s') 
the string to a desired time format

select str_to_date(‘09/01/2009’,’%m/%d/%Y’)

select str_to_date(‘20140422154706’,’%Y%m%d%H%i%s’)

select str_to_date(‘2014-04-22 15:47:06’,’%Y-%m-%d %H:%i:%s’)

 
 

Guess you like

Origin www.cnblogs.com/lcwstudy/p/10874446.html